mirror of
https://github.com/libretro/RetroArch
synced 2025-03-29 22:20:21 +00:00
Move core_shutdown_initiated to runloop.c and turn it into
static variable
This commit is contained in:
parent
4e0a4150b5
commit
86de67b3d7
@ -768,7 +768,7 @@ bool rarch_environment_cb(unsigned cmd, void *data)
|
||||
case RETRO_ENVIRONMENT_SHUTDOWN:
|
||||
RARCH_LOG("Environ SHUTDOWN.\n");
|
||||
system->shutdown = true;
|
||||
global->core_shutdown_initiated = true;
|
||||
rarch_main_ctl(RARCH_MAIN_CTL_SET_CORE_SHUTDOWN, NULL);
|
||||
break;
|
||||
|
||||
case RETRO_ENVIRONMENT_SET_PERFORMANCE_LEVEL:
|
||||
|
10
runloop.c
10
runloop.c
@ -57,6 +57,7 @@
|
||||
|
||||
static struct global g_extern;
|
||||
|
||||
static bool main_core_shutdown_initiated;
|
||||
static bool main_is_idle;
|
||||
static bool main_is_paused;
|
||||
static bool main_is_slowmotion;
|
||||
@ -792,6 +793,9 @@ bool rarch_main_ctl(enum rarch_main_ctl_state state, void *data)
|
||||
rarch_ctl(RARCH_ACTION_STATE_LOAD_CONTENT, NULL);
|
||||
}
|
||||
break;
|
||||
case RARCH_MAIN_CTL_SET_CORE_SHUTDOWN:
|
||||
main_core_shutdown_initiated = true;
|
||||
break;
|
||||
default:
|
||||
return false;
|
||||
}
|
||||
@ -943,14 +947,14 @@ static INLINE int rarch_main_iterate_time_to_exit(event_cmd_state_t *cmd)
|
||||
* instead of exiting RetroArch completely.
|
||||
* Aborts core shutdown if invoked.
|
||||
*/
|
||||
if (global->core_shutdown_initiated
|
||||
if (main_core_shutdown_initiated
|
||||
&& settings->load_dummy_on_core_shutdown)
|
||||
{
|
||||
if (!rarch_main_ctl(RARCH_MAIN_CTL_PREPARE_DUMMY, NULL))
|
||||
return -1;
|
||||
|
||||
system->shutdown = false;
|
||||
global->core_shutdown_initiated = false;
|
||||
system->shutdown = false;
|
||||
main_core_shutdown_initiated = false;
|
||||
|
||||
return 0;
|
||||
}
|
||||
|
@ -55,6 +55,7 @@ enum rarch_main_ctl_state
|
||||
RARCH_MAIN_CTL_CLEAR_STATE,
|
||||
RARCH_MAIN_CTL_STATE_FREE,
|
||||
RARCH_MAIN_CTL_GLOBAL_FREE,
|
||||
RARCH_MAIN_CTL_SET_CORE_SHUTDOWN,
|
||||
/* Checks for state changes in this frame. */
|
||||
RARCH_MAIN_CTL_CHECK_STATE,
|
||||
RARCH_MAIN_CTL_CHECK_MOVIE,
|
||||
@ -122,7 +123,6 @@ typedef struct global
|
||||
{
|
||||
bool perfcnt_enable;
|
||||
bool force_fullscreen;
|
||||
bool core_shutdown_initiated;
|
||||
|
||||
struct string_list *temporary_content;
|
||||
|
||||
|
Loading…
x
Reference in New Issue
Block a user