mirror of
https://github.com/libretro/RetroArch
synced 2025-03-28 08:37:41 +00:00
cut down some code duplication
This commit is contained in:
parent
dbb8cf7e32
commit
6b0c978acb
28
command.c
28
command.c
@ -1060,12 +1060,7 @@ static void command_event_deinit_core(bool reinit)
|
||||
driver_ctl(RARCH_DRIVER_CTL_UNINIT, &flags);
|
||||
}
|
||||
|
||||
/* auto overrides: reload the original config */
|
||||
if (runloop_ctl(RUNLOOP_CTL_IS_OVERRIDES_ACTIVE, NULL))
|
||||
{
|
||||
config_unload_override();
|
||||
runloop_ctl(RUNLOOP_CTL_UNSET_OVERRIDES_ACTIVE, NULL);
|
||||
}
|
||||
command_event(CMD_EVENT_DISABLE_OVERRIDES, NULL);
|
||||
}
|
||||
|
||||
static void command_event_init_cheats(void)
|
||||
@ -1266,6 +1261,16 @@ static bool command_event_init_core(enum rarch_core_type *data)
|
||||
return true;
|
||||
}
|
||||
|
||||
static void command_event_disable_overrides(void)
|
||||
{
|
||||
/* auto overrides: reload the original config */
|
||||
if (runloop_ctl(RUNLOOP_CTL_IS_OVERRIDES_ACTIVE, NULL))
|
||||
{
|
||||
config_unload_override();
|
||||
runloop_ctl(RUNLOOP_CTL_UNSET_OVERRIDES_ACTIVE, NULL);
|
||||
}
|
||||
}
|
||||
|
||||
static bool command_event_save_auto_state(void)
|
||||
{
|
||||
bool ret;
|
||||
@ -1715,12 +1720,8 @@ bool command_event(enum event_command cmd, void *data)
|
||||
break;
|
||||
case CMD_EVENT_UNLOAD_CORE:
|
||||
command_event(CMD_EVENT_AUTOSAVE_STATE, NULL);
|
||||
/* auto overrides: reload the original config */
|
||||
if (runloop_ctl(RUNLOOP_CTL_IS_OVERRIDES_ACTIVE, NULL))
|
||||
{
|
||||
config_unload_override();
|
||||
runloop_ctl(RUNLOOP_CTL_UNSET_OVERRIDES_ACTIVE, NULL);
|
||||
}
|
||||
command_event(CMD_EVENT_DISABLE_OVERRIDES, NULL);
|
||||
|
||||
if (!rarch_task_push_content_load_default(
|
||||
NULL, NULL,
|
||||
&content_info,
|
||||
@ -2300,6 +2301,9 @@ bool command_event(enum event_command cmd, void *data)
|
||||
case CMD_EVENT_SET_FRAME_LIMIT:
|
||||
runloop_ctl(RUNLOOP_CTL_SET_FRAME_LIMIT, NULL);
|
||||
break;
|
||||
case CMD_EVENT_DISABLE_OVERRIDES:
|
||||
command_event_disable_overrides();
|
||||
break;
|
||||
case CMD_EVENT_NONE:
|
||||
default:
|
||||
return false;
|
||||
|
Loading…
x
Reference in New Issue
Block a user