Move rarch_sleep outside of rarch_main_iterate so that caller

can implement the idle step itself
This commit is contained in:
twinaphex 2015-08-27 13:13:14 +02:00
parent d45b953078
commit 4b0ee4b9c2
6 changed files with 13 additions and 3 deletions

View File

@ -249,6 +249,9 @@ static void android_app_entry(void *data)
do do
{ {
ret = rarch_main_iterate(); ret = rarch_main_iterate();
if (ret == 1)
rarch_sleep(10);
rarch_main_data_iterate(); rarch_main_data_iterate();
}while (ret != -1); }while (ret != -1);

View File

@ -28,6 +28,8 @@
static void emscripten_mainloop(void) static void emscripten_mainloop(void)
{ {
int ret = rarch_main_iterate(); int ret = rarch_main_iterate();
if (ret == 1)
rarch_sleep(10);
rarch_main_data_iterate(); rarch_main_data_iterate();
if (ret != -1) if (ret != -1)
return; return;

View File

@ -343,6 +343,9 @@ int rarch_main(int argc, char *argv[], void *data)
#ifndef HAVE_MAIN #ifndef HAVE_MAIN
do{ do{
ret = rarch_main_iterate(); ret = rarch_main_iterate();
if (ret == 1)
rarch_sleep(10);
rarch_main_data_iterate(); rarch_main_data_iterate();
}while(ret != -1); }while(ret != -1);

View File

@ -1081,10 +1081,8 @@ int rarch_main_iterate(void)
if (do_state_checks(driver, settings, global, &cmd)) if (do_state_checks(driver, settings, global, &cmd))
{ {
/* RetroArch has been paused */ /* RetroArch has been paused. */
driver->retro_ctx.poll_cb(); driver->retro_ctx.poll_cb();
rarch_sleep(10);
return 1; return 1;
} }

View File

@ -210,6 +210,8 @@ static void poll_iteration(void)
{ {
poll_iteration(); poll_iteration();
ret = rarch_main_iterate(); ret = rarch_main_iterate();
if (ret == 1)
rarch_sleep(10);
rarch_main_data_iterate(); rarch_main_data_iterate();
while(CFRunLoopRunInMode(kCFRunLoopDefaultMode, 0.002, FALSE) == kCFRunLoopRunHandledSource); while(CFRunLoopRunInMode(kCFRunLoopDefaultMode, 0.002, FALSE) == kCFRunLoopRunHandledSource);
} }

View File

@ -65,6 +65,8 @@ static void rarch_draw_observer(CFRunLoopObserverRef observer,
if (ret == 0) if (ret == 0)
menu_iterate(false, MENU_ACTION_NOOP); menu_iterate(false, MENU_ACTION_NOOP);
if (ret == 1)
rarch_sleep(10);
rarch_main_data_iterate(); rarch_main_data_iterate();
if (ret == -1) if (ret == -1)