From d376ea0c9d54dc571f95f508590a8466c0761773 Mon Sep 17 00:00:00 2001 From: twinaphex Date: Sat, 1 Oct 2016 08:24:02 +0200 Subject: [PATCH] Merge fixes --- configuration.c | 13 ++++++++----- input/input_remapping.c | 2 ++ menu/menu_setting.c | 2 +- paths.c | 34 ++++------------------------------ record/record_driver.c | 3 ++- retroarch.c | 12 +----------- runloop.h | 3 --- 7 files changed, 18 insertions(+), 51 deletions(-) diff --git a/configuration.c b/configuration.c index 3461cf9455..492d87c7a1 100644 --- a/configuration.c +++ b/configuration.c @@ -1142,9 +1142,9 @@ static void config_set_defaults(void) /* Make sure settings from other configs carry over into defaults * for another config. */ - if (!retroarch_override_setting_is_set(RARCH_OVERRIDE_SETTING_SAVE_PATH)) + if (!retroarch_override_setting_is_set(RARCH_OVERRIDE_SETTING_SAVE_PATH, NULL)) dir_clear_savefile(); - if (!retroarch_override_setting_is_set(RARCH_OVERRIDE_SETTING_STATE_PATH)) + if (!retroarch_override_setting_is_set(RARCH_OVERRIDE_SETTING_STATE_PATH, NULL)) dir_clear_savestate(); *settings->path.libretro_info = '\0'; @@ -1177,8 +1177,11 @@ static void config_set_defaults(void) if (!retroarch_override_setting_is_set(RARCH_OVERRIDE_SETTING_IPS_PREF, NULL)) rarch_ctl(RARCH_CTL_UNSET_IPS_PREF, NULL); - *global->record.output_dir = '\0'; - *global->record.config_dir = '\0'; + { + global_t *global = global_get_ptr(); + *global->record.output_dir = '\0'; + *global->record.config_dir = '\0'; + } *settings->path.core_options = '\0'; *settings->path.content_history = '\0'; @@ -1766,7 +1769,7 @@ static bool config_load_file(const char *path, bool set_defaults, override_username = strdup(settings->username); #ifdef HAVE_NETWORKING - if (retroarch_override_setting_is_set(RARCH_OVERRIDE_SETTING_NETPLAY_IP_ADDRESS)) + if (retroarch_override_setting_is_set(RARCH_OVERRIDE_SETTING_NETPLAY_IP_ADDRESS, NULL)) override_netplay_ip_address = strdup(global->netplay.server); #endif diff --git a/input/input_remapping.c b/input/input_remapping.c index 19db5783a3..6e556b2df3 100644 --- a/input/input_remapping.c +++ b/input/input_remapping.c @@ -20,6 +20,7 @@ #include "input_remapping.h" #include "../configuration.h" +#include "../retroarch.h" #include "../runloop.h" /** @@ -35,6 +36,7 @@ bool input_remapping_load_file(void *data, const char *path) unsigned i, j; config_file_t *conf = (config_file_t*)data; settings_t *settings = config_get_ptr(); + global_t *global = global_get_ptr(); if (!conf || string_is_empty(path)) return false; diff --git a/menu/menu_setting.c b/menu/menu_setting.c index 89161230e9..55d9fd837c 100644 --- a/menu/menu_setting.c +++ b/menu/menu_setting.c @@ -1658,7 +1658,7 @@ void general_write_handler(void *data) #ifdef HAVE_NETWORKING if (!global->netplay.is_client) *global->netplay.server = '\0'; - retroarch_override_setting_set(RARCH_OVERRIDE_SETTING_NETPLAY_MODE); + retroarch_override_setting_set(RARCH_OVERRIDE_SETTING_NETPLAY_MODE, NULL); #endif break; case MENU_ENUM_LABEL_NETPLAY_SPECTATOR_MODE_ENABLE: diff --git a/paths.c b/paths.c index 2b19ccc3b1..cabb1553eb 100644 --- a/paths.c +++ b/paths.c @@ -281,7 +281,7 @@ void path_set_special(char **argv, unsigned num_content) * It is more complicated for special content types. */ if (global) { - if (!retroarch_override_setting_is_set(RARCH_OVERRIDE_SETTING_STATE_PATH)) + if (!retroarch_override_setting_is_set(RARCH_OVERRIDE_SETTING_STATE_PATH, NULL)) fill_pathname_noext(global->name.savestate, path_main_basename, file_path_str(FILE_PATH_STATE_EXTENSION), sizeof(global->name.savestate)); @@ -362,15 +362,10 @@ static bool path_init_subsystem(void) } } -<<<<<<< HEAD - /* Let other relevant paths be inferred from the main SRAM location. */ - if (!retroarch_override_setting_is_set(RARCH_OVERRIDE_SETTING_SAVE_PATH, NULL)) -======= if (global) ->>>>>>> parent of 6ee7b73... Move global->name to paths.c { /* Let other relevant paths be inferred from the main SRAM location. */ - if (!retroarch_override_setting_is_set(RARCH_OVERRIDE_SETTING_SAVE_PATH)) + if (!retroarch_override_setting_is_set(RARCH_OVERRIDE_SETTING_SAVE_PATH, NULL)) fill_pathname_noext(global->name.savefile, path_main_basename, file_path_str(FILE_PATH_SRM_EXTENSION), @@ -505,38 +500,17 @@ size_t path_get_core_size(void) static void path_set_names(const char *path) { -<<<<<<< HEAD - path_set_basename(path); - - if (!retroarch_override_setting_is_set(RARCH_OVERRIDE_SETTING_SAVE_PATH, NULL)) - { - char tmp[PATH_MAX_LENGTH] = {0}; - - fill_pathname_noext(tmp, path_main_basename, - file_path_str(FILE_PATH_SRM_EXTENSION), sizeof(tmp)); - - path_set(RARCH_PATH_SAVEFILE, tmp); - } - - if (!retroarch_override_setting_is_set(RARCH_OVERRIDE_SETTING_STATE_PATH, NULL)) - { - char tmp[PATH_MAX_LENGTH] = {0}; - - fill_pathname_noext(tmp, path_main_basename, - file_path_str(FILE_PATH_STATE_EXTENSION), sizeof(tmp)); -======= global_t *global = global_get_ptr(); ->>>>>>> parent of 6ee7b73... Move global->name to paths.c path_set_basename(path); if (global) { - if (!retroarch_override_setting_is_set(RARCH_OVERRIDE_SETTING_SAVE_PATH)) + if (!retroarch_override_setting_is_set(RARCH_OVERRIDE_SETTING_SAVE_PATH, NULL)) fill_pathname_noext(global->name.savefile, path_main_basename, file_path_str(FILE_PATH_SRM_EXTENSION), sizeof(global->name.savefile)); - if (!retroarch_override_setting_is_set(RARCH_OVERRIDE_SETTING_STATE_PATH)) + if (!retroarch_override_setting_is_set(RARCH_OVERRIDE_SETTING_STATE_PATH, NULL)) fill_pathname_noext(global->name.savestate, path_main_basename, file_path_str(FILE_PATH_STATE_EXTENSION), sizeof(global->name.savestate)); diff --git a/record/record_driver.c b/record/record_driver.c index e803758e0a..4087372c09 100644 --- a/record/record_driver.c +++ b/record/record_driver.c @@ -304,9 +304,10 @@ bool recording_init(void) { char recording_file[PATH_MAX_LENGTH] = {0}; struct ffemu_params params = {0}; - settings_t *settings = config_get_ptr(); struct retro_system_av_info *av_info = video_viewport_get_system_av_info(); bool *recording_enabled = recording_is_enabled(); + settings_t *settings = config_get_ptr(); + global_t *global = global_get_ptr(); if (!*recording_enabled) return false; diff --git a/retroarch.c b/retroarch.c index c823caab2b..31a7ac84b2 100644 --- a/retroarch.c +++ b/retroarch.c @@ -873,23 +873,13 @@ static void retroarch_parse_input(int argc, char *argv[]) content_set_does_not_need_content(); /* Copy SRM/state dirs used, so they can be reused on reentrancy. */ -<<<<<<< HEAD if (retroarch_override_setting_is_set(RARCH_OVERRIDE_SETTING_SAVE_PATH, NULL) && - path_is_directory(path_get(RARCH_PATH_SAVEFILE))) - dir_set_savefile(path_get(RARCH_PATH_SAVEFILE)); - - if (retroarch_override_setting_is_set(RARCH_OVERRIDE_SETTING_STATE_PATH, NULL) && - path_is_directory(path_get(RARCH_PATH_SAVESTATE))) - dir_set_savestate(path_get(RARCH_PATH_SAVESTATE)); -======= - if (retroarch_override_setting_is_set(RARCH_OVERRIDE_SETTING_SAVE_PATH) && path_is_directory(global->name.savefile)) dir_set_savefile(global->name.savefile); - if (retroarch_override_setting_is_set(RARCH_OVERRIDE_SETTING_STATE_PATH) && + if (retroarch_override_setting_is_set(RARCH_OVERRIDE_SETTING_STATE_PATH, NULL) && path_is_directory(global->name.savestate)) dir_set_savestate(global->name.savestate); ->>>>>>> parent of 6ee7b73... Move global->name to paths.c } static bool retroarch_init_state(void) diff --git a/runloop.h b/runloop.h index 5a68ba563c..0b9b74a154 100644 --- a/runloop.h +++ b/runloop.h @@ -137,8 +137,6 @@ typedef struct rarch_resolution typedef struct global { -<<<<<<< HEAD -======= struct { bool libretro_device[MAX_USERS]; @@ -155,7 +153,6 @@ typedef struct global char remapfile[PATH_MAX_LENGTH]; } name; ->>>>>>> parent of 6ee7b73... Move global->name to paths.c #ifdef HAVE_NETWORKING /* Netplay. */ struct