Update path_set

This commit is contained in:
twinaphex 2016-09-29 07:49:54 +02:00
parent 7e1a61570a
commit 0b1270458c
4 changed files with 15 additions and 18 deletions

View File

@ -2234,7 +2234,7 @@ bool config_load_override(void)
RARCH_LOG("[overrides] core-specific overrides found at %s.\n", core_path);
config_file_free(new_conf);
path_set_config_append(core_path);
path_set(RARCH_PATH_CONFIG_APPEND, core_path);
should_append = true;
}
@ -2262,7 +2262,7 @@ bool config_load_override(void)
else
strlcpy(temp_path, game_path, sizeof(temp_path));
path_set_config_append(temp_path);
path_set(RARCH_PATH_CONFIG_APPEND, temp_path);
should_append = true;
}
@ -2533,7 +2533,7 @@ bool config_load_shader_preset(void)
/* Game shader preset exists, load it. */
RARCH_LOG("Shaders: game-specific shader preset found at %s.\n", game_path);
path_set_default_shader_preset(settings->path.shader);
path_set(RARCH_PATH_DEFAULT_SHADER_PRESET, settings->path.shader);
strlcpy(settings->path.shader, game_path, sizeof(settings->path.shader));
config_file_free(new_conf);
return true;
@ -2563,7 +2563,7 @@ bool config_load_shader_preset(void)
/* Core shader preset exists, load it. */
RARCH_LOG("Shaders: core-specific shader preset found at %s.\n", core_path);
path_set_default_shader_preset(settings->path.shader);
path_set(RARCH_PATH_DEFAULT_SHADER_PRESET, settings->path.shader);
strlcpy(settings->path.shader, core_path, sizeof(settings->path.shader));
config_file_free(new_conf);
return true;

21
paths.c
View File

@ -507,6 +507,14 @@ bool path_set(enum rarch_path_type type, const char *path)
strlcpy(path_libretro, path,
sizeof(path_libretro));
break;
case RARCH_PATH_DEFAULT_SHADER_PRESET:
strlcpy(path_default_shader_preset, path,
sizeof(path_default_shader_preset));
break;
case RARCH_PATH_CONFIG_APPEND:
strlcpy(path_config_append_file, path,
sizeof(path_config_append_file));
break;
case RARCH_PATH_CONFIG:
strlcpy(path_config_file, path,
sizeof(path_config_file));
@ -606,14 +614,6 @@ void path_clear_core_options(void)
*path_core_options_file = '\0';
}
bool path_set_default_shader_preset(const char *preset)
{
if (!preset)
return false;
strlcpy(path_default_shader_preset, preset,
sizeof(path_default_shader_preset));
return true;
}
const char *path_get_core_options(void)
@ -645,11 +645,6 @@ void path_clear_content(void)
}
void path_set_config_append(const char *path)
{
strlcpy(path_config_append_file, path, sizeof(path_config_append_file));
}
bool path_get_content(char **fullpath)
{
if (!fullpath)

View File

@ -37,7 +37,9 @@ enum rarch_path_type
RARCH_PATH_CORE,
RARCH_PATH_CONFIG,
RARCH_PATH_CONTENT,
RARCH_PATH_CONFIG_APPEND,
RARCH_PATH_CORE_OPTIONS,
RARCH_PATH_DEFAULT_SHADER_PRESET,
RARCH_PATH_SUBSYSTEM
};

View File

@ -760,7 +760,7 @@ static void retroarch_parse_input(int argc, char *argv[])
#endif
case RA_OPT_APPENDCONFIG:
path_set_config_append(optarg);
path_set(RARCH_PATH_CONFIG_APPEND, optarg);
break;
case RA_OPT_SIZE: