diff --git a/runloop.c b/runloop.c index c1b7d07f58..d0c8cb5972 100644 --- a/runloop.c +++ b/runloop.c @@ -876,36 +876,6 @@ static int rarch_main_iterate_quit(void) } #ifdef HAVE_OVERLAY -void rarch_main_iterate_overlay_state(void) -{ - if (g_runloop.is_idle) - return; - - switch (driver.overlay->state) - { - case OVERLAY_STATUS_NONE: - case OVERLAY_STATUS_ALIVE: - break; - case OVERLAY_STATUS_DEFERRED_LOAD: - input_overlay_load_overlays(driver.overlay); - break; - case OVERLAY_STATUS_DEFERRED_LOADING: - input_overlay_load_overlays_iterate(driver.overlay); - break; - case OVERLAY_STATUS_DEFERRED_LOADING_RESOLVE: - input_overlay_load_overlays_resolve_iterate(driver.overlay); - break; - case OVERLAY_STATUS_DEFERRED_DONE: - input_overlay_new_done(driver.overlay); - break; - case OVERLAY_STATUS_DEFERRED_ERROR: - input_overlay_free(driver.overlay); - break; - default: - break; - } -} - static void rarch_main_iterate_linefeed_overlay(void) { static char prev_overlay_restore = false; @@ -965,9 +935,6 @@ int rarch_main_iterate(void) #ifdef HAVE_OVERLAY rarch_main_iterate_linefeed_overlay(); - - if (driver.overlay) - rarch_main_iterate_overlay_state(); #endif rarch_main_data_iterate(); diff --git a/runloop_data.c b/runloop_data.c index 236caaa585..ae0358cccd 100644 --- a/runloop_data.c +++ b/runloop_data.c @@ -609,8 +609,43 @@ static void rarch_main_data_db_iterate(void) #endif } +static void rarch_main_data_overlay_iterate(void) +{ + if (g_runloop.is_idle) + return; + if (!driver.overlay) + return; + + switch (driver.overlay->state) + { + case OVERLAY_STATUS_NONE: + case OVERLAY_STATUS_ALIVE: + break; + case OVERLAY_STATUS_DEFERRED_LOAD: + input_overlay_load_overlays(driver.overlay); + break; + case OVERLAY_STATUS_DEFERRED_LOADING: + input_overlay_load_overlays_iterate(driver.overlay); + break; + case OVERLAY_STATUS_DEFERRED_LOADING_RESOLVE: + input_overlay_load_overlays_resolve_iterate(driver.overlay); + break; + case OVERLAY_STATUS_DEFERRED_DONE: + input_overlay_new_done(driver.overlay); + break; + case OVERLAY_STATUS_DEFERRED_ERROR: + input_overlay_free(driver.overlay); + break; + default: + break; + } +} + void rarch_main_data_iterate(void) { +#ifdef HAVE_OVERLAY + rarch_main_data_overlay_iterate(); +#endif rarch_main_data_nbio_iterate(&g_runloop.data.nbio); #ifdef HAVE_NETWORKING rarch_main_data_http_iterate(&g_runloop.data.http);