Refactor away rarch_main_idle_iterate
This commit is contained in:
parent
609614a84c
commit
8285f6021f
|
@ -102,13 +102,7 @@ static int main_entry_iterate_shutdown(args_type() args)
|
||||||
|
|
||||||
static int main_entry_iterate_content(args_type() args)
|
static int main_entry_iterate_content(args_type() args)
|
||||||
{
|
{
|
||||||
bool r;
|
if (rarch_main_iterate())
|
||||||
if (g_extern.is_paused && !g_extern.is_oneshot)
|
|
||||||
r = rarch_main_idle_iterate();
|
|
||||||
else
|
|
||||||
r = rarch_main_iterate();
|
|
||||||
|
|
||||||
if (r)
|
|
||||||
{
|
{
|
||||||
if (driver.frontend_ctx && driver.frontend_ctx->process_events)
|
if (driver.frontend_ctx && driver.frontend_ctx->process_events)
|
||||||
driver.frontend_ctx->process_events(args);
|
driver.frontend_ctx->process_events(args);
|
||||||
|
@ -388,7 +382,7 @@ returntype main_entry(signature())
|
||||||
#if defined(HAVE_MENU)
|
#if defined(HAVE_MENU)
|
||||||
while (!main_entry_iterate(signature_expand(), args));
|
while (!main_entry_iterate(signature_expand(), args));
|
||||||
#else
|
#else
|
||||||
while ((g_extern.is_paused && !g_extern.is_oneshot) ? rarch_main_idle_iterate() : rarch_main_iterate());
|
while (rarch_main_iterate());
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
main_exit(args);
|
main_exit(args);
|
||||||
|
|
|
@ -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);
|
void rarch_main_init_wrap(const struct rarch_main_wrap *args, int *argc, char **argv);
|
||||||
|
|
||||||
int rarch_main_init(int argc, char *argv[]);
|
int rarch_main_init(int argc, char *argv[]);
|
||||||
bool rarch_main_idle_iterate(void);
|
|
||||||
void rarch_main_command(unsigned action);
|
void rarch_main_command(unsigned action);
|
||||||
bool rarch_main_iterate(void);
|
bool rarch_main_iterate(void);
|
||||||
void rarch_main_deinit(void);
|
void rarch_main_deinit(void);
|
||||||
|
|
18
retroarch.c
18
retroarch.c
|
@ -3159,6 +3159,13 @@ bool rarch_main_iterate(void)
|
||||||
// Checks for stuff like fullscreen, save states, etc.
|
// Checks for stuff like fullscreen, save states, etc.
|
||||||
do_state_checks();
|
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.
|
// Run libretro for one frame.
|
||||||
#if defined(HAVE_THREADS)
|
#if defined(HAVE_THREADS)
|
||||||
lock_autosave();
|
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]);
|
RARCH_LOG("arg #%d: %s\n", i, argv[i]);
|
||||||
#endif
|
#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;
|
|
||||||
}
|
|
||||||
|
|
Loading…
Reference in New Issue