diff --git a/gfx/gfx_animation.c b/gfx/gfx_animation.c index 61a03d4299..da3088889a 100644 --- a/gfx/gfx_animation.c +++ b/gfx/gfx_animation.c @@ -2197,28 +2197,6 @@ void gfx_animation_deinit(gfx_animation_t *p_anim) memset(p_anim, 0, sizeof(*p_anim)); } -bool gfx_animation_ctl(enum gfx_animation_ctl_state state, void *data) -{ - gfx_animation_t *p_anim = anim_get_ptr(); - - switch (state) - { - case MENU_ANIMATION_CTL_CLEAR_ACTIVE: - p_anim->animation_is_active = false; - p_anim->ticker_is_active = false; - break; - case MENU_ANIMATION_CTL_SET_ACTIVE: - p_anim->animation_is_active = true; - p_anim->ticker_is_active = true; - break; - case MENU_ANIMATION_CTL_NONE: - default: - break; - } - - return true; -} - void gfx_timer_start(gfx_timer_t *timer, gfx_timer_ctx_entry_t *timer_entry) { gfx_animation_ctx_entry_t entry; diff --git a/gfx/gfx_animation.h b/gfx/gfx_animation.h index 789f9b00bf..29c41f060e 100644 --- a/gfx/gfx_animation.h +++ b/gfx/gfx_animation.h @@ -31,18 +31,23 @@ RETRO_BEGIN_DECLS #define ANIM_IS_ACTIVE(_p) ((_p)->animation_is_active || (_p)->ticker_is_active) +#define GFX_ANIMATION_CLEAR_ACTIVE(anim) \ +{ \ + (anim)->animation_is_active = false; \ + (anim)->ticker_is_active = false; \ +} + +#define GFX_ANIMATION_SET_ACTIVE(anim) \ +{ \ + (anim)->animation_is_active = true; \ + (anim)->ticker_is_active = true; \ +} + typedef void (*tween_cb) (void*); typedef void (*update_time_cb) (float *ticker_pixel_increment, unsigned width, unsigned height); -enum gfx_animation_ctl_state -{ - MENU_ANIMATION_CTL_NONE = 0, - MENU_ANIMATION_CTL_CLEAR_ACTIVE, - MENU_ANIMATION_CTL_SET_ACTIVE -}; - enum gfx_animation_easing_type { /* Linear */ @@ -251,8 +256,6 @@ bool gfx_animation_push(gfx_animation_ctx_entry_t *entry); 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); - void gfx_animation_set_update_time_cb(update_time_cb cb); void gfx_animation_unset_update_time_cb(void); diff --git a/menu/cbs/menu_cbs_get_value.c b/menu/cbs/menu_cbs_get_value.c index 6dc332f8b5..f082dcd5ff 100644 --- a/menu/cbs/menu_cbs_get_value.c +++ b/menu/cbs/menu_cbs_get_value.c @@ -707,13 +707,14 @@ static void general_disp_set_label_perf_counters( const char *path, unsigned *w ) { + gfx_animation_t *p_anim = anim_get_ptr(); *s = '\0'; *w = 19; strlcpy(s2, path, len2); menu_action_setting_disp_set_label_perf_counters_common( counters, offset, s, len); - gfx_animation_ctl(MENU_ANIMATION_CTL_SET_ACTIVE, NULL); + GFX_ANIMATION_CLEAR_ACTIVE(p_anim); } static void menu_action_setting_disp_set_label_perf_counters( diff --git a/menu/drivers/ozone/ozone.c b/menu/drivers/ozone/ozone.c index 2675da8fe1..d35a508d90 100644 --- a/menu/drivers/ozone/ozone.c +++ b/menu/drivers/ozone/ozone.c @@ -1671,6 +1671,7 @@ static void ozone_render(void *data, unsigned language = *msg_hash_get_uint(MSG_HASH_USER_LANGUAGE); ozone_handle_t *ozone = (ozone_handle_t*)data; gfx_display_t *p_disp = disp_get_ptr(); + gfx_animation_t *p_anim = anim_get_ptr(); if (!ozone) return; @@ -2044,7 +2045,7 @@ static void ozone_render(void *data, menu_entries_ctl(MENU_ENTRIES_CTL_SET_START, &i); } - gfx_animation_ctl(MENU_ANIMATION_CTL_CLEAR_ACTIVE, NULL); + GFX_ANIMATION_CLEAR_ACTIVE(p_anim); } static void ozone_draw_header(ozone_handle_t *ozone, diff --git a/menu/drivers/rgui.c b/menu/drivers/rgui.c index bffd4f952c..54bc0e5c46 100644 --- a/menu/drivers/rgui.c +++ b/menu/drivers/rgui.c @@ -3536,7 +3536,7 @@ static void rgui_render(void *data, rgui->bg_modified = false; p_disp->framebuf_dirty = true; - gfx_animation_ctl(MENU_ANIMATION_CTL_CLEAR_ACTIVE, NULL); + GFX_ANIMATION_CLEAR_ACTIVE(p_anim); rgui->force_redraw = false; diff --git a/menu/drivers/stripes.c b/menu/drivers/stripes.c index bd77fa0cf4..d1355bbe62 100644 --- a/menu/drivers/stripes.c +++ b/menu/drivers/stripes.c @@ -2620,9 +2620,10 @@ static void stripes_render(void *data, { size_t i; menu_input_pointer_t pointer; - settings_t *settings = config_get_ptr(); - stripes_handle_t *stripes = (stripes_handle_t*)data; - unsigned end = (unsigned)menu_entries_get_size(); + settings_t *settings = config_get_ptr(); + stripes_handle_t *stripes = (stripes_handle_t*)data; + unsigned end = (unsigned)menu_entries_get_size(); + gfx_animation_t *p_anim = anim_get_ptr(); if (!stripes) return; @@ -2661,7 +2662,7 @@ static void stripes_render(void *data, menu_entries_ctl(MENU_ENTRIES_CTL_SET_START, &i); } - gfx_animation_ctl(MENU_ANIMATION_CTL_CLEAR_ACTIVE, NULL); + GFX_ANIMATION_CLEAR_ACTIVE(p_anim); } static bool stripes_shader_pipeline_active(unsigned menu_shader_pipeline) diff --git a/menu/drivers/xmb.c b/menu/drivers/xmb.c index f20d11807a..965f58dff8 100644 --- a/menu/drivers/xmb.c +++ b/menu/drivers/xmb.c @@ -3839,6 +3839,7 @@ static void xmb_render(void *data, settings_t *settings = config_get_ptr(); unsigned end = (unsigned)menu_entries_get_size(); gfx_display_t *p_disp = disp_get_ptr(); + gfx_animation_t *p_anim = anim_get_ptr(); if (!xmb) return; @@ -4009,7 +4010,7 @@ static void xmb_render(void *data, menu_entries_ctl(MENU_ENTRIES_CTL_SET_START, &i); } - gfx_animation_ctl(MENU_ANIMATION_CTL_CLEAR_ACTIVE, NULL); + GFX_ANIMATION_CLEAR_ACTIVE(p_anim); } static bool xmb_shader_pipeline_active(unsigned menu_shader_pipeline) diff --git a/menu/menu_setting.c b/menu/menu_setting.c index 5ede0025a2..4de5e5f25a 100644 --- a/menu/menu_setting.c +++ b/menu/menu_setting.c @@ -6826,6 +6826,7 @@ setting_get_string_representation_st_float_video_refresh_rate_auto( double video_refresh_rate = 0.0; double deviation = 0.0; unsigned sample_points = 0; + gfx_animation_t *p_anim = anim_get_ptr(); if (!setting) return; @@ -6834,7 +6835,7 @@ setting_get_string_representation_st_float_video_refresh_rate_auto( { snprintf(s, len, "%.3f Hz (%.1f%% dev, %u samples)", video_refresh_rate, 100.0 * deviation, sample_points); - gfx_animation_ctl(MENU_ANIMATION_CTL_SET_ACTIVE, NULL); + GFX_ANIMATION_SET_ACTIVE(p_anim); } else strlcpy(s, msg_hash_to_str(MENU_ENUM_LABEL_VALUE_NOT_AVAILABLE), len);