From a1594615f09841791697f4882bc65e7b8aabe503 Mon Sep 17 00:00:00 2001 From: twinaphex Date: Sun, 22 Jan 2017 16:22:20 +0100 Subject: [PATCH] Create runloop_get_status --- gfx/video_driver.c | 12 +++++++++--- runloop.c | 7 +++++++ runloop.h | 2 ++ 3 files changed, 18 insertions(+), 3 deletions(-) diff --git a/gfx/video_driver.c b/gfx/video_driver.c index e3747d9b68..46b3b6922c 100644 --- a/gfx/video_driver.c +++ b/gfx/video_driver.c @@ -2249,6 +2249,9 @@ bool video_driver_texture_unload(uintptr_t *id) void video_driver_build_info(video_frame_info_t *video_info) { + bool is_paused = false; + bool is_idle = false; + bool is_slowmotion = false; settings_t *settings = NULL; video_driver_threaded_lock(); settings = config_get_ptr(); @@ -2311,9 +2314,12 @@ void video_driver_build_info(video_frame_info_t *video_info) video_info->xmb_alpha_factor = 0.0f; video_info->menu_wallpaper_opacity = 0.0f; #endif - video_info->runloop_is_paused = runloop_ctl(RUNLOOP_CTL_IS_PAUSED, NULL); - video_info->runloop_is_idle = runloop_ctl(RUNLOOP_CTL_IS_IDLE, NULL); - video_info->runloop_is_slowmotion = runloop_ctl(RUNLOOP_CTL_IS_SLOWMOTION, NULL); + + runloop_get_status(&is_paused, &is_idle, &is_slowmotion); + + video_info->runloop_is_paused = is_paused; + video_info->runloop_is_idle = is_idle; + video_info->runloop_is_slowmotion = is_slowmotion; video_driver_threaded_unlock(); } diff --git a/runloop.c b/runloop.c index 0ea85b80b0..20fa7128cc 100644 --- a/runloop.c +++ b/runloop.c @@ -204,6 +204,13 @@ static bool rarch_game_specific_options(char **output) return true; } +void runloop_get_status(bool *is_paused, bool *is_idle, + bool *is_slowmotion) +{ + *is_paused = runloop_paused; + *is_idle = runloop_idle; + *is_slowmotion = runloop_slowmotion; +} bool runloop_ctl(enum runloop_ctl_state state, void *data) { diff --git a/runloop.h b/runloop.h index 6d5dbe9b2f..7e1bebbec1 100644 --- a/runloop.h +++ b/runloop.h @@ -204,6 +204,8 @@ int runloop_iterate(unsigned *sleep_ms); void runloop_msg_queue_push(const char *msg, unsigned prio, unsigned duration, bool flush); +void runloop_get_status(bool *is_paused, bool *is_idle, bool *is_slowmotion); + bool runloop_ctl(enum runloop_ctl_state state, void *data); RETRO_END_DECLS