mirror of
https://github.com/libretro/RetroArch
synced 2025-03-01 07:13:35 +00:00
menu_animation.c - some cleanups
This commit is contained in:
parent
a55e48e88c
commit
72ac1bd407
@ -62,18 +62,13 @@ bool add_tween(float duration, float target_value, float* subject,
|
||||
return true;
|
||||
}
|
||||
|
||||
void update_tweens(float dt)
|
||||
static int iterate_tween(tween_t *tween, float dt,
|
||||
unsigned *active_tweens)
|
||||
{
|
||||
unsigned i;
|
||||
unsigned active_tweens = 0;
|
||||
|
||||
for(i = 0; i < driver.menu->numtweens; i++)
|
||||
{
|
||||
tween_t *tween = &driver.menu->tweens[i];
|
||||
if (!tween)
|
||||
continue;
|
||||
return -1;
|
||||
if (tween->running_since >= tween->duration)
|
||||
continue;
|
||||
return -1;
|
||||
|
||||
tween->running_since += dt;
|
||||
|
||||
@ -93,9 +88,20 @@ void update_tweens(float dt)
|
||||
}
|
||||
|
||||
if (tween->running_since < tween->duration)
|
||||
active_tweens += 1;
|
||||
*active_tweens += 1;
|
||||
|
||||
return 0;
|
||||
}
|
||||
|
||||
void update_tweens(float dt)
|
||||
{
|
||||
unsigned i;
|
||||
unsigned active_tweens = 0;
|
||||
tween_t *tween = &driver.menu->tweens[0];
|
||||
|
||||
for(i = 0; i < driver.menu->numtweens; i++)
|
||||
iterate_tween(tween++, dt, &active_tweens);
|
||||
|
||||
if (!active_tweens)
|
||||
driver.menu->numtweens = 0;
|
||||
}
|
||||
|
Loading…
x
Reference in New Issue
Block a user