1
0
mirror of https://github.com/libretro/RetroArch synced 2024-07-08 12:15:49 +00:00

allow savestates and savefiles to go into content dir via bool setting in addition of the empty string

This commit is contained in:
radius 2017-08-05 13:41:05 -05:00
parent 7af556e200
commit 9858b94e87

15
paths.c
View File

@ -67,6 +67,7 @@ void path_set_redirect(void)
const char *old_savefile_dir = dir_get(RARCH_DIR_SAVEFILE);
const char *old_savestate_dir = dir_get(RARCH_DIR_SAVESTATE);
rarch_system_info_t *info = runloop_get_system_info();
settings_t *settings = config_get_ptr();
new_savefile_dir[0] = new_savestate_dir[0] = '\0';
@ -93,10 +94,8 @@ void path_set_redirect(void)
if (check_library_name_hash)
{
settings_t *settings = config_get_ptr();
/* per-core saves: append the library_name to the save location */
if ( settings->bools.sort_savefiles_enable
if (settings->bools.sort_savefiles_enable
&& !string_is_empty(old_savefile_dir))
{
fill_pathname_join(
@ -154,13 +153,21 @@ void path_set_redirect(void)
}
/* Set savefile directory if empty based on content directory */
if (string_is_empty(new_savefile_dir))
if (string_is_empty(new_savefile_dir) || settings->bools.savefiles_in_content_dir)
{
strlcpy(new_savefile_dir, path_main_basename,
sizeof(new_savefile_dir));
path_basedir(new_savefile_dir);
}
/* Set savestate directory if empty based on content directory */
if (string_is_empty(new_savestate_dir) || settings->bools.savestates_in_content_dir)
{
strlcpy(new_savestate_dir, path_main_basename,
sizeof(new_savestate_dir));
path_basedir(new_savestate_dir);
}
if (global)
{
if(path_is_directory(new_savefile_dir))