(config.def.h) Turn more const variables into macros

This commit is contained in:
twinaphex 2019-06-02 18:09:33 +02:00
parent 5a4294359a
commit f5106afc0f
3 changed files with 24 additions and 24 deletions

View File

@ -136,10 +136,10 @@ static const unsigned int def_user_language = 0;
/* Amount of transparency to use for the main window.
* 1 is the most transparent while 100 is opaque.
*/
static const unsigned window_opacity = 100;
#define DEFAULT_WINDOW_OPACITY 100
/* Whether to show the usual window decorations like border, titlebar etc. */
static const bool window_decorations = true;
#define DEFAULT_WINDOW_DECORATIONS true
#if defined(RARCH_CONSOLE) || defined(__APPLE__)
static const bool load_dummy_on_core_shutdown = false;
@ -199,16 +199,16 @@ static const bool check_firmware_before_loading = false;
#if defined(HAVE_THREADS)
#if defined(GEKKO) || defined(PSP) || defined(PS2)
/* For single-core consoles right now it's best to have this be disabled. */
static const bool threaded_data_runloop_enable = false;
#define DEFAULT_THREADED_DATA_RUNLOOP_ENABLE false
#else
static const bool threaded_data_runloop_enable = true;
#define DEFAULT_THREADED_DATA_RUNLOOP_ENABLE true
#endif
#else
static const bool threaded_data_runloop_enable = false;
#define DEFAULT_THREADED_DATA_RUNLOOP_ENABLE false
#endif
/* Set to true if HW render cores should get their private context. */
static const bool video_shared_context = false;
#define DEFAULT_VIDEO_SHARED_CONTEXT false
/* Sets GC/Wii screen width. */
static const unsigned video_viwidth = 640;
@ -226,16 +226,16 @@ static const bool video_vfilter = true;
/* Enable use of shaders. */
#ifdef RARCH_CONSOLE
static const bool shader_enable = true;
#define DEFAULT_SHADER_ENABLE true
#else
static const bool shader_enable = false;
#define DEFAULT_SHADER_ENABLE false
#endif
/* Only scale in integer steps.
* The base size depends on system-reported geometry and aspect ratio.
* If video_force_aspect is not set, X/Y will be integer scaled independently.
*/
static const bool scale_integer = false;
#define DEFAULT_SCALE_INTEGER false
/* Controls aspect ratio handling. */
@ -453,7 +453,7 @@ static bool default_log_to_file = false;
static bool log_to_file_timestamp = false;
/* Crop overscanned frames. */
static const bool crop_overscan = true;
#define DEFAULT_CROP_OVERSCAN true
/* Font size for on-screen messages. */
#if defined(HAVE_LIBDBGFONT)

View File

@ -1402,7 +1402,7 @@ static struct config_bool_setting *populate_settings_bool(settings_t *settings,
SETTING_BOOL("run_ahead_secondary_instance", &settings->bools.run_ahead_secondary_instance, true, false, false);
SETTING_BOOL("run_ahead_hide_warnings", &settings->bools.run_ahead_hide_warnings, true, false, false);
SETTING_BOOL("audio_sync", &settings->bools.audio_sync, true, DEFAULT_AUDIO_SYNC, false);
SETTING_BOOL("video_shader_enable", &settings->bools.video_shader_enable, true, shader_enable, false);
SETTING_BOOL("video_shader_enable", &settings->bools.video_shader_enable, true, DEFAULT_SHADER_ENABLE, false);
SETTING_BOOL("video_shader_watch_files", &settings->bools.video_shader_watch_files, true, video_shader_watch_files, false);
/* Let implementation decide if automatic, or 1:1 PAR. */
@ -1410,12 +1410,12 @@ static struct config_bool_setting *populate_settings_bool(settings_t *settings,
SETTING_BOOL("video_allow_rotate", &settings->bools.video_allow_rotate, true, allow_rotate, false);
SETTING_BOOL("video_windowed_fullscreen", &settings->bools.video_windowed_fullscreen, true, DEFAULT_WINDOWED_FULLSCREEN, false);
SETTING_BOOL("video_crop_overscan", &settings->bools.video_crop_overscan, true, crop_overscan, false);
SETTING_BOOL("video_scale_integer", &settings->bools.video_scale_integer, true, scale_integer, false);
SETTING_BOOL("video_crop_overscan", &settings->bools.video_crop_overscan, true, DEFAULT_CROP_OVERSCAN, false);
SETTING_BOOL("video_scale_integer", &settings->bools.video_scale_integer, true, DEFAULT_SCALE_INTEGER, false);
SETTING_BOOL("video_smooth", &settings->bools.video_smooth, true, DEFAULT_VIDEO_SMOOTH, false);
SETTING_BOOL("video_force_aspect", &settings->bools.video_force_aspect, true, DEFAULT_FORCE_ASPECT, false);
SETTING_BOOL("video_threaded", video_driver_get_threaded(), true, DEFAULT_VIDEO_THREADED, false);
SETTING_BOOL("video_shared_context", &settings->bools.video_shared_context, true, video_shared_context, false);
SETTING_BOOL("video_shared_context", &settings->bools.video_shared_context, true, DEFAULT_VIDEO_SHARED_CONTEXT, false);
SETTING_BOOL("auto_screenshot_filename", &settings->bools.auto_screenshot_filename, true, auto_screenshot_filename, false);
SETTING_BOOL("video_force_srgb_disable", &settings->bools.video_force_srgb_disable, true, false, false);
SETTING_BOOL("video_fullscreen", &settings->bools.video_fullscreen, true, DEFAULT_FULLSCREEN, false);
@ -1455,7 +1455,7 @@ static struct config_bool_setting *populate_settings_bool(settings_t *settings,
SETTING_BOOL("video_vfilter", &settings->bools.video_vfilter, true, video_vfilter, false);
#endif
#ifdef HAVE_THREADS
SETTING_BOOL("threaded_data_runloop_enable", &settings->bools.threaded_data_runloop_enable, true, threaded_data_runloop_enable, false);
SETTING_BOOL("threaded_data_runloop_enable", &settings->bools.threaded_data_runloop_enable, true, DEFAULT_THREADED_DATA_RUNLOOP_ENABLE, false);
#endif
#ifdef HAVE_MENU
SETTING_BOOL("menu_unified_controls", &settings->bools.menu_unified_controls, true, false, false);
@ -1613,7 +1613,7 @@ static struct config_bool_setting *populate_settings_bool(settings_t *settings,
SETTING_BOOL("screenshots_in_content_dir", &settings->bools.screenshots_in_content_dir, true, default_screenshots_in_content_dir, false);
SETTING_BOOL("video_msg_bgcolor_enable", &settings->bools.video_msg_bgcolor_enable, true, message_bgcolor_enable, false);
SETTING_BOOL("video_window_show_decorations", &settings->bools.video_window_show_decorations, true, window_decorations, false);
SETTING_BOOL("video_window_show_decorations", &settings->bools.video_window_show_decorations, true, DEFAULT_WINDOW_DECORATIONS, false);
SETTING_BOOL("video_window_save_positions", &settings->bools.video_window_save_positions, true, false, false);
SETTING_BOOL("sustained_performance_mode", &settings->bools.sustained_performance_mode, true, sustained_performance_mode, false);
@ -1722,7 +1722,7 @@ static struct config_uint_setting *populate_settings_uint(settings_t *settings,
SETTING_UINT("video_monitor_index", &settings->uints.video_monitor_index, true, DEFAULT_MONITOR_INDEX, false);
SETTING_UINT("video_fullscreen_x", &settings->uints.video_fullscreen_x, true, DEFAULT_FULLSCREEN_X, false);
SETTING_UINT("video_fullscreen_y", &settings->uints.video_fullscreen_y, true, DEFAULT_FULLSCREEN_Y, false);
SETTING_UINT("video_window_opacity", &settings->uints.video_window_opacity, true, window_opacity, false);
SETTING_UINT("video_window_opacity", &settings->uints.video_window_opacity, true, DEFAULT_WINDOW_OPACITY, false);
#ifdef HAVE_VIDEO_LAYOUT
SETTING_UINT("video_layout_selected_view", &settings->uints.video_layout_selected_view, true, 0, false);
#endif

View File

@ -7293,7 +7293,7 @@ static bool setting_append_list(
bool_entries[0].target = &settings->bools.video_shared_context;
bool_entries[0].name_enum_idx = MENU_ENUM_LABEL_VIDEO_SHARED_CONTEXT;
bool_entries[0].SHORT_enum_idx = MENU_ENUM_LABEL_VALUE_VIDEO_SHARED_CONTEXT;
bool_entries[0].default_value = video_shared_context;
bool_entries[0].default_value = DEFAULT_VIDEO_SHARED_CONTEXT;
bool_entries[0].flags = SD_FLAG_ADVANCED;
bool_entries[1].target = &settings->bools.load_dummy_on_core_shutdown;
@ -7413,7 +7413,7 @@ static bool setting_append_list(
&settings->bools.video_shader_enable,
MENU_ENUM_LABEL_VIDEO_SHADERS_ENABLE,
MENU_ENUM_LABEL_VALUE_VIDEO_SHADERS_ENABLE,
shader_enable,
DEFAULT_SHADER_ENABLE,
MENU_ENUM_LABEL_VALUE_OFF,
MENU_ENUM_LABEL_VALUE_ON,
&group_info,
@ -8645,7 +8645,7 @@ static bool setting_append_list(
&settings->uints.video_window_opacity,
MENU_ENUM_LABEL_VIDEO_WINDOW_OPACITY,
MENU_ENUM_LABEL_VALUE_VIDEO_WINDOW_OPACITY,
window_opacity,
DEFAULT_WINDOW_OPACITY,
&group_info,
&subgroup_info,
parent_group,
@ -8662,7 +8662,7 @@ static bool setting_append_list(
&settings->bools.video_window_show_decorations,
MENU_ENUM_LABEL_VIDEO_WINDOW_SHOW_DECORATIONS,
MENU_ENUM_LABEL_VALUE_VIDEO_WINDOW_SHOW_DECORATIONS,
window_decorations,
DEFAULT_WINDOW_DECORATIONS,
MENU_ENUM_LABEL_VALUE_OFF,
MENU_ENUM_LABEL_VALUE_ON,
&group_info,
@ -8693,7 +8693,7 @@ static bool setting_append_list(
&settings->bools.video_scale_integer,
MENU_ENUM_LABEL_VIDEO_SCALE_INTEGER,
MENU_ENUM_LABEL_VALUE_VIDEO_SCALE_INTEGER,
scale_integer,
DEFAULT_SCALE_INTEGER,
MENU_ENUM_LABEL_VALUE_OFF,
MENU_ENUM_LABEL_VALUE_ON,
&group_info,
@ -9003,7 +9003,7 @@ static bool setting_append_list(
&settings->bools.video_crop_overscan,
MENU_ENUM_LABEL_VIDEO_CROP_OVERSCAN,
MENU_ENUM_LABEL_VALUE_VIDEO_CROP_OVERSCAN,
crop_overscan,
DEFAULT_CROP_OVERSCAN,
MENU_ENUM_LABEL_VALUE_OFF,
MENU_ENUM_LABEL_VALUE_ON,
&group_info,
@ -11364,7 +11364,7 @@ static bool setting_append_list(
&settings->bools.threaded_data_runloop_enable,
MENU_ENUM_LABEL_THREADED_DATA_RUNLOOP_ENABLE,
MENU_ENUM_LABEL_VALUE_THREADED_DATA_RUNLOOP_ENABLE,
threaded_data_runloop_enable,
DEFAULT_THREADED_DATA_RUNLOOP_ENABLE,
MENU_ENUM_LABEL_VALUE_OFF,
MENU_ENUM_LABEL_VALUE_ON,
&group_info,