(Menu) Cleanups

This commit is contained in:
twinaphex 2015-06-22 02:26:55 +02:00
parent 999343f7e3
commit 1834084567
2 changed files with 16 additions and 9 deletions

View File

@ -278,7 +278,8 @@ void menu_animation_free(menu_animation_t *anim)
free(anim);
}
void menu_animation_kill_by_subject(menu_animation_t *animation, size_t count, const void *subjects)
void menu_animation_kill_by_subject(menu_animation_t *animation,
size_t count, const void *subjects)
{
unsigned i, j, killed = 0;
float **sub = (float**)subjects;
@ -448,9 +449,9 @@ static int menu_animation_iterate(
float dt,
unsigned *active_tweens)
{
if (!tween)
if (!tween || !tween->alive)
return -1;
if (tween->running_since >= tween->duration || !tween->alive)
if (tween->running_since >= tween->duration)
return -1;
tween->running_since += dt;
@ -572,7 +573,8 @@ void menu_animation_update_time(menu_animation_t *anim)
anim->delta_time = IDEAL_DT / 4;
anim->old_time = anim->cur_time;
if (anim->cur_time - last_clock_update > 1000000 && settings->menu.timedate_enable)
if (((anim->cur_time - last_clock_update) > 1000000)
&& settings->menu.timedate_enable)
{
anim->label.is_updated = true;
last_clock_update = anim->cur_time;

View File

@ -230,11 +230,13 @@ void *menu_list_get_userdata_at_offset(const file_list_t *list, size_t idx)
return (menu_file_list_cbs_t*)file_list_get_userdata_at_offset(list, idx);
}
menu_file_list_cbs_t *menu_list_get_actiondata_at_offset(const file_list_t *list, size_t idx)
menu_file_list_cbs_t *menu_list_get_actiondata_at_offset(
const file_list_t *list, size_t idx)
{
if (!list)
return NULL;
return (menu_file_list_cbs_t*)file_list_get_actiondata_at_offset(list, idx);
return (menu_file_list_cbs_t*)
file_list_get_actiondata_at_offset(list, idx);
}
void *menu_list_get_last_stack_actiondata(const menu_list_t *list)
@ -265,12 +267,15 @@ void menu_list_flush_stack(menu_list_t *list,
return;
menu_entries_set_refresh();
menu_list_get_last(list->menu_stack, &path, &label, &type, &entry_idx);
menu_list_get_last(list->menu_stack,
&path, &label, &type, &entry_idx);
while (menu_list_flush_stack_type(needle, label, type, final_type) != 0)
while (menu_list_flush_stack_type(
needle, label, type, final_type) != 0)
{
menu_list_pop(list->menu_stack, &nav->selection_ptr);
menu_list_get_last(list->menu_stack, &path, &label, &type, &entry_idx);
menu_list_get_last(list->menu_stack,
&path, &label, &type, &entry_idx);
}
}