mirror of
https://github.com/libretro/RetroArch.git
synced 2025-01-23 18:06:36 +00:00
Cleanup
This commit is contained in:
parent
a082198d4b
commit
cf3f8d587c
@ -1779,7 +1779,7 @@ bool command_event(enum event_command cmd, void *data)
|
||||
command_event(CMD_EVENT_LOAD_CORE_DEINIT, NULL);
|
||||
break;
|
||||
case CMD_EVENT_QUIT:
|
||||
rarch_ctl(RARCH_CTL_QUIT, NULL);
|
||||
retroarch_main_quit();
|
||||
break;
|
||||
case CMD_EVENT_CHEEVOS_HARDCORE_MODE_TOGGLE:
|
||||
#ifdef HAVE_CHEEVOS
|
||||
@ -2034,19 +2034,19 @@ bool command_event(enum event_command cmd, void *data)
|
||||
}
|
||||
break;
|
||||
case CMD_EVENT_QUIT_RETROARCH:
|
||||
rarch_ctl(RARCH_CTL_QUIT, NULL);
|
||||
command_event(CMD_EVENT_QUIT, NULL);
|
||||
break;
|
||||
case CMD_EVENT_SHUTDOWN:
|
||||
#if defined(__linux__) && !defined(ANDROID)
|
||||
runloop_msg_queue_push("Shutting down...", 1, 180, true);
|
||||
rarch_ctl(RARCH_CTL_QUIT, NULL);
|
||||
command_event(CMD_EVENT_QUIT, NULL);
|
||||
system("shutdown -P now");
|
||||
#endif
|
||||
break;
|
||||
case CMD_EVENT_REBOOT:
|
||||
#if defined(__linux__) && !defined(ANDROID)
|
||||
runloop_msg_queue_push("Rebooting...", 1, 180, true);
|
||||
rarch_ctl(RARCH_CTL_QUIT, NULL);
|
||||
command_event(CMD_EVENT_QUIT, NULL);
|
||||
system("shutdown -r now");
|
||||
#endif
|
||||
break;
|
||||
|
10
retroarch.c
10
retroarch.c
@ -1505,10 +1505,6 @@ bool rarch_ctl(enum rarch_ctl_state state, void *data)
|
||||
command_event(CMD_EVENT_OVERLAY_INIT, NULL);
|
||||
#endif
|
||||
break;
|
||||
case RARCH_CTL_QUIT:
|
||||
runloop_ctl(RUNLOOP_CTL_SET_SHUTDOWN, NULL);
|
||||
rarch_ctl(RARCH_CTL_MENU_RUNNING_FINISHED, NULL);
|
||||
break;
|
||||
case RARCH_CTL_VALIDATE_CPU_FEATURES:
|
||||
{
|
||||
uint64_t cpu = cpu_features_get();
|
||||
@ -1666,3 +1662,9 @@ void retroarch_fail(int error_code, const char *error)
|
||||
strlcpy(error_string, error, sizeof(error_string));
|
||||
longjmp(error_sjlj_context, error_code);
|
||||
}
|
||||
|
||||
void retroarch_main_quit(void)
|
||||
{
|
||||
runloop_ctl(RUNLOOP_CTL_SET_SHUTDOWN, NULL);
|
||||
rarch_ctl(RARCH_CTL_MENU_RUNNING_FINISHED, NULL);
|
||||
}
|
||||
|
@ -86,8 +86,6 @@ enum rarch_ctl_state
|
||||
* properly. */
|
||||
RARCH_CTL_REPLACE_CONFIG,
|
||||
|
||||
RARCH_CTL_QUIT,
|
||||
|
||||
/* Validates CPU features for given processor architecture.
|
||||
* Make sure we haven't compiled for something we cannot run.
|
||||
* Ideally, code would get swapped out depending on CPU support,
|
||||
@ -188,6 +186,8 @@ void retroarch_fail(int error_code, const char *error);
|
||||
**/
|
||||
bool retroarch_main_init(int argc, char *argv[]);
|
||||
|
||||
void retroarch_main_quit(void);
|
||||
|
||||
#ifdef __cplusplus
|
||||
}
|
||||
#endif
|
||||
|
Loading…
x
Reference in New Issue
Block a user