Turn more default values into macros

This commit is contained in:
twinaphex 2019-07-19 13:14:29 +02:00
parent d7e1099a97
commit fdf28e5259
3 changed files with 9 additions and 11 deletions

View File

@ -562,15 +562,13 @@ static const float message_bgcolor_opacity = 1.0f;
* If your monitor does not run at 60Hz, or something close to it,
* disable VSync, and leave this at its default. */
#ifdef _3DS
static const float refresh_rate = (32730.0 * 8192.0) / 4481134.0 ;
static const float crt_refresh_rate = (32730.0 * 8192.0) / 4481134.0 ;
#define DEFAULT_REFRESH_RATE ((32730.0 * 8192.0) / 4481134.0)
#elif defined(RARCH_CONSOLE)
static const float refresh_rate = 60/1.001;
static const float crt_refresh_rate = 60/1.001;
#define DEFAULT_REFRESH_RATE (60/1.001)
#else
static const float refresh_rate = 60;
static const float crt_refresh_rate = 60;
#define DEFAULT_REFRESH_RATE (60)
#endif
#define DEFAULT_CRT_REFRESH_RATE (DEFAULT_REFRESH_RATE)
/* Allow games to set rotation. If false, rotation requests are
* honored, but ignored.

View File

@ -1638,8 +1638,8 @@ static struct config_float_setting *populate_settings_float(settings_t *settings
SETTING_FLOAT("video_aspect_ratio", &settings->floats.video_aspect_ratio, true, DEFAULT_ASPECT_RATIO, false);
SETTING_FLOAT("video_scale", &settings->floats.video_scale, false, 0.0f, false);
SETTING_FLOAT("crt_video_refresh_rate", &settings->floats.crt_video_refresh_rate, true, crt_refresh_rate, false);
SETTING_FLOAT("video_refresh_rate", &settings->floats.video_refresh_rate, true, refresh_rate, false);
SETTING_FLOAT("crt_video_refresh_rate", &settings->floats.crt_video_refresh_rate, true, DEFAULT_CRT_REFRESH_RATE, false);
SETTING_FLOAT("video_refresh_rate", &settings->floats.video_refresh_rate, true, DEFAULT_REFRESH_RATE, false);
SETTING_FLOAT("audio_rate_control_delta", audio_get_float_ptr(AUDIO_ACTION_RATE_CONTROL_DELTA), true, DEFAULT_RATE_CONTROL_DELTA, false);
SETTING_FLOAT("audio_max_timing_skew", &settings->floats.audio_max_timing_skew, true, DEFAULT_MAX_TIMING_SKEW, false);
SETTING_FLOAT("audio_volume", &settings->floats.audio_volume, true, DEFAULT_AUDIO_VOLUME, false);
@ -2048,7 +2048,7 @@ void config_set_defaults(void)
settings->floats.video_msg_color_b = ((message_color >> 0) & 0xff) / 255.0f;
if (g_defaults.settings.video_refresh_rate > 0.0 &&
g_defaults.settings.video_refresh_rate != refresh_rate)
g_defaults.settings.video_refresh_rate != DEFAULT_REFRESH_RATE)
settings->floats.video_refresh_rate = g_defaults.settings.video_refresh_rate;
if (DEFAULT_AUDIO_DEVICE)

View File

@ -8547,7 +8547,7 @@ static bool setting_append_list(
&settings->floats.video_refresh_rate,
MENU_ENUM_LABEL_VIDEO_REFRESH_RATE,
MENU_ENUM_LABEL_VALUE_VIDEO_REFRESH_RATE,
refresh_rate,
DEFAULT_REFRESH_RATE,
"%.3f Hz",
&group_info,
&subgroup_info,
@ -8562,7 +8562,7 @@ static bool setting_append_list(
&settings->floats.video_refresh_rate,
MENU_ENUM_LABEL_VIDEO_REFRESH_RATE_AUTO,
MENU_ENUM_LABEL_VALUE_VIDEO_REFRESH_RATE_AUTO,
refresh_rate,
DEFAULT_REFRESH_RATE,
"%.3f Hz",
&group_info,
&subgroup_info,