From 413d14ad49ca84f8c6b44c9be0353c9e42e05e2d Mon Sep 17 00:00:00 2001 From: twinaphex Date: Sat, 17 Sep 2016 14:57:53 +0200 Subject: [PATCH] Start using dirs functions --- menu/menu_setting.c | 5 +++-- paths.c | 9 +++++---- tasks/task_content.c | 5 +++-- 3 files changed, 11 insertions(+), 8 deletions(-) diff --git a/menu/menu_setting.c b/menu/menu_setting.c index 4d615d4245..2c8d7e9f40 100644 --- a/menu/menu_setting.c +++ b/menu/menu_setting.c @@ -56,6 +56,7 @@ #include "../msg_hash.h" #include "../defaults.h" #include "../driver.h" +#include "../dirs.h" #include "../paths.h" #include "../dynamic.h" #include "../runloop.h" @@ -6544,7 +6545,7 @@ static bool setting_append_list( CONFIG_DIR( list, list_info, - global->dir.savefile, + dir_get_savefile_ptr(), sizeof(global->dir.savefile), msg_hash_to_str(MENU_ENUM_LABEL_SAVEFILE_DIRECTORY), msg_hash_to_str(MENU_ENUM_LABEL_VALUE_SAVEFILE_DIRECTORY), @@ -6559,7 +6560,7 @@ static bool setting_append_list( CONFIG_DIR( list, list_info, - global->dir.savestate, + dir_get_savestate_ptr(), sizeof(global->dir.savestate), msg_hash_to_str(MENU_ENUM_LABEL_SAVESTATE_DIRECTORY), msg_hash_to_str(MENU_ENUM_LABEL_VALUE_SAVESTATE_DIRECTORY), diff --git a/paths.c b/paths.c index 357ad83c8c..19c9622838 100644 --- a/paths.c +++ b/paths.c @@ -25,6 +25,7 @@ #include "config.h" #endif +#include "dirs.h" #include "paths.h" #include "configuration.h" @@ -65,8 +66,8 @@ void path_set_redirect(void) if (!global) return; - old_savefile_dir = global->dir.savefile; - old_savestate_dir = global->dir.savestate; + old_savefile_dir = dir_get_savefile(); + old_savestate_dir = dir_get_savestate(); if (info->info.library_name && !string_is_empty(info->info.library_name)) @@ -307,7 +308,7 @@ void path_init_savefile(void) global->subsystem_fullpaths ? global->subsystem_fullpaths->size : 0); - bool use_sram_dir = path_is_directory(global->dir.savefile); + bool use_sram_dir = path_is_directory(dir_get_savefile()); for (i = 0; i < num_content; i++) { @@ -325,7 +326,7 @@ void path_init_savefile(void) if (use_sram_dir) { /* Redirect content fullpath to save directory. */ - strlcpy(path, global->dir.savefile, sizeof(path)); + strlcpy(path, dir_get_savefile(), sizeof(path)); fill_pathname_dir(path, global->subsystem_fullpaths->elems[i].data, ext, sizeof(path)); diff --git a/tasks/task_content.c b/tasks/task_content.c index 1ce411cd40..0635255068 100644 --- a/tasks/task_content.c +++ b/tasks/task_content.c @@ -86,6 +86,7 @@ #include "../retroarch.h" #include "../file_path_special.h" #include "../core.h" +#include "../dirs.h" #include "../paths.h" #include "../verbosity.h" @@ -1608,9 +1609,9 @@ static void menu_content_environment_get(int *argc, char *argv[], if (!path_is_config_empty()) wrap_args->config_path = path_get_config(); if (!string_is_empty(global->dir.savefile)) - wrap_args->sram_path = global->dir.savefile; + wrap_args->sram_path = dir_get_savefile(); if (!string_is_empty(global->dir.savestate)) - wrap_args->state_path = global->dir.savestate; + wrap_args->state_path = dir_get_savestate(); if (fullpath && *fullpath) wrap_args->content_path = fullpath; if (!retroarch_override_setting_is_set(RARCH_OVERRIDE_SETTING_LIBRETRO))