Refactor away rarch_main_idle_iterate

This commit is contained in:
twinaphex 2014-08-01 17:57:14 +02:00
parent 609614a84c
commit 8285f6021f
3 changed files with 9 additions and 20 deletions

View File

@ -102,13 +102,7 @@ static int main_entry_iterate_shutdown(args_type() args)
static int main_entry_iterate_content(args_type() args)
{
bool r;
if (g_extern.is_paused && !g_extern.is_oneshot)
r = rarch_main_idle_iterate();
else
r = rarch_main_iterate();
if (r)
if (rarch_main_iterate())
{
if (driver.frontend_ctx && driver.frontend_ctx->process_events)
driver.frontend_ctx->process_events(args);
@ -388,7 +382,7 @@ returntype main_entry(signature())
#if defined(HAVE_MENU)
while (!main_entry_iterate(signature_expand(), args));
#else
while ((g_extern.is_paused && !g_extern.is_oneshot) ? rarch_main_idle_iterate() : rarch_main_iterate());
while (rarch_main_iterate());
#endif
main_exit(args);

View File

@ -770,7 +770,6 @@ int rarch_main(int argc, char *argv[]);
void rarch_main_init_wrap(const struct rarch_main_wrap *args, int *argc, char **argv);
int rarch_main_init(int argc, char *argv[]);
bool rarch_main_idle_iterate(void);
void rarch_main_command(unsigned action);
bool rarch_main_iterate(void);
void rarch_main_deinit(void);

View File

@ -3159,6 +3159,13 @@ bool rarch_main_iterate(void)
// Checks for stuff like fullscreen, save states, etc.
do_state_checks();
if (g_extern.is_paused && !g_extern.is_oneshot)
{
rarch_input_poll();
rarch_sleep(10);
return true;
}
// Run libretro for one frame.
#if defined(HAVE_THREADS)
lock_autosave();
@ -3352,14 +3359,3 @@ void rarch_main_init_wrap(const struct rarch_main_wrap *args, int *argc, char **
RARCH_LOG("arg #%d: %s\n", i, argv[i]);
#endif
}
bool rarch_main_idle_iterate(void)
{
if (input_key_pressed_func(RARCH_QUIT_KEY) || !video_alive_func())
return false;
do_state_checks();
rarch_input_poll();
rarch_sleep(10);
return true;
}