Get rid of gfx_animation_get_delta_time

This commit is contained in:
twinaphex 2020-09-24 06:14:04 +02:00
parent 2ab0300c33
commit 515e119861
6 changed files with 14 additions and 16 deletions

View File

@ -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();

View File

@ -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);

View File

@ -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;

View File

@ -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;
}

View File

@ -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'

View File

@ -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)
{