mirror of
https://github.com/libretro/RetroArch
synced 2025-02-21 18:40:09 +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:
parent
7af556e200
commit
9858b94e87
13
paths.c
13
paths.c
@ -67,6 +67,7 @@ void path_set_redirect(void)
|
|||||||
const char *old_savefile_dir = dir_get(RARCH_DIR_SAVEFILE);
|
const char *old_savefile_dir = dir_get(RARCH_DIR_SAVEFILE);
|
||||||
const char *old_savestate_dir = dir_get(RARCH_DIR_SAVESTATE);
|
const char *old_savestate_dir = dir_get(RARCH_DIR_SAVESTATE);
|
||||||
rarch_system_info_t *info = runloop_get_system_info();
|
rarch_system_info_t *info = runloop_get_system_info();
|
||||||
|
settings_t *settings = config_get_ptr();
|
||||||
|
|
||||||
new_savefile_dir[0] = new_savestate_dir[0] = '\0';
|
new_savefile_dir[0] = new_savestate_dir[0] = '\0';
|
||||||
|
|
||||||
@ -93,8 +94,6 @@ void path_set_redirect(void)
|
|||||||
|
|
||||||
if (check_library_name_hash)
|
if (check_library_name_hash)
|
||||||
{
|
{
|
||||||
settings_t *settings = config_get_ptr();
|
|
||||||
|
|
||||||
/* per-core saves: append the library_name to the save location */
|
/* 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))
|
&& !string_is_empty(old_savefile_dir))
|
||||||
@ -154,13 +153,21 @@ void path_set_redirect(void)
|
|||||||
}
|
}
|
||||||
|
|
||||||
/* Set savefile directory if empty based on content directory */
|
/* 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,
|
strlcpy(new_savefile_dir, path_main_basename,
|
||||||
sizeof(new_savefile_dir));
|
sizeof(new_savefile_dir));
|
||||||
path_basedir(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 (global)
|
||||||
{
|
{
|
||||||
if(path_is_directory(new_savefile_dir))
|
if(path_is_directory(new_savefile_dir))
|
||||||
|
Loading…
x
Reference in New Issue
Block a user