mirror of
https://github.com/CTCaer/RetroArch.git
synced 2024-12-21 10:20:21 +00:00
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)
|
||||
{
|
||||
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);
|
||||
|
@ -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);
|
||||
|
18
retroarch.c
18
retroarch.c
@ -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;
|
||||
}
|
||||
|
Loading…
Reference in New Issue
Block a user