mirror of
https://github.com/libretro/RetroArch
synced 2025-04-09 21:45:45 +00:00
Turn main_core_shutdown_initiated into static local variable
This commit is contained in:
parent
a99c8a148f
commit
21f4281f88
23
runloop.c
23
runloop.c
@ -65,7 +65,6 @@ static rarch_dir_list_t runloop_shader_dir;
|
|||||||
|
|
||||||
static unsigned runloop_pending_windowed_scale;
|
static unsigned runloop_pending_windowed_scale;
|
||||||
static char runloop_fullpath[PATH_MAX_LENGTH];
|
static char runloop_fullpath[PATH_MAX_LENGTH];
|
||||||
static bool main_core_shutdown_initiated;
|
|
||||||
|
|
||||||
static unsigned main_max_frames;
|
static unsigned main_max_frames;
|
||||||
|
|
||||||
@ -408,11 +407,12 @@ bool *runloop_perfcnt_enabled(void)
|
|||||||
|
|
||||||
bool runloop_ctl(enum runloop_ctl_state state, void *data)
|
bool runloop_ctl(enum runloop_ctl_state state, void *data)
|
||||||
{
|
{
|
||||||
static bool runloop_paused = false;
|
static bool runloop_paused = false;
|
||||||
static bool runloop_idle = false;
|
static bool runloop_idle = false;
|
||||||
static bool runloop_exec = false;
|
static bool runloop_exec = false;
|
||||||
static bool runloop_slowmotion = false;
|
static bool runloop_slowmotion = false;
|
||||||
settings_t *settings = config_get_ptr();
|
static bool runloop_core_shutdown_initiated = false;
|
||||||
|
settings_t *settings = config_get_ptr();
|
||||||
|
|
||||||
switch (state)
|
switch (state)
|
||||||
{
|
{
|
||||||
@ -788,8 +788,13 @@ bool runloop_ctl(enum runloop_ctl_state state, void *data)
|
|||||||
}
|
}
|
||||||
break;
|
break;
|
||||||
case RUNLOOP_CTL_SET_CORE_SHUTDOWN:
|
case RUNLOOP_CTL_SET_CORE_SHUTDOWN:
|
||||||
main_core_shutdown_initiated = true;
|
runloop_core_shutdown_initiated = true;
|
||||||
break;
|
break;
|
||||||
|
case RUNLOOP_CTL_UNSET_CORE_SHUTDOWN:
|
||||||
|
runloop_core_shutdown_initiated = false;
|
||||||
|
break;
|
||||||
|
case RUNLOOP_CTL_IS_CORE_SHUTDOWN:
|
||||||
|
return runloop_core_shutdown_initiated;
|
||||||
case RUNLOOP_CTL_SET_EXEC:
|
case RUNLOOP_CTL_SET_EXEC:
|
||||||
runloop_exec = true;
|
runloop_exec = true;
|
||||||
break;
|
break;
|
||||||
@ -951,14 +956,14 @@ static INLINE int rarch_main_iterate_time_to_exit(event_cmd_state_t *cmd)
|
|||||||
* instead of exiting RetroArch completely.
|
* instead of exiting RetroArch completely.
|
||||||
* Aborts core shutdown if invoked.
|
* Aborts core shutdown if invoked.
|
||||||
*/
|
*/
|
||||||
if (main_core_shutdown_initiated
|
if (runloop_ctl(RUNLOOP_CTL_IS_CORE_SHUTDOWN, NULL)
|
||||||
&& settings->load_dummy_on_core_shutdown)
|
&& settings->load_dummy_on_core_shutdown)
|
||||||
{
|
{
|
||||||
if (!runloop_ctl(RUNLOOP_CTL_PREPARE_DUMMY, NULL))
|
if (!runloop_ctl(RUNLOOP_CTL_PREPARE_DUMMY, NULL))
|
||||||
return -1;
|
return -1;
|
||||||
|
|
||||||
system->shutdown = false;
|
system->shutdown = false;
|
||||||
main_core_shutdown_initiated = false;
|
runloop_ctl(RUNLOOP_CTL_UNSET_CORE_SHUTDOWN, NULL);
|
||||||
|
|
||||||
return 0;
|
return 0;
|
||||||
}
|
}
|
||||||
|
@ -53,6 +53,8 @@ enum runloop_ctl_state
|
|||||||
RUNLOOP_CTL_STATE_FREE,
|
RUNLOOP_CTL_STATE_FREE,
|
||||||
RUNLOOP_CTL_GLOBAL_FREE,
|
RUNLOOP_CTL_GLOBAL_FREE,
|
||||||
RUNLOOP_CTL_SET_CORE_SHUTDOWN,
|
RUNLOOP_CTL_SET_CORE_SHUTDOWN,
|
||||||
|
RUNLOOP_CTL_UNSET_CORE_SHUTDOWN,
|
||||||
|
RUNLOOP_CTL_IS_CORE_SHUTDOWN,
|
||||||
RUNLOOP_CTL_SET_EXEC,
|
RUNLOOP_CTL_SET_EXEC,
|
||||||
RUNLOOP_CTL_UNSET_EXEC,
|
RUNLOOP_CTL_UNSET_EXEC,
|
||||||
RUNLOOP_CTL_IS_EXEC,
|
RUNLOOP_CTL_IS_EXEC,
|
||||||
|
Loading…
x
Reference in New Issue
Block a user