Create runloop_get_status

This commit is contained in:
twinaphex 2017-01-22 16:22:20 +01:00
parent c91a4fa12e
commit a1594615f0
3 changed files with 18 additions and 3 deletions

View File

@ -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();
}

View File

@ -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)
{

View File

@ -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