Simplify CONFIG_FLOAT

This commit is contained in:
twinaphex 2016-10-26 05:07:27 +02:00
parent 24e9f8dc09
commit 079bf52ed0
3 changed files with 41 additions and 38 deletions

View File

@ -3276,8 +3276,8 @@ static bool setting_append_list(
CONFIG_FLOAT(
list, list_info,
&settings->video.refresh_rate,
msg_hash_to_str(MENU_ENUM_LABEL_VIDEO_REFRESH_RATE),
msg_hash_to_str(MENU_ENUM_LABEL_VALUE_VIDEO_REFRESH_RATE),
MENU_ENUM_LABEL_VIDEO_REFRESH_RATE,
MENU_ENUM_LABEL_VALUE_VIDEO_REFRESH_RATE,
refresh_rate,
"%.3f Hz",
&group_info,
@ -3291,8 +3291,8 @@ static bool setting_append_list(
CONFIG_FLOAT(
list, list_info,
&settings->video.refresh_rate,
msg_hash_to_str(MENU_ENUM_LABEL_VIDEO_REFRESH_RATE_AUTO),
msg_hash_to_str(MENU_ENUM_LABEL_VALUE_VIDEO_REFRESH_RATE_AUTO),
MENU_ENUM_LABEL_VIDEO_REFRESH_RATE_AUTO,
MENU_ENUM_LABEL_VALUE_VIDEO_REFRESH_RATE_AUTO,
refresh_rate,
"%.3f Hz",
&group_info,
@ -3444,8 +3444,8 @@ static bool setting_append_list(
CONFIG_FLOAT(
list, list_info,
&settings->video.scale,
msg_hash_to_str(MENU_ENUM_LABEL_VIDEO_SCALE),
msg_hash_to_str(MENU_ENUM_LABEL_VALUE_VIDEO_SCALE),
MENU_ENUM_LABEL_VIDEO_SCALE,
MENU_ENUM_LABEL_VALUE_VIDEO_SCALE,
scale,
"%.1fx",
&group_info,
@ -3814,8 +3814,8 @@ static bool setting_append_list(
CONFIG_FLOAT(
list, list_info,
&settings->audio.volume,
msg_hash_to_str(MENU_ENUM_LABEL_AUDIO_VOLUME),
msg_hash_to_str(MENU_ENUM_LABEL_VALUE_AUDIO_VOLUME),
MENU_ENUM_LABEL_AUDIO_VOLUME,
MENU_ENUM_LABEL_VALUE_AUDIO_VOLUME,
audio_volume,
"%.1f",
&group_info,
@ -3892,8 +3892,8 @@ static bool setting_append_list(
CONFIG_FLOAT(
list, list_info,
&settings->audio.rate_control_delta,
msg_hash_to_str(MENU_ENUM_LABEL_AUDIO_RATE_CONTROL_DELTA),
msg_hash_to_str(MENU_ENUM_LABEL_VALUE_AUDIO_RATE_CONTROL_DELTA),
MENU_ENUM_LABEL_AUDIO_RATE_CONTROL_DELTA,
MENU_ENUM_LABEL_VALUE_AUDIO_RATE_CONTROL_DELTA,
rate_control_delta,
"%.3f",
&group_info,
@ -3915,8 +3915,8 @@ static bool setting_append_list(
CONFIG_FLOAT(
list, list_info,
&settings->audio.max_timing_skew,
msg_hash_to_str(MENU_ENUM_LABEL_AUDIO_MAX_TIMING_SKEW),
msg_hash_to_str(MENU_ENUM_LABEL_VALUE_AUDIO_MAX_TIMING_SKEW),
MENU_ENUM_LABEL_AUDIO_MAX_TIMING_SKEW,
MENU_ENUM_LABEL_VALUE_AUDIO_MAX_TIMING_SKEW,
max_timing_skew,
"%.2f",
&group_info,
@ -4272,8 +4272,8 @@ static bool setting_append_list(
CONFIG_FLOAT(
list, list_info,
&settings->input.axis_threshold,
msg_hash_to_str(MENU_ENUM_LABEL_INPUT_AXIS_THRESHOLD),
msg_hash_to_str(MENU_ENUM_LABEL_VALUE_INPUT_AXIS_THRESHOLD),
MENU_ENUM_LABEL_INPUT_AXIS_THRESHOLD,
MENU_ENUM_LABEL_VALUE_INPUT_AXIS_THRESHOLD,
axis_threshold,
"%.3f",
&group_info,
@ -4528,8 +4528,8 @@ static bool setting_append_list(
CONFIG_FLOAT(
list, list_info,
&settings->fastforward_ratio,
msg_hash_to_str(MENU_ENUM_LABEL_FASTFORWARD_RATIO),
msg_hash_to_str(MENU_ENUM_LABEL_VALUE_FASTFORWARD_RATIO),
MENU_ENUM_LABEL_FASTFORWARD_RATIO,
MENU_ENUM_LABEL_VALUE_FASTFORWARD_RATIO,
fastforward_ratio,
"%.1fx",
&group_info,
@ -4544,8 +4544,8 @@ static bool setting_append_list(
CONFIG_FLOAT(
list, list_info,
&settings->slowmotion_ratio,
msg_hash_to_str(MENU_ENUM_LABEL_SLOWMOTION_RATIO),
msg_hash_to_str(MENU_ENUM_LABEL_VALUE_SLOWMOTION_RATIO),
MENU_ENUM_LABEL_SLOWMOTION_RATIO,
MENU_ENUM_LABEL_VALUE_SLOWMOTION_RATIO,
slowmotion_ratio,
"%.1fx",
&group_info,
@ -4622,8 +4622,8 @@ static bool setting_append_list(
CONFIG_FLOAT(
list, list_info,
&settings->video.font_size,
msg_hash_to_str(MENU_ENUM_LABEL_VIDEO_FONT_SIZE),
msg_hash_to_str(MENU_ENUM_LABEL_VALUE_VIDEO_FONT_SIZE),
MENU_ENUM_LABEL_VIDEO_FONT_SIZE,
MENU_ENUM_LABEL_VALUE_VIDEO_FONT_SIZE,
font_size,
"%.1f",
&group_info,
@ -4637,8 +4637,8 @@ static bool setting_append_list(
CONFIG_FLOAT(
list, list_info,
&settings->video.msg_pos_x,
msg_hash_to_str(MENU_ENUM_LABEL_VIDEO_MESSAGE_POS_X),
msg_hash_to_str(MENU_ENUM_LABEL_VALUE_VIDEO_MESSAGE_POS_X),
MENU_ENUM_LABEL_VIDEO_MESSAGE_POS_X,
MENU_ENUM_LABEL_VALUE_VIDEO_MESSAGE_POS_X,
message_pos_offset_x,
"%.3f",
&group_info,
@ -4652,8 +4652,8 @@ static bool setting_append_list(
CONFIG_FLOAT(
list, list_info,
&settings->video.msg_pos_y,
msg_hash_to_str(MENU_ENUM_LABEL_VIDEO_MESSAGE_POS_Y),
msg_hash_to_str(MENU_ENUM_LABEL_VALUE_VIDEO_MESSAGE_POS_Y),
MENU_ENUM_LABEL_VIDEO_MESSAGE_POS_Y,
MENU_ENUM_LABEL_VALUE_VIDEO_MESSAGE_POS_Y,
message_pos_offset_y,
"%.3f",
&group_info,
@ -4767,8 +4767,8 @@ static bool setting_append_list(
CONFIG_FLOAT(
list, list_info,
&settings->input.overlay_opacity,
msg_hash_to_str(MENU_ENUM_LABEL_OVERLAY_OPACITY),
msg_hash_to_str(MENU_ENUM_LABEL_VALUE_OVERLAY_OPACITY),
MENU_ENUM_LABEL_OVERLAY_OPACITY,
MENU_ENUM_LABEL_VALUE_OVERLAY_OPACITY,
0.7f,
"%.2f",
&group_info,
@ -4784,8 +4784,8 @@ static bool setting_append_list(
CONFIG_FLOAT(
list, list_info,
&settings->input.overlay_scale,
msg_hash_to_str(MENU_ENUM_LABEL_OVERLAY_SCALE),
msg_hash_to_str(MENU_ENUM_LABEL_VALUE_OVERLAY_SCALE),
MENU_ENUM_LABEL_OVERLAY_SCALE,
MENU_ENUM_LABEL_VALUE_OVERLAY_SCALE,
1.0f,
"%.2f",
&group_info,
@ -4851,8 +4851,8 @@ static bool setting_append_list(
CONFIG_FLOAT(
list, list_info,
&settings->menu.wallpaper.opacity,
msg_hash_to_str(MENU_ENUM_LABEL_MENU_WALLPAPER_OPACITY),
msg_hash_to_str(MENU_ENUM_LABEL_VALUE_MENU_WALLPAPER_OPACITY),
MENU_ENUM_LABEL_MENU_WALLPAPER_OPACITY,
MENU_ENUM_LABEL_VALUE_MENU_WALLPAPER_OPACITY,
menu_wallpaper_opacity,
"%.3f",
&group_info,
@ -5321,8 +5321,8 @@ static bool setting_append_list(
CONFIG_FLOAT(
list, list_info,
&settings->menu.header.opacity,
msg_hash_to_str(MENU_ENUM_LABEL_MATERIALUI_MENU_HEADER_OPACITY),
msg_hash_to_str(MENU_ENUM_LABEL_VALUE_MATERIALUI_MENU_HEADER_OPACITY),
MENU_ENUM_LABEL_MATERIALUI_MENU_HEADER_OPACITY,
MENU_ENUM_LABEL_VALUE_MATERIALUI_MENU_HEADER_OPACITY,
menu_header_opacity,
"%.3f",
&group_info,
@ -5336,8 +5336,8 @@ static bool setting_append_list(
CONFIG_FLOAT(
list, list_info,
&settings->menu.footer.opacity,
msg_hash_to_str(MENU_ENUM_LABEL_MATERIALUI_MENU_FOOTER_OPACITY),
msg_hash_to_str(MENU_ENUM_LABEL_VALUE_MATERIALUI_MENU_FOOTER_OPACITY),
MENU_ENUM_LABEL_MATERIALUI_MENU_FOOTER_OPACITY,
MENU_ENUM_LABEL_VALUE_MATERIALUI_MENU_FOOTER_OPACITY,
menu_footer_opacity,
"%.3f",
&group_info,

View File

@ -1544,15 +1544,17 @@ bool CONFIG_FLOAT(
rarch_setting_t **list,
rarch_setting_info_t *list_info,
float *target,
const char *name, const char *SHORT,
enum msg_hash_enums name_enum_idx,
enum msg_hash_enums SHORT_enum_idx,
float default_value, const char *rounding,
rarch_setting_group_info_t *group_info,
rarch_setting_group_info_t *subgroup_info,
const char *parent_group,
change_handler_t change_handler, change_handler_t read_handler)
{
rarch_setting_t value = setting_float_setting (name, SHORT, target, default_value, rounding,
group_info->name, subgroup_info->name, parent_group, change_handler, read_handler);
rarch_setting_t value = setting_float_setting (msg_hash_to_str(name_enum_idx),
msg_hash_to_str(SHORT_enum_idx), target, default_value, rounding,
group_info->name, subgroup_info->name, parent_group, change_handler, read_handler);
if (!(settings_list_append(list, list_info)))
return false;
if (value.name)

View File

@ -268,7 +268,8 @@ bool CONFIG_FLOAT(
rarch_setting_t **list,
rarch_setting_info_t *list_info,
float *target,
const char *name, const char *SHORT,
enum msg_hash_enums name_enum_idx,
enum msg_hash_enums SHORT_enum_idx,
float default_value, const char *rounding,
rarch_setting_group_info_t *group_info,
rarch_setting_group_info_t *subgroup_info,