diff --git a/menu/drivers/materialui.c b/menu/drivers/materialui.c index 83fd874245..05089e29ff 100644 --- a/menu/drivers/materialui.c +++ b/menu/drivers/materialui.c @@ -579,7 +579,7 @@ static void mui_render(void *data) delta.current = delta_time; - if (menu_animation_ctl(MENU_ANIMATION_CTL_IDEAL_DELTA_TIME_GET, &delta)) + if (menu_animation_get_ideal_delta_time(&delta)) menu_animation_update(delta.ideal); menu_display_set_width(width); diff --git a/menu/drivers/xmb.c b/menu/drivers/xmb.c index 766be1e983..aad1a21397 100644 --- a/menu/drivers/xmb.c +++ b/menu/drivers/xmb.c @@ -2337,7 +2337,7 @@ static void xmb_render(void *data) delta.current = delta_time; - if (menu_animation_ctl(MENU_ANIMATION_CTL_IDEAL_DELTA_TIME_GET, &delta)) + if (menu_animation_get_ideal_delta_time(&delta)) menu_animation_update(delta.ideal); if (settings->menu.pointer.enable || settings->menu.mouse.enable) diff --git a/menu/menu_animation.c b/menu/menu_animation.c index ede7979eb7..52d490ad01 100644 --- a/menu/menu_animation.c +++ b/menu/menu_animation.c @@ -558,6 +558,14 @@ bool menu_animation_ticker(const menu_animation_ctx_ticker_t *ticker) return true; } +bool menu_animation_get_ideal_delta_time(menu_animation_ctx_delta_t *delta) +{ + if (!delta) + return false; + delta->ideal = delta->current / IDEAL_DELTA_TIME; + return true; +} + bool menu_animation_ctl(enum menu_animation_ctl_state state, void *data) { switch (state) @@ -668,15 +676,6 @@ bool menu_animation_ctl(enum menu_animation_ctl_state state, void *data) } } break; - case MENU_ANIMATION_CTL_IDEAL_DELTA_TIME_GET: - { - menu_animation_ctx_delta_t *delta = - (menu_animation_ctx_delta_t*)data; - if (!delta) - return false; - delta->ideal = delta->current / IDEAL_DELTA_TIME; - } - break; case MENU_ANIMATION_CTL_PUSH: return menu_animation_push(&anim, (menu_animation_ctx_entry_t *)data); case MENU_ANIMATION_CTL_NONE: diff --git a/menu/menu_animation.h b/menu/menu_animation.h index cd5db94f31..30be51063b 100644 --- a/menu/menu_animation.h +++ b/menu/menu_animation.h @@ -39,8 +39,7 @@ enum menu_animation_ctl_state MENU_ANIMATION_CTL_UPDATE_TIME, MENU_ANIMATION_CTL_KILL_BY_TAG, MENU_ANIMATION_CTL_KILL_BY_SUBJECT, - MENU_ANIMATION_CTL_PUSH, - MENU_ANIMATION_CTL_IDEAL_DELTA_TIME_GET + MENU_ANIMATION_CTL_PUSH }; enum menu_animation_easing_type @@ -127,6 +126,8 @@ typedef struct menu_animation_ctx_ticker bool menu_animation_update(float delta_time); +bool menu_animation_get_ideal_delta_time(menu_animation_ctx_delta_t *delta); + bool menu_animation_ticker(const menu_animation_ctx_ticker_t *ticker); bool menu_animation_ctl(enum menu_animation_ctl_state state, void *data); diff --git a/menu/menu_event.c b/menu/menu_event.c index f1ac44e807..dca641b310 100644 --- a/menu/menu_event.c +++ b/menu/menu_event.c @@ -182,7 +182,7 @@ unsigned menu_event(uint64_t input, uint64_t trigger_input) delta.current = delta_time; - if (menu_animation_ctl(MENU_ANIMATION_CTL_IDEAL_DELTA_TIME_GET, &delta)) + if (menu_animation_get_ideal_delta_time(&delta)) delay_count += delta.ideal; if (menu_input_dialog_get_display_kb())