Move pausing logic outside rarch_main_iterate.
This commit is contained in:
parent
627fd567a9
commit
05f8c54ed6
37
retroarch.c
37
retroarch.c
|
@ -2735,6 +2735,29 @@ error:
|
|||
return 1;
|
||||
}
|
||||
|
||||
static inline bool rarch_main_paused(void)
|
||||
{
|
||||
return g_extern.is_paused && !g_extern.is_oneshot;
|
||||
}
|
||||
|
||||
static bool rarch_main_idle_iterate(void)
|
||||
{
|
||||
#ifdef HAVE_COMMAND
|
||||
if (driver.command)
|
||||
rarch_cmd_pre_frame(driver.command);
|
||||
#endif
|
||||
|
||||
if (input_key_pressed_func(RARCH_QUIT_KEY) ||
|
||||
!video_alive_func())
|
||||
return false;
|
||||
|
||||
do_state_checks();
|
||||
|
||||
input_poll();
|
||||
rarch_sleep(10);
|
||||
return true;
|
||||
}
|
||||
|
||||
bool rarch_main_iterate(void)
|
||||
{
|
||||
#ifdef HAVE_DYLIB
|
||||
|
@ -2783,10 +2806,6 @@ bool rarch_main_iterate(void)
|
|||
do_state_checks();
|
||||
|
||||
// Run libretro for one frame.
|
||||
#if !defined(RARCH_PERFORMANCE_MODE) // On consoles pausing is handled better elsewhere.
|
||||
if (!g_extern.is_paused || g_extern.is_oneshot)
|
||||
#endif
|
||||
{
|
||||
#ifdef HAVE_THREADS
|
||||
lock_autosave();
|
||||
#endif
|
||||
|
@ -2817,14 +2836,6 @@ bool rarch_main_iterate(void)
|
|||
#ifdef HAVE_THREADS
|
||||
unlock_autosave();
|
||||
#endif
|
||||
}
|
||||
#if !defined(RARCH_PERFORMANCE_MODE)
|
||||
else
|
||||
{
|
||||
input_poll();
|
||||
rarch_sleep(10);
|
||||
}
|
||||
#endif
|
||||
|
||||
#ifdef HAVE_RMENU
|
||||
if (input_key_pressed_func(RARCH_FRAMEADVANCE))
|
||||
|
@ -2888,7 +2899,7 @@ int rarch_main(int argc, char *argv[])
|
|||
int init_ret;
|
||||
if ((init_ret = rarch_main_init(argc, argv))) return init_ret;
|
||||
rarch_init_msg_queue();
|
||||
while (rarch_main_iterate());
|
||||
while (rarch_main_paused() ? rarch_main_idle_iterate() : rarch_main_iterate());
|
||||
rarch_main_deinit();
|
||||
rarch_deinit_msg_queue();
|
||||
|
||||
|
|
Loading…
Reference in New Issue