Add Config Aspect Ratio setting to the menu

This commit is contained in:
Monroe88 2017-05-01 20:10:41 -05:00
parent 0dee5b889d
commit b0d6919339
6 changed files with 33 additions and 0 deletions

View File

@ -979,6 +979,8 @@ MSG_HASH(MENU_ENUM_LABEL_USE_THIS_DIRECTORY,
"use_this_directory")
MSG_HASH(MENU_ENUM_LABEL_VIDEO_ALLOW_ROTATE,
"video_allow_rotate")
MSG_HASH(MENU_ENUM_LABEL_VIDEO_ASPECT_RATIO,
"video_aspect_ratio")
MSG_HASH(MENU_ENUM_LABEL_VIDEO_ASPECT_RATIO_AUTO,
"video_aspect_ratio_auto")
MSG_HASH(MENU_ENUM_LABEL_VIDEO_ASPECT_RATIO_INDEX,

View File

@ -1547,6 +1547,8 @@ MSG_HASH(MENU_ENUM_LABEL_VALUE_USE_THIS_DIRECTORY,
"<Use this directory>")
MSG_HASH(MENU_ENUM_LABEL_VALUE_VIDEO_ALLOW_ROTATE,
"Allow rotation")
MSG_HASH(MENU_ENUM_LABEL_VALUE_VIDEO_ASPECT_RATIO,
"Config Aspect Ratio")
MSG_HASH(MENU_ENUM_LABEL_VALUE_VIDEO_ASPECT_RATIO_AUTO,
"Auto Aspect Ratio")
MSG_HASH(MENU_ENUM_LABEL_VALUE_VIDEO_ASPECT_RATIO_INDEX,
@ -2989,6 +2991,8 @@ MSG_HASH(MENU_ENUM_SUBLABEL_CONTENT_SETTINGS,
"Quickly access all relevant in-game settings.")
MSG_HASH(MENU_ENUM_SUBLABEL_CORE_INFORMATION,
"View information pertaining to the application/core.")
MSG_HASH(MENU_ENUM_SUBLABEL_VIDEO_ASPECT_RATIO,
"Floating point value for video aspect ratio (width / height), used if the Aspect Ratio is set to 'Config'.")
MSG_HASH(MENU_ENUM_SUBLABEL_VIDEO_VIEWPORT_CUSTOM_HEIGHT,
"Custom viewport height that is used if the Aspect Ratio is set to 'Custom'.")
MSG_HASH(MENU_ENUM_SUBLABEL_VIDEO_VIEWPORT_CUSTOM_WIDTH,

View File

@ -317,6 +317,7 @@ default_sublabel_macro(action_bind_sublabel_cheat_file_load,
default_sublabel_macro(action_bind_sublabel_cheat_file_save_as, MENU_ENUM_SUBLABEL_CHEAT_FILE_SAVE_AS)
default_sublabel_macro(action_bind_sublabel_quick_menu, MENU_ENUM_SUBLABEL_CONTENT_SETTINGS)
default_sublabel_macro(action_bind_sublabel_core_information, MENU_ENUM_SUBLABEL_CORE_INFORMATION)
default_sublabel_macro(action_bind_sublabel_video_aspect_ratio, MENU_ENUM_SUBLABEL_VIDEO_ASPECT_RATIO)
default_sublabel_macro(action_bind_sublabel_video_viewport_custom_height, MENU_ENUM_SUBLABEL_VIDEO_VIEWPORT_CUSTOM_HEIGHT)
default_sublabel_macro(action_bind_sublabel_video_viewport_custom_width, MENU_ENUM_SUBLABEL_VIDEO_VIEWPORT_CUSTOM_WIDTH)
default_sublabel_macro(action_bind_sublabel_video_viewport_custom_x, MENU_ENUM_SUBLABEL_VIDEO_VIEWPORT_CUSTOM_X)
@ -395,6 +396,9 @@ int menu_cbs_init_bind_sublabel(menu_file_list_cbs_t *cbs,
case MENU_ENUM_LABEL_VIDEO_VIEWPORT_CUSTOM_Y:
BIND_ACTION_SUBLABEL(cbs, action_bind_sublabel_video_viewport_custom_y);
break;
case MENU_ENUM_LABEL_VIDEO_ASPECT_RATIO:
BIND_ACTION_SUBLABEL(cbs, action_bind_sublabel_video_aspect_ratio);
break;
case MENU_ENUM_LABEL_CORE_INFORMATION:
BIND_ACTION_SUBLABEL(cbs, action_bind_sublabel_core_information);
break;

View File

@ -5178,6 +5178,9 @@ bool menu_displaylist_ctl(enum menu_displaylist_ctl_state type, void *data)
menu_displaylist_parse_settings_enum(menu, info,
MENU_ENUM_LABEL_VIDEO_ASPECT_RATIO_INDEX,
PARSE_ONLY_UINT, false);
menu_displaylist_parse_settings_enum(menu, info,
MENU_ENUM_LABEL_VIDEO_ASPECT_RATIO,
PARSE_ONLY_FLOAT, false);
menu_displaylist_parse_settings_enum(menu, info,
MENU_ENUM_LABEL_VIDEO_VIEWPORT_CUSTOM_X,
PARSE_ONLY_INT, false);

View File

@ -3303,6 +3303,25 @@ static bool setting_append_list(
(*list)[list_info->index - 1].get_string_representation =
&setting_get_string_representation_uint_aspect_ratio_index;
CONFIG_FLOAT(
list, list_info,
&settings->floats.video_aspect_ratio,
MENU_ENUM_LABEL_VIDEO_ASPECT_RATIO,
MENU_ENUM_LABEL_VALUE_VIDEO_ASPECT_RATIO,
1.33,
"%.2f",
&group_info,
&subgroup_info,
parent_group,
general_write_handler,
general_read_handler);
menu_settings_list_current_add_cmd(
list,
list_info,
CMD_EVENT_VIDEO_SET_ASPECT_RATIO);
menu_settings_list_current_add_range(list, list_info, 0.1, 16.0, 0.01, true, false);
settings_data_list_current_add_flags(list, list_info, SD_FLAG_LAKKA_ADVANCED);
CONFIG_INT(
list, list_info,
&custom_vp->x,

View File

@ -1354,6 +1354,7 @@ enum msg_hash_enums
MENU_LABEL(USER_LANGUAGE),
MENU_LABEL(NETPLAY_NICKNAME),
MENU_LABEL(VIDEO_VI_WIDTH),
MENU_LABEL(VIDEO_ASPECT_RATIO),
MENU_LABEL(VIDEO_FORCE_ASPECT),
MENU_LABEL(VIDEO_ASPECT_RATIO_AUTO),
MENU_LABEL(VIDEO_ASPECT_RATIO_INDEX),