This commit is contained in:
twinaphex 2020-02-04 02:50:12 +01:00
parent 51bc64559b
commit 55e7c16dea
3 changed files with 8 additions and 10 deletions

View File

@ -3234,7 +3234,7 @@ end:
* Returns: false if there was an error or no action was performed. * Returns: false if there was an error or no action was performed.
* *
*/ */
bool config_load_override(void) bool config_load_override(void *data)
{ {
size_t path_size = PATH_MAX_LENGTH * sizeof(char); size_t path_size = PATH_MAX_LENGTH * sizeof(char);
char *buf = NULL; char *buf = NULL;
@ -3243,7 +3243,7 @@ bool config_load_override(void)
char *content_path = NULL; char *content_path = NULL;
char *config_directory = NULL; char *config_directory = NULL;
bool should_append = false; bool should_append = false;
rarch_system_info_t *system = runloop_get_system_info(); rarch_system_info_t *system = (rarch_system_info_t*)data;
const char *core_name = system ? const char *core_name = system ?
system->info.library_name : NULL; system->info.library_name : NULL;
const char *rarch_path_basename = path_get(RARCH_PATH_BASENAME); const char *rarch_path_basename = path_get(RARCH_PATH_BASENAME);
@ -3964,7 +3964,7 @@ bool config_save_file(const char *path)
* *
* Returns: true (1) on success, otherwise returns false (0). * Returns: true (1) on success, otherwise returns false (0).
**/ **/
bool config_save_overrides(int override_type) bool config_save_overrides(enum override_type type)
{ {
size_t path_size = PATH_MAX_LENGTH * sizeof(char); size_t path_size = PATH_MAX_LENGTH * sizeof(char);
int tmp_i = 0; int tmp_i = 0;
@ -4154,23 +4154,21 @@ bool config_save_overrides(int override_type)
ret = false; ret = false;
switch (override_type) switch (type)
{ {
case OVERRIDE_CORE: case OVERRIDE_CORE:
/* Create a new config file from core_path */
RARCH_LOG ("[Overrides] path %s\n", core_path); RARCH_LOG ("[Overrides] path %s\n", core_path);
ret = config_file_write(conf, core_path, true); ret = config_file_write(conf, core_path, true);
break; break;
case OVERRIDE_GAME: case OVERRIDE_GAME:
/* Create a new config file from core_path */
RARCH_LOG ("[Overrides] path %s\n", game_path); RARCH_LOG ("[Overrides] path %s\n", game_path);
ret = config_file_write(conf, game_path, true); ret = config_file_write(conf, game_path, true);
break; break;
case OVERRIDE_CONTENT_DIR: case OVERRIDE_CONTENT_DIR:
/* Create a new config file from content_path */
RARCH_LOG ("[Overrides] path %s\n", content_path); RARCH_LOG ("[Overrides] path %s\n", content_path);
ret = config_file_write(conf, content_path, true); ret = config_file_write(conf, content_path, true);
break; break;
case OVERRIDE_NONE:
default: default:
break; break;
} }

View File

@ -828,7 +828,7 @@ void config_parse_file(void *data);
* Returns: false if there was an error or no action was performed. * Returns: false if there was an error or no action was performed.
* *
*/ */
bool config_load_override(void); bool config_load_override(void *data);
/** /**
* config_unload_override: * config_unload_override:
@ -876,7 +876,7 @@ bool config_save_file(const char *path);
* *
* Returns: true (1) on success, otherwise returns false (0). * Returns: true (1) on success, otherwise returns false (0).
**/ **/
bool config_save_overrides(int override_type); bool config_save_overrides(enum override_type type);
/* Replaces currently loaded configuration file with /* Replaces currently loaded configuration file with
* another one. Will load a dummy core to flush state * another one. Will load a dummy core to flush state

View File

@ -5896,7 +5896,7 @@ static bool command_event_init_core(enum rarch_core_type type)
#ifdef HAVE_CONFIGFILE #ifdef HAVE_CONFIGFILE
/* auto overrides: apply overrides */ /* auto overrides: apply overrides */
if (settings->bools.auto_overrides_enable) if (settings->bools.auto_overrides_enable)
runloop_overrides_active = config_load_override(); runloop_overrides_active = config_load_override(&runloop_system);
#endif #endif
/* Load auto-shaders on the next occasion */ /* Load auto-shaders on the next occasion */