diff --git a/gfx/gfx_animation.c b/gfx/gfx_animation.c index 64f026793a..62d1f39087 100644 --- a/gfx/gfx_animation.c +++ b/gfx/gfx_animation.c @@ -2208,12 +2208,6 @@ bool gfx_animation_kill_by_tag(uintptr_t *tag) return true; } -float gfx_animation_get_delta_time(void) -{ - gfx_animation_t *p_anim = anim_get_ptr(); - return p_anim->delta_time; -} - bool gfx_animation_ctl(enum gfx_animation_ctl_state state, void *data) { gfx_animation_t *p_anim = anim_get_ptr(); diff --git a/gfx/gfx_animation.h b/gfx/gfx_animation.h index 2babbcb274..a290dfb994 100644 --- a/gfx/gfx_animation.h +++ b/gfx/gfx_animation.h @@ -248,8 +248,6 @@ bool gfx_animation_line_ticker(gfx_animation_ctx_line_ticker_t *line_ticker); bool gfx_animation_line_ticker_smooth(gfx_animation_ctx_line_ticker_smooth_t *line_ticker); -float gfx_animation_get_delta_time(void); - bool gfx_animation_kill_by_tag(uintptr_t *tag); bool gfx_animation_push(gfx_animation_ctx_entry_t *entry); diff --git a/gfx/gfx_thumbnail.c b/gfx/gfx_thumbnail.c index d92991bb1b..55be2ef60c 100644 --- a/gfx/gfx_thumbnail.c +++ b/gfx/gfx_thumbnail.c @@ -473,10 +473,11 @@ void gfx_thumbnail_process_stream( * GFX_THUMBNAIL_STATUS_UNKNOWN */ if (thumbnail->status == GFX_THUMBNAIL_STATUS_UNKNOWN) { - gfx_thumbnail_state_t *p_gfx_thumb = gfx_thumb_get_ptr(); + gfx_animation_t *p_anim = anim_get_ptr(); + gfx_thumbnail_state_t *p_gfx_thumb = gfx_thumb_get_ptr(); /* Check if stream delay timer has elapsed */ - thumbnail->delay_timer += gfx_animation_get_delta_time(); + thumbnail->delay_timer += p_anim->delta_time; if (thumbnail->delay_timer > p_gfx_thumb->stream_delay) { @@ -552,7 +553,8 @@ void gfx_thumbnail_process_streams( { /* Check if stream delay timer has elapsed */ gfx_thumbnail_state_t *p_gfx_thumb = gfx_thumb_get_ptr(); - float delta_time = gfx_animation_get_delta_time(); + gfx_animation_t *p_anim = anim_get_ptr(); + float delta_time = p_anim->delta_time; bool request_right = false; bool request_left = false; diff --git a/menu/drivers/materialui.c b/menu/drivers/materialui.c index 678954c80b..eeb303ae75 100644 --- a/menu/drivers/materialui.c +++ b/menu/drivers/materialui.c @@ -3281,8 +3281,9 @@ static bool materialui_render_process_entry_playlist_desktop( /* Check whether metadata needs to be cached */ if (!mui->status_bar.cached) { + gfx_animation_t *p_anim = anim_get_ptr(); /* Check if delay timer has elapsed */ - mui->status_bar.delay_timer += gfx_animation_get_delta_time(); + mui->status_bar.delay_timer += p_anim->delta_time; if (mui->status_bar.delay_timer > mui->thumbnail_stream_delay) { @@ -5242,7 +5243,9 @@ static void materialui_render_entry_touch_feedback( * fade out */ else if (mui->touch_feedback_alpha > 0.0f) { - mui->touch_feedback_alpha -= (gfx_animation_get_delta_time() * 1000.0f) / (float)MENU_INPUT_PRESS_TIME_SHORT; + gfx_animation_t *p_anim = anim_get_ptr(); + mui->touch_feedback_alpha -= (p_anim->delta_time * 1000.0f) + / (float)MENU_INPUT_PRESS_TIME_SHORT; mui->touch_feedback_alpha = (mui->touch_feedback_alpha < 0.0f) ? 0.0f : mui->touch_feedback_alpha; } diff --git a/menu/drivers/rgui.c b/menu/drivers/rgui.c index 1e9d961540..9812f0c531 100644 --- a/menu/drivers/rgui.c +++ b/menu/drivers/rgui.c @@ -1453,6 +1453,7 @@ static void rgui_render_particle_effect(rgui_t *rgui) * risk of clashing with specific particle effect * implementation variables... */ float global_speed_factor = 1.0f; + gfx_animation_t *p_anim = anim_get_ptr(); settings_t *settings = config_get_ptr(); float particle_effect_speed = settings ? settings->floats.menu_rgui_particle_effect_speed : 0.0f; @@ -1469,7 +1470,7 @@ static void rgui_render_particle_effect(rgui_t *rgui) /* > Account for non-standard frame times * (high/low refresh rates, or frame drops) */ - global_speed_factor *= gfx_animation_get_delta_time() + global_speed_factor *= p_anim->delta_time / particle_effect_period; /* Note: It would be more elegant to have 'update' and 'draw' diff --git a/retroarch.c b/retroarch.c index d327e60c12..902cfa0fa9 100644 --- a/retroarch.c +++ b/retroarch.c @@ -25726,7 +25726,7 @@ static unsigned menu_event( if (set_scroll) menu_st->scroll.acceleration = (unsigned)(new_scroll_accel); - delay_count += gfx_animation_get_delta_time(); + delay_count += p_rarch->anim.delta_time; if (display_kb) { @@ -33510,7 +33510,7 @@ static void video_driver_frame(const void *data, unsigned width, RUNLOOP_MSG_QUEUE_LOCK(); /* Check whether duration timer has elapsed */ - runloop_core_status_msg.duration -= gfx_animation_get_delta_time(); + runloop_core_status_msg.duration -= p_rarch->anim.delta_time; if (runloop_core_status_msg.duration < 0.0f) {