From ec370d54b20a5b7f55d9228659a0e9e92fbbf9f7 Mon Sep 17 00:00:00 2001 From: twinaphex Date: Tue, 17 Jan 2017 16:55:34 +0100 Subject: [PATCH] Cleanups --- menu/menu_animation.c | 14 +++++++------- menu/menu_animation.h | 2 +- menu/menu_driver.c | 3 ++- 3 files changed, 10 insertions(+), 9 deletions(-) diff --git a/menu/menu_animation.c b/menu/menu_animation.c index 1b0c400de6..d504552e28 100644 --- a/menu/menu_animation.c +++ b/menu/menu_animation.c @@ -556,22 +556,22 @@ bool menu_animation_get_ideal_delta_time(menu_animation_ctx_delta_t *delta) return true; } -void menu_animation_update_time(void) +void menu_animation_update_time(bool timedate_enable) { - static retro_time_t last_clock_update = 0; - settings_t *settings = config_get_ptr(); + static retro_time_t + last_clock_update = 0; cur_time = cpu_features_get_time_usec(); delta_time = cur_time - old_time; if (delta_time >= IDEAL_DELTA_TIME* 4) - delta_time = IDEAL_DELTA_TIME * 4; + delta_time = IDEAL_DELTA_TIME * 4; if (delta_time <= IDEAL_DELTA_TIME / 4) - delta_time = IDEAL_DELTA_TIME / 4; - old_time = cur_time; + delta_time = IDEAL_DELTA_TIME / 4; + old_time = cur_time; if (((cur_time - last_clock_update) > 1000000) - && settings->menu.timedate_enable) + && timedate_enable) { animation_is_active = true; last_clock_update = cur_time; diff --git a/menu/menu_animation.h b/menu/menu_animation.h index a7a9dfd015..c03eb1edda 100644 --- a/menu/menu_animation.h +++ b/menu/menu_animation.h @@ -127,7 +127,7 @@ bool menu_animation_get_ideal_delta_time(menu_animation_ctx_delta_t *delta); bool menu_animation_ticker(const menu_animation_ctx_ticker_t *ticker); -void menu_animation_update_time(void); +void menu_animation_update_time(bool timedate_enable); bool menu_animation_is_active(void); diff --git a/menu/menu_driver.c b/menu/menu_driver.c index 3c14a13175..6bd0a55681 100644 --- a/menu/menu_driver.c +++ b/menu/menu_driver.c @@ -471,7 +471,8 @@ bool menu_driver_ctl(enum rarch_menu_ctl_state state, void *data) if (BIT64_GET(menu_driver_data->state, MENU_STATE_BLIT)) { - menu_animation_update_time(); + settings_t *settings = config_get_ptr(); + menu_animation_update_time(settings->menu.timedate_enable); menu_driver_ctl(RARCH_MENU_CTL_BLIT_RENDER, NULL); }