From 7ea2034922bf8307e8dee1bb9855edb4c96b4405 Mon Sep 17 00:00:00 2001 From: twinaphex Date: Sun, 2 Jun 2019 21:02:59 +0200 Subject: [PATCH] Cleanups --- config.def.h | 26 +++++++++++++------------- configuration.c | 18 +++++++++--------- menu/menu_setting.c | 12 ++++++------ 3 files changed, 28 insertions(+), 28 deletions(-) diff --git a/config.def.h b/config.def.h index 09e7369d4e..116a1df95c 100644 --- a/config.def.h +++ b/config.def.h @@ -142,11 +142,11 @@ static const unsigned int def_user_language = 0; #define DEFAULT_WINDOW_DECORATIONS true #if defined(RARCH_CONSOLE) || defined(__APPLE__) -static const bool load_dummy_on_core_shutdown = false; +#define DEFAULT_LOAD_DUMMY_ON_CORE_SHUTDOWN false #else -static const bool load_dummy_on_core_shutdown = true; +#define DEFAULT_LOAD_DUMMY_ON_CORE_SHUTDOWN true #endif -static const bool check_firmware_before_loading = false; +#define DEFAULT_CHECK_FIRMWARE_BEFORE_LOADING false /* Forcibly disable composition. * Only valid on Windows Vista/7/8 for now. */ @@ -211,11 +211,11 @@ static const bool check_firmware_before_loading = false; #define DEFAULT_VIDEO_SHARED_CONTEXT false /* Sets GC/Wii screen width. */ -static const unsigned video_viwidth = 640; +#define DEFAULT_VIDEO_VI_WIDTH 640 #ifdef GEKKO /* Removes 480i flicker, smooths picture a little. */ -static const bool video_vfilter = true; +#define DEFAULT_VIDEO_VFILTER true #endif /* Smooths picture. */ @@ -258,25 +258,25 @@ static const bool video_vfilter = true; #endif /* Save configuration file on exit. */ -static bool config_save_on_exit = true; +#define DEFAULT_CONFIG_SAVE_ON_EXIT true -static bool show_hidden_files = false; +#define DEFAULT_SHOW_HIDDEN_FILES false -static const bool overlay_hide_in_menu = true; +#define DEFAULT_OVERLAY_HIDE_IN_MENU true -static const bool display_keyboard_overlay = false; +#define DEFAULT_DISPLAY_KEYBOARD_OVERLAY false #ifdef HAKCHI -static const float default_input_overlay_opacity = 0.5f; +#define DEFAULT_INPUT_OVERLAY_OPACITY 0.5f #else -static const float default_input_overlay_opacity = 0.7f; +#define DEFAULT_INPUT_OVERLAY_OPACITY 0.7f #endif #ifdef HAVE_MENU #include "menu/menu_driver.h" #include "menu/menu_animation.h" -static bool default_block_config_read = true; +#define DEFAULT_BLOCK_CONFIG_READ true #ifdef HAVE_LIBNX static bool menu_use_preferred_system_color_theme = true; @@ -688,7 +688,7 @@ static const unsigned netplay_share_analog = RARCH_NETPLAY_SHARE_ANALOG_NO_PREFE /* On save state load, block SRAM from being overwritten. * This could potentially lead to buggy games. */ -static const bool block_sram_overwrite = false; +#define DEFAULT_BLOCK_SRAM_OVERWRITE false /* When saving savestates, state index is automatically * incremented before saving. diff --git a/configuration.c b/configuration.c index b44580dcc7..28a57ba5bb 100644 --- a/configuration.c +++ b/configuration.c @@ -1384,8 +1384,8 @@ static struct config_bool_setting *populate_settings_bool(settings_t *settings, #endif SETTING_BOOL("input_descriptor_label_show", &settings->bools.input_descriptor_label_show, true, input_descriptor_label_show, false); SETTING_BOOL("input_descriptor_hide_unbound", &settings->bools.input_descriptor_hide_unbound, true, input_descriptor_hide_unbound, false); - SETTING_BOOL("load_dummy_on_core_shutdown", &settings->bools.load_dummy_on_core_shutdown, true, load_dummy_on_core_shutdown, false); - SETTING_BOOL("check_firmware_before_loading", &settings->bools.check_firmware_before_loading, true, check_firmware_before_loading, false); + SETTING_BOOL("load_dummy_on_core_shutdown", &settings->bools.load_dummy_on_core_shutdown, true, DEFAULT_LOAD_DUMMY_ON_CORE_SHUTDOWN, false); + SETTING_BOOL("check_firmware_before_loading", &settings->bools.check_firmware_before_loading, true, DEFAULT_CHECK_FIRMWARE_BEFORE_LOADING, false); SETTING_BOOL("builtin_mediaplayer_enable", &settings->bools.multimedia_builtin_mediaplayer_enable, false, false /* TODO */, false); SETTING_BOOL("builtin_imageviewer_enable", &settings->bools.multimedia_builtin_imageviewer_enable, true, true, false); SETTING_BOOL("fps_show", &settings->bools.video_fps_show, true, DEFAULT_FPS_SHOW, false); @@ -1452,7 +1452,7 @@ static struct config_bool_setting *populate_settings_bool(settings_t *settings, SETTING_BOOL("small_keyboard_enable", &settings->bools.input_small_keyboard_enable, true, false, false); #endif #ifdef GEKKO - SETTING_BOOL("video_vfilter", &settings->bools.video_vfilter, true, video_vfilter, false); + SETTING_BOOL("video_vfilter", &settings->bools.video_vfilter, true, DEFAULT_VIDEO_VFILTER, false); #endif #ifdef HAVE_THREADS SETTING_BOOL("threaded_data_runloop_enable", &settings->bools.threaded_data_runloop_enable, true, DEFAULT_THREADED_DATA_RUNLOOP_ENABLE, false); @@ -1568,7 +1568,7 @@ static struct config_bool_setting *populate_settings_bool(settings_t *settings, SETTING_BOOL("input_overlay_enable", &settings->bools.input_overlay_enable, true, config_overlay_enable_default(), false); SETTING_BOOL("input_overlay_enable_autopreferred", &settings->bools.input_overlay_enable_autopreferred, true, true, false); SETTING_BOOL("input_overlay_show_physical_inputs", &settings->bools.input_overlay_show_physical_inputs, true, false, false); - SETTING_BOOL("input_overlay_hide_in_menu", &settings->bools.input_overlay_hide_in_menu, true, overlay_hide_in_menu, false); + SETTING_BOOL("input_overlay_hide_in_menu", &settings->bools.input_overlay_hide_in_menu, true, DEFAULT_OVERLAY_HIDE_IN_MENU, false); #endif #ifdef HAVE_VIDEO_LAYOUT SETTING_BOOL("video_layout_enable", &settings->bools.video_layout_enable, true, true, false); @@ -1583,7 +1583,7 @@ static struct config_bool_setting *populate_settings_bool(settings_t *settings, #ifdef HAVE_NETWORKING SETTING_BOOL("netplay_nat_traversal", &settings->bools.netplay_nat_traversal, true, true, false); #endif - SETTING_BOOL("block_sram_overwrite", &settings->bools.block_sram_overwrite, true, block_sram_overwrite, false); + SETTING_BOOL("block_sram_overwrite", &settings->bools.block_sram_overwrite, true, DEFAULT_BLOCK_SRAM_OVERWRITE, false); SETTING_BOOL("savestate_auto_index", &settings->bools.savestate_auto_index, true, savestate_auto_index, false); SETTING_BOOL("savestate_auto_save", &settings->bools.savestate_auto_save, true, savestate_auto_save, false); SETTING_BOOL("savestate_auto_load", &settings->bools.savestate_auto_load, true, savestate_auto_load, false); @@ -1598,8 +1598,8 @@ static struct config_bool_setting *populate_settings_bool(settings_t *settings, SETTING_BOOL("scan_without_core_match", &settings->bools.scan_without_core_match, true, scan_without_core_match, false); SETTING_BOOL("sort_savefiles_enable", &settings->bools.sort_savefiles_enable, true, default_sort_savefiles_enable, false); SETTING_BOOL("sort_savestates_enable", &settings->bools.sort_savestates_enable, true, default_sort_savestates_enable, false); - SETTING_BOOL("config_save_on_exit", &settings->bools.config_save_on_exit, true, config_save_on_exit, false); - SETTING_BOOL("show_hidden_files", &settings->bools.show_hidden_files, true, show_hidden_files, false); + SETTING_BOOL("config_save_on_exit", &settings->bools.config_save_on_exit, true, DEFAULT_CONFIG_SAVE_ON_EXIT, false); + SETTING_BOOL("show_hidden_files", &settings->bools.show_hidden_files, true, DEFAULT_SHOW_HIDDEN_FILES, false); SETTING_BOOL("input_autodetect_enable", &settings->bools.input_autodetect_enable, true, input_autodetect_enable, false); SETTING_BOOL("audio_rate_control", &settings->bools.audio_rate_control, true, DEFAULT_RATE_CONTROL, false); #ifdef HAVE_WASAPI @@ -1664,7 +1664,7 @@ static struct config_float_setting *populate_settings_float(settings_t *settings SETTING_FLOAT("audio_volume", &settings->floats.audio_volume, true, DEFAULT_AUDIO_VOLUME, false); SETTING_FLOAT("audio_mixer_volume", &settings->floats.audio_mixer_volume, true, DEFAULT_AUDIO_MIXER_VOLUME, false); #ifdef HAVE_OVERLAY - SETTING_FLOAT("input_overlay_opacity", &settings->floats.input_overlay_opacity, true, default_input_overlay_opacity, false); + SETTING_FLOAT("input_overlay_opacity", &settings->floats.input_overlay_opacity, true, DEFAULT_INPUT_OVERLAY_OPACITY, false); SETTING_FLOAT("input_overlay_scale", &settings->floats.input_overlay_scale, true, 1.0f, false); #endif #ifdef HAVE_MENU @@ -2364,7 +2364,7 @@ void config_set_defaults(void) midi_output, sizeof(settings->arrays.midi_output)); /* Avoid reloading config on every content load */ - if (default_block_config_read) + if (DEFAULT_BLOCK_CONFIG_READ) rarch_ctl(RARCH_CTL_SET_BLOCK_CONFIG_READ, NULL); else rarch_ctl(RARCH_CTL_UNSET_BLOCK_CONFIG_READ, NULL); diff --git a/menu/menu_setting.c b/menu/menu_setting.c index abc469b894..c098bcaea0 100644 --- a/menu/menu_setting.c +++ b/menu/menu_setting.c @@ -7299,7 +7299,7 @@ static bool setting_append_list( bool_entries[1].target = &settings->bools.load_dummy_on_core_shutdown; bool_entries[1].name_enum_idx = MENU_ENUM_LABEL_DUMMY_ON_CORE_SHUTDOWN; bool_entries[1].SHORT_enum_idx = MENU_ENUM_LABEL_VALUE_DUMMY_ON_CORE_SHUTDOWN; - bool_entries[1].default_value = load_dummy_on_core_shutdown; + bool_entries[1].default_value = DEFAULT_LOAD_DUMMY_ON_CORE_SHUTDOWN; bool_entries[1].flags = SD_FLAG_ADVANCED; bool_entries[2].target = &settings->bools.set_supports_no_game_enable; @@ -7357,13 +7357,13 @@ static bool setting_append_list( bool_entries[0].target = &settings->bools.config_save_on_exit; bool_entries[0].name_enum_idx = MENU_ENUM_LABEL_CONFIG_SAVE_ON_EXIT; bool_entries[0].SHORT_enum_idx = MENU_ENUM_LABEL_VALUE_CONFIG_SAVE_ON_EXIT; - bool_entries[0].default_value = config_save_on_exit; + bool_entries[0].default_value = DEFAULT_CONFIG_SAVE_ON_EXIT; bool_entries[0].flags = SD_FLAG_NONE; bool_entries[1].target = &settings->bools.show_hidden_files; bool_entries[1].name_enum_idx = MENU_ENUM_LABEL_SHOW_HIDDEN_FILES; bool_entries[1].SHORT_enum_idx = MENU_ENUM_LABEL_VALUE_SHOW_HIDDEN_FILES; - bool_entries[1].default_value = show_hidden_files; + bool_entries[1].default_value = DEFAULT_SHOW_HIDDEN_FILES; bool_entries[1].flags = SD_FLAG_NONE; bool_entries[2].target = &settings->bools.game_specific_options; @@ -7552,7 +7552,7 @@ static bool setting_append_list( bool_entries[2].target = &settings->bools.block_sram_overwrite; bool_entries[2].name_enum_idx = MENU_ENUM_LABEL_BLOCK_SRAM_OVERWRITE; bool_entries[2].SHORT_enum_idx = MENU_ENUM_LABEL_VALUE_BLOCK_SRAM_OVERWRITE; - bool_entries[2].default_value = block_sram_overwrite; + bool_entries[2].default_value = DEFAULT_BLOCK_SRAM_OVERWRITE; bool_entries[2].flags = SD_FLAG_NONE; bool_entries[3].target = &settings->bools.savestate_auto_index; @@ -8713,7 +8713,7 @@ static bool setting_append_list( &settings->uints.video_viwidth, MENU_ENUM_LABEL_VIDEO_VI_WIDTH, MENU_ENUM_LABEL_VALUE_VIDEO_VI_WIDTH, - video_viwidth, + DEFAULT_VIDEO_VI_WIDTH, &group_info, &subgroup_info, parent_group, @@ -10660,7 +10660,7 @@ static bool setting_append_list( &settings->bools.input_overlay_hide_in_menu, MENU_ENUM_LABEL_INPUT_OVERLAY_HIDE_IN_MENU, MENU_ENUM_LABEL_VALUE_INPUT_OVERLAY_HIDE_IN_MENU, - overlay_hide_in_menu, + DEFAULT_OVERLAY_HIDE_IN_MENU, MENU_ENUM_LABEL_VALUE_OFF, MENU_ENUM_LABEL_VALUE_ON, &group_info,