Get rid of getter functions

This commit is contained in:
twinaphex 2020-10-14 02:33:15 +02:00
parent ac03578617
commit 7c48e77bcd
8 changed files with 11 additions and 25 deletions

View File

@ -2241,15 +2241,3 @@ void gfx_timer_start(gfx_timer_t *timer, gfx_timer_ctx_entry_t *timer_entry)
gfx_animation_push(&entry); gfx_animation_push(&entry);
} }
uint64_t gfx_animation_get_ticker_idx(void)
{
gfx_animation_t *p_anim = anim_get_ptr();
return p_anim->ticker_idx;
}
uint64_t gfx_animation_get_ticker_slow_idx(void)
{
gfx_animation_t *p_anim = anim_get_ptr();
return p_anim->ticker_slow_idx;
}

View File

@ -253,10 +253,6 @@ void gfx_animation_push_delayed(unsigned delay, gfx_animation_ctx_entry_t *entry
bool gfx_animation_ctl(enum gfx_animation_ctl_state state, void *data); bool gfx_animation_ctl(enum gfx_animation_ctl_state state, void *data);
uint64_t gfx_animation_get_ticker_idx(void);
uint64_t gfx_animation_get_ticker_slow_idx(void);
void gfx_animation_set_update_time_cb(update_time_cb cb); void gfx_animation_set_update_time_cb(update_time_cb cb);
void gfx_animation_unset_update_time_cb(void); void gfx_animation_unset_update_time_cb(void);

View File

@ -204,6 +204,7 @@ static void gfx_widget_screenshot_frame(void* data, void *user_data)
unsigned video_height = video_info->height; unsigned video_height = video_info->height;
dispgfx_widget_t *p_dispwidget = (dispgfx_widget_t*)user_data; dispgfx_widget_t *p_dispwidget = (dispgfx_widget_t*)user_data;
gfx_display_t *p_disp = disp_get_ptr(); gfx_display_t *p_disp = disp_get_ptr();
gfx_animation_t *p_anim = anim_get_ptr();
gfx_widget_screenshot_state_t *state = &p_w_screenshot_st; gfx_widget_screenshot_state_t *state = &p_w_screenshot_st;
gfx_widget_font_data_t* font_regular = &p_dispwidget->gfx_widget_fonts.regular; gfx_widget_font_data_t* font_regular = &p_dispwidget->gfx_widget_fonts.regular;
int padding = (state->height - (font_regular->line_height * 2.0f)) / 2.0f; int padding = (state->height - (font_regular->line_height * 2.0f)) / 2.0f;
@ -246,7 +247,7 @@ static void gfx_widget_screenshot_frame(void* data, void *user_data)
TEXT_ALIGN_LEFT, TEXT_ALIGN_LEFT,
true); true);
ticker.idx = gfx_animation_get_ticker_idx(); ticker.idx = p_anim->ticker_idx;
ticker.len = state->shotname_length; ticker.len = state->shotname_length;
ticker.s = shotname; ticker.s = shotname;
ticker.selected = true; ticker.selected = true;

View File

@ -668,7 +668,7 @@ border_iterate:
} }
else else
{ {
ticker.idx = gfx_animation_get_ticker_idx(); ticker.idx = p_anim->ticker_idx;
ticker.type_enum = menu_ticker_type; ticker.type_enum = menu_ticker_type;
ticker.spacer = ticker_spacer; ticker.spacer = ticker_spacer;
} }
@ -1170,7 +1170,7 @@ void ozone_draw_thumbnail_bar(ozone_handle_t *ozone,
} }
else else
{ {
ticker.idx = gfx_animation_get_ticker_idx(); ticker.idx = p_anim->ticker_idx;
ticker.type_enum = menu_ticker_type; ticker.type_enum = menu_ticker_type;
ticker.spacer = ticker_spacer; ticker.spacer = ticker_spacer;

View File

@ -205,7 +205,7 @@ void ozone_draw_sidebar(
} }
else else
{ {
ticker.idx = gfx_animation_get_ticker_idx(); ticker.idx = p_anim->ticker_idx;
ticker.type_enum = menu_ticker_type; ticker.type_enum = menu_ticker_type;
ticker.spacer = ticker_spacer; ticker.spacer = ticker_spacer;
} }

View File

@ -3619,7 +3619,7 @@ static void rgui_render(void *data,
} }
else else
{ {
ticker.idx = gfx_animation_get_ticker_idx(); ticker.idx = p_anim->ticker_idx;
ticker.type_enum = menu_ticker_type; ticker.type_enum = menu_ticker_type;
ticker.spacer = ticker_spacer; ticker.spacer = ticker_spacer;
} }

View File

@ -2281,6 +2281,7 @@ static int stripes_draw_item(
stripes_node_t * node = (stripes_node_t*) stripes_node_t * node = (stripes_node_t*)
file_list_get_userdata_at_offset(list, i); file_list_get_userdata_at_offset(list, i);
settings_t *settings = config_get_ptr(); settings_t *settings = config_get_ptr();
gfx_animation_t *p_anim = anim_get_ptr();
/* Initial ticker configuration */ /* Initial ticker configuration */
ticker.type_enum = settings->uints.menu_ticker_type; ticker.type_enum = settings->uints.menu_ticker_type;
@ -2400,7 +2401,7 @@ static int stripes_draw_item(
ticker.s = tmp; ticker.s = tmp;
ticker.len = ticker_limit; ticker.len = ticker_limit;
ticker.idx = gfx_animation_get_ticker_idx(); ticker.idx = p_anim->ticker_idx;
ticker.str = ticker_str; ticker.str = ticker_str;
ticker.selected = (i == current); ticker.selected = (i == current);
@ -2436,7 +2437,7 @@ static int stripes_draw_item(
ticker.s = tmp; ticker.s = tmp;
ticker.len = 35 * stripes_scale_mod[7]; ticker.len = 35 * stripes_scale_mod[7];
ticker.idx = gfx_animation_get_ticker_idx(); ticker.idx = p_anim->ticker_idx;
ticker.selected = (i == current); ticker.selected = (i == current);
if (!string_is_empty(entry->value)) if (!string_is_empty(entry->value))

View File

@ -3066,7 +3066,7 @@ static int xmb_draw_item(
} }
else else
{ {
ticker.idx = gfx_animation_get_ticker_idx(); ticker.idx = p_anim->ticker_idx;
ticker.type_enum = menu_ticker_type; ticker.type_enum = menu_ticker_type;
ticker.spacer = NULL; ticker.spacer = NULL;
} }
@ -3292,7 +3292,7 @@ static int xmb_draw_item(
else else
{ {
line_ticker.type_enum = menu_ticker_type; line_ticker.type_enum = menu_ticker_type;
line_ticker.idx = gfx_animation_get_ticker_idx(); line_ticker.idx = p_anim->ticker_idx;
line_ticker.line_len = (size_t)(line_ticker_width); line_ticker.line_len = (size_t)(line_ticker_width);
/* Note: max_lines should be calculated at runtime, /* Note: max_lines should be calculated at runtime,