From 6cee86c7682b5e68a63af26c1ae26d77039e1b04 Mon Sep 17 00:00:00 2001 From: twinaphex Date: Mon, 29 Apr 2013 05:44:32 +0200 Subject: [PATCH] (RMenu) Get rid of main_wrap savestate_dir/sram_dir --- frontend/menu/rmenu.c | 20 ++++++++++---------- general.h | 6 ------ settings.c | 4 ++-- 3 files changed, 12 insertions(+), 18 deletions(-) diff --git a/frontend/menu/rmenu.c b/frontend/menu/rmenu.c index 21c4e492b0..7f2c4508a6 100644 --- a/frontend/menu/rmenu.c +++ b/frontend/menu/rmenu.c @@ -702,10 +702,10 @@ static int select_directory(void *data, uint64_t input) switch(rgui->menu_type) { case PATH_SAVESTATES_DIR_CHOICE: - strlcpy(g_extern.console.main_wrap.default_savestate_dir, path, sizeof(g_extern.console.main_wrap.default_savestate_dir)); + strlcpy(g_extern.savestate_dir, path, sizeof(g_extern.savestate_dir)); break; case PATH_SRAM_DIR_CHOICE: - strlcpy(g_extern.console.main_wrap.default_sram_dir, path, sizeof(g_extern.console.main_wrap.default_sram_dir)); + strlcpy(g_extern.savefile_dir, path, sizeof(g_extern.savefile_dir)); break; case PATH_DEFAULT_ROM_DIR_CHOICE: strlcpy(g_settings.rgui_browser_directory, path, sizeof(g_settings.rgui_browser_directory)); @@ -728,10 +728,10 @@ static int select_directory(void *data, uint64_t input) switch(rgui->menu_type) { case PATH_SAVESTATES_DIR_CHOICE: - strlcpy(g_extern.console.main_wrap.default_savestate_dir, path, sizeof(g_extern.console.main_wrap.default_savestate_dir)); + strlcpy(g_extern.savestate_dir, path, sizeof(g_extern.savestate_dir)); break; case PATH_SRAM_DIR_CHOICE: - strlcpy(g_extern.console.main_wrap.default_sram_dir, path, sizeof(g_extern.console.main_wrap.default_sram_dir)); + strlcpy(g_extern.savefile_dir, path, sizeof(g_extern.savefile_dir)); break; case PATH_DEFAULT_ROM_DIR_CHOICE: strlcpy(g_settings.rgui_browser_directory, path, sizeof(g_settings.rgui_browser_directory)); @@ -1279,7 +1279,7 @@ static int set_setting_action(uint8_t menu_type, unsigned switchvalue, uint64_t } if (input & (1ULL << DEVICE_NAV_START)) - strlcpy(g_extern.console.main_wrap.default_savestate_dir, default_paths.savestate_dir, sizeof(g_extern.console.main_wrap.default_savestate_dir)); + strlcpy(g_extern.savestate_dir, default_paths.savestate_dir, sizeof(g_extern.savestate_dir)); break; case SETTING_PATH_SRAM_DIRECTORY: @@ -1290,7 +1290,7 @@ static int set_setting_action(uint8_t menu_type, unsigned switchvalue, uint64_t } if (input & (1ULL << DEVICE_NAV_START)) - strlcpy(g_extern.console.main_wrap.default_sram_dir, default_paths.sram_dir, sizeof(g_extern.console.main_wrap.default_sram_dir)); + strlcpy(g_extern.savefile_dir, default_paths.sram_dir, sizeof(g_extern.savefile_dir)); break; #ifdef HAVE_XML case SETTING_PATH_CHEATS: @@ -1342,11 +1342,11 @@ static int set_setting_action(uint8_t menu_type, unsigned switchvalue, uint64_t { strlcpy(g_settings.rgui_browser_directory, default_paths.filebrowser_startup_dir, sizeof(g_settings.rgui_browser_directory)); - strlcpy(g_extern.console.main_wrap.default_savestate_dir, default_paths.port_dir, sizeof(g_extern.console.main_wrap.default_savestate_dir)); + strlcpy(g_extern.savestate_dir, default_paths.port_dir, sizeof(g_extern.savestate_dir)); #ifdef HAVE_XML strlcpy(g_settings.cheat_database, default_paths.port_dir, sizeof(g_settings.cheat_database)); #endif - strlcpy(g_extern.console.main_wrap.default_sram_dir, "", sizeof(g_extern.console.main_wrap.default_sram_dir)); + strlcpy(g_extern.savefile_dir, "", sizeof(g_extern.savefile_dir)); } break; case SETTING_CONTROLS_SCHEME: @@ -2064,12 +2064,12 @@ static int select_setting(void *data, uint64_t input) break; case SETTING_PATH_SAVESTATES_DIRECTORY: strlcpy(text, "Savestate Directory", sizeof(text)); - strlcpy(setting_text, g_extern.console.main_wrap.default_savestate_dir, sizeof(setting_text)); + strlcpy(setting_text, g_extern.savestate_dir, sizeof(setting_text)); strlcpy(comment, "INFO - Directory where savestates will be saved to.", sizeof(comment)); break; case SETTING_PATH_SRAM_DIRECTORY: strlcpy(text, "SRAM Directory", sizeof(text)); - strlcpy(setting_text, g_extern.console.main_wrap.default_sram_dir, sizeof(setting_text)); + strlcpy(setting_text, g_extern.savefile_dir, sizeof(setting_text)); strlcpy(comment, "INFO - Set the default SaveRAM directory path.", sizeof(comment)); break; #ifdef HAVE_XML diff --git a/general.h b/general.h index 6e9db7940a..2151f9b44e 100644 --- a/general.h +++ b/general.h @@ -572,12 +572,6 @@ struct global #endif } sound; - struct - { - char default_savestate_dir[PATH_MAX]; - char default_sram_dir[PATH_MAX]; - } main_wrap; - #ifdef HAVE_OSKUTIL struct { diff --git a/settings.c b/settings.c index 00d88d477f..369f1cc50b 100644 --- a/settings.c +++ b/settings.c @@ -254,7 +254,7 @@ void config_set_defaults(void) g_settings.video.aspect_ratio = -1.0f; // g_extern - strlcpy(g_extern.console.main_wrap.default_sram_dir, default_paths.sram_dir, sizeof(g_extern.console.main_wrap.default_sram_dir)); + strlcpy(g_extern.savefile_dir, default_paths.sram_dir, sizeof(g_extern.savefile_dir)); g_extern.console.screen.gamma_correction = DEFAULT_GAMMA; g_extern.lifecycle_mode_state |= (1ULL << MODE_AUDIO_CUSTOM_BGM_ENABLE); g_extern.lifecycle_mode_state |= (1ULL << MODE_VIDEO_THROTTLE_ENABLE); @@ -264,7 +264,7 @@ void config_set_defaults(void) g_extern.console.screen.orientation = ORIENTATION_NORMAL; g_extern.console.screen.resolutions.current.id = 0; - strlcpy(g_extern.console.main_wrap.default_savestate_dir, default_paths.savestate_dir, sizeof(g_extern.console.main_wrap.default_savestate_dir)); + strlcpy(g_extern.savestate_dir, default_paths.savestate_dir, sizeof(g_extern.savestate_dir)); #ifdef HAVE_RMENU strlcpy(g_extern.menu_texture_path, default_paths.menu_border_file, sizeof(g_extern.menu_texture_path)); #endif