From 40ba6cf9e2cb853b907f6705df31d376b50d5085 Mon Sep 17 00:00:00 2001 From: twinaphex Date: Sun, 5 May 2013 16:29:32 +0200 Subject: [PATCH] (GX/RMenu) Have per-core configuration use g_extern.input_config_path - have RMenu use it as well --- frontend/frontend_console.c | 8 +++----- frontend/menu/rmenu.c | 6 +++--- general.h | 5 +---- 3 files changed, 7 insertions(+), 12 deletions(-) diff --git a/frontend/frontend_console.c b/frontend/frontend_console.c index aaed036b05..2a1eaddb02 100644 --- a/frontend/frontend_console.c +++ b/frontend/frontend_console.c @@ -22,8 +22,6 @@ #include "../config.def.h" #include "menu/rmenu.h" -char input_path[1024]; - #if defined(__CELLOS_LV2__) #include "platform/platform_ps3_exec.c" #include "platform/platform_ps3.c" @@ -126,8 +124,8 @@ int rarch_main(int argc, char *argv[]) char core_name[64]; libretro_get_current_core_pathname(core_name, sizeof(core_name)); - snprintf(input_path, sizeof(input_path), "%s/%s.cfg", default_paths.input_presets_dir, core_name); - config_read_keybinds(input_path); + snprintf(g_extern.input_config_path, sizeof(g_extern.input_config_path), "%s/%s.cfg", default_paths.input_presets_dir, core_name); + config_read_keybinds(g_extern.input_config_path); #endif menu_init(); @@ -192,7 +190,7 @@ int rarch_main(int argc, char *argv[]) #ifdef GEKKO /* Per-core input config saving */ - config_save_keybinds(input_path); + config_save_keybinds(g_extern.input_config_path); #endif if (g_extern.main_is_init) diff --git a/frontend/menu/rmenu.c b/frontend/menu/rmenu.c index 15df2e330e..2dea51c86c 100644 --- a/frontend/menu/rmenu.c +++ b/frontend/menu/rmenu.c @@ -538,7 +538,7 @@ static int select_file(void *data, uint64_t input) break; #endif case INPUT_PRESET_CHOICE: - strlcpy(g_extern.file_state.input_cfg_path, path, sizeof(g_extern.file_state.input_cfg_path)); + strlcpy(g_extern.input_config_path, path, sizeof(g_extern.input_config_path)); config_read_keybinds(path); break; case BORDER_CHOICE: @@ -1979,8 +1979,8 @@ static int select_setting(void *data, uint64_t input) break; case SETTING_CONTROLS_SCHEME: strlcpy(text, "Control Scheme Preset", sizeof(text)); - snprintf(comment, sizeof(comment), "INFO - Input scheme preset [%s] is selected.", g_extern.file_state.input_cfg_path); - strlcpy(setting_text, g_extern.file_state.input_cfg_path, sizeof(setting_text)); + snprintf(comment, sizeof(comment), "INFO - Input scheme preset [%s] is selected.", g_extern.input_config_path); + strlcpy(setting_text, g_extern.input_config_path, sizeof(setting_text)); break; case SETTING_CONTROLS_NUMBER: strlcpy(text, "Player", sizeof(text)); diff --git a/general.h b/general.h index d64d522283..cf50ba29f9 100644 --- a/general.h +++ b/general.h @@ -325,6 +325,7 @@ struct global #endif char config_path[PATH_MAX]; char append_config_path[PATH_MAX]; + char input_config_path[PATH_MAX]; #ifdef HAVE_FILE_LOGGER char default_log_file[PATH_MAX]; @@ -576,10 +577,6 @@ struct global uint64_t lifecycle_state; uint64_t lifecycle_mode_state; - struct - { - char input_cfg_path[PATH_MAX]; - } file_state; // If this is non-NULL. RARCH_LOG and friends will write to this file. FILE *log_file;