Rename command_event_quit to retroarch_main_quit

This commit is contained in:
twinaphex 2017-05-08 03:54:51 +02:00
parent 0815055906
commit 9605c01c49
4 changed files with 27 additions and 22 deletions

View File

@ -1756,26 +1756,6 @@ static bool command_event_main_state(unsigned cmd)
return ret; return ret;
} }
bool command_event_quit(void)
{
command_event(CMD_EVENT_AUTOSAVE_STATE, NULL);
command_event(CMD_EVENT_DISABLE_OVERRIDES, NULL);
command_event(CMD_EVENT_RESTORE_DEFAULT_SHADER_PRESET, NULL);
#ifdef HAVE_DYNAMIC
#ifdef HAVE_MENU
menu_driver_ctl(RARCH_MENU_CTL_SYSTEM_INFO_DEINIT, NULL);
#endif
#endif
runloop_ctl(RUNLOOP_CTL_SET_SHUTDOWN, NULL);
#ifdef HAVE_MENU
rarch_ctl(RARCH_CTL_MENU_RUNNING_FINISHED, NULL);
#endif
return true;
}
static bool command_event_resize_windowed_scale(void) static bool command_event_resize_windowed_scale(void)
{ {
unsigned idx = 0; unsigned idx = 0;
@ -1995,7 +1975,7 @@ bool command_event(enum event_command cmd, void *data)
} }
break; break;
case CMD_EVENT_QUIT: case CMD_EVENT_QUIT:
return command_event_quit(); return retroarch_main_quit();
case CMD_EVENT_CHEEVOS_HARDCORE_MODE_TOGGLE: case CMD_EVENT_CHEEVOS_HARDCORE_MODE_TOGGLE:
#ifdef HAVE_CHEEVOS #ifdef HAVE_CHEEVOS
cheevos_toggle_hardcore_mode(); cheevos_toggle_hardcore_mode();

View File

@ -1676,3 +1676,23 @@ void retroarch_fail(int error_code, const char *error)
strlcpy(error_string, error, sizeof(error_string)); strlcpy(error_string, error, sizeof(error_string));
longjmp(error_sjlj_context, error_code); longjmp(error_sjlj_context, error_code);
} }
bool retroarch_main_quit(void)
{
command_event(CMD_EVENT_AUTOSAVE_STATE, NULL);
command_event(CMD_EVENT_DISABLE_OVERRIDES, NULL);
command_event(CMD_EVENT_RESTORE_DEFAULT_SHADER_PRESET, NULL);
#ifdef HAVE_DYNAMIC
#ifdef HAVE_MENU
menu_driver_ctl(RARCH_MENU_CTL_SYSTEM_INFO_DEINIT, NULL);
#endif
#endif
runloop_ctl(RUNLOOP_CTL_SET_SHUTDOWN, NULL);
#ifdef HAVE_MENU
rarch_ctl(RARCH_CTL_MENU_RUNNING_FINISHED, NULL);
#endif
return true;
}

View File

@ -191,6 +191,8 @@ void retroarch_fail(int error_code, const char *error);
**/ **/
bool retroarch_main_init(int argc, char *argv[]); bool retroarch_main_init(int argc, char *argv[]);
bool retroarch_main_quit(void);
RETRO_END_DECLS RETRO_END_DECLS
#endif #endif

View File

@ -751,7 +751,10 @@ static enum runloop_state runloop_check_state(
content_info.environ_get = NULL; content_info.environ_get = NULL;
if (!task_push_start_dummy_core(&content_info)) if (!task_push_start_dummy_core(&content_info))
{
retroarch_main_quit();
return RUNLOOP_STATE_QUIT; return RUNLOOP_STATE_QUIT;
}
/* Loads dummy core instead of exiting RetroArch completely. /* Loads dummy core instead of exiting RetroArch completely.
* Aborts core shutdown if invoked. */ * Aborts core shutdown if invoked. */
@ -760,7 +763,7 @@ static enum runloop_state runloop_check_state(
} }
else else
{ {
command_event_quit(); retroarch_main_quit();
return RUNLOOP_STATE_QUIT; return RUNLOOP_STATE_QUIT;
} }
} }