diff --git a/gfx/video_thread_wrapper.c b/gfx/video_thread_wrapper.c index 5ee30c2167..917c9b138e 100644 --- a/gfx/video_thread_wrapper.c +++ b/gfx/video_thread_wrapper.c @@ -28,6 +28,7 @@ #include "font_driver.h" #include "../retroarch.h" +#include "../runloop.h" #include "../verbosity.h" static void *video_thread_init_never_call(const video_info_t *video, @@ -492,12 +493,15 @@ static void video_thread_loop(void *data) static bool video_thread_alive(void *data) { bool ret; + uint32_t runloop_flags; thread_video_t *thr = (thread_video_t*)data; if (!thr) return false; + + runloop_flags = runloop_get_flags(); - if (retroarch_ctl(RARCH_CTL_IS_PAUSED, NULL)) + if (runloop_flags & RUNLOOP_FLAG_PAUSED) { thread_packet_t pkt; pkt.type = CMD_ALIVE; diff --git a/input/drivers/android_input.c b/input/drivers/android_input.c index 4fd5cd11ee..886f2de6a9 100644 --- a/input/drivers/android_input.c +++ b/input/drivers/android_input.c @@ -44,6 +44,7 @@ #include "../../configuration.h" #include "../../retroarch.h" +#include "../../runloop.h" #define MAX_TOUCH 16 #define MAX_NUM_KEYBOARDS 3 @@ -1491,7 +1492,8 @@ static void android_input_poll(void *data) if (android_app->reinitRequested != 0) { - if (retroarch_ctl(RARCH_CTL_IS_PAUSED, NULL)) + uint32_t runloop_flags = runloop_get_flags(); + if (runloop_flags & RUNLOOP_FLAG_PAUSED) command_event(CMD_EVENT_REINIT, NULL); android_app_write_cmd(android_app, APP_CMD_REINIT_DONE); return; @@ -1515,7 +1517,8 @@ bool android_run_events(void *data) if (android_app->reinitRequested != 0) { - if (retroarch_ctl(RARCH_CTL_IS_PAUSED, NULL)) + uint32_t runloop_flags = runloop_get_flags(); + if (runloop_flags & RUNLOOP_FLAG_PAUSED) command_event(CMD_EVENT_REINIT, NULL); android_app_write_cmd(android_app, APP_CMD_REINIT_DONE); } diff --git a/retroarch.c b/retroarch.c index 7540bfd98c..bc94aaed38 100644 --- a/retroarch.c +++ b/retroarch.c @@ -5820,8 +5820,6 @@ bool retroarch_ctl(enum rarch_ctl_state state, void *data) sizeof(input_st->analog_requested)); } break; - case RARCH_CTL_IS_IDLE: - return ((runloop_st->flags & RUNLOOP_FLAG_IDLE) > 0); case RARCH_CTL_SET_IDLE: { bool *ptr = (bool*)data; @@ -5844,8 +5842,6 @@ bool retroarch_ctl(enum rarch_ctl_state state, void *data) runloop_st->flags &= ~RUNLOOP_FLAG_PAUSED; } break; - case RARCH_CTL_IS_PAUSED: - return ((runloop_st->flags & RUNLOOP_FLAG_PAUSED) > 0); case RARCH_CTL_SET_SHUTDOWN: runloop_st->flags |= RUNLOOP_FLAG_SHUTDOWN_INITIATED; break; diff --git a/retroarch_types.h b/retroarch_types.h index b1ca7f5fa1..70bd0eb447 100644 --- a/retroarch_types.h +++ b/retroarch_types.h @@ -81,7 +81,6 @@ enum rarch_ctl_state RARCH_CTL_HAS_SET_SUBSYSTEMS, - RARCH_CTL_IS_IDLE, RARCH_CTL_SET_IDLE, RARCH_CTL_SET_WINDOWED_SCALE, @@ -96,7 +95,6 @@ enum rarch_ctl_state RARCH_CTL_SET_MISSING_BIOS, RARCH_CTL_UNSET_MISSING_BIOS, - RARCH_CTL_IS_PAUSED, RARCH_CTL_SET_PAUSED, RARCH_CTL_SET_SHUTDOWN, diff --git a/ui/drivers/ui_cocoatouch.m b/ui/drivers/ui_cocoatouch.m index f997e86515..63e230645d 100644 --- a/ui/drivers/ui_cocoatouch.m +++ b/ui/drivers/ui_cocoatouch.m @@ -81,6 +81,7 @@ static void ui_companion_cocoatouch_event_command( static void rarch_draw_observer(CFRunLoopObserverRef observer, CFRunLoopActivity activity, void *info) { + uint32_t runloop_flags; int ret = runloop_iterate(); task_queue_check(); @@ -93,9 +94,9 @@ static void rarch_draw_observer(CFRunLoopObserverRef observer, return; } - if (retroarch_ctl(RARCH_CTL_IS_IDLE, NULL)) - return; - CFRunLoopWakeUp(CFRunLoopGetMain()); + runloop_flags = runloop_get_flags(); + if (!(runloop_flags & RUNLOOP_FLAG_IDLE)) + CFRunLoopWakeUp(CFRunLoopGetMain()); } apple_frontend_settings_t apple_frontend_settings;