(Menu) Implement selective hiding for VSync and Hard Sync

This commit is contained in:
twinaphex 2019-12-21 00:24:29 +01:00
parent 021102c62d
commit e1a5b80ae1
2 changed files with 45 additions and 32 deletions

View File

@ -5673,45 +5673,54 @@ unsigned menu_displaylist_build_list(file_list_t *list, enum menu_displaylist_ct
count++;
break;
case DISPLAYLIST_VIDEO_SYNCHRONIZATION_SETTINGS_LIST:
if (menu_displaylist_parse_settings_enum(list,
MENU_ENUM_LABEL_VIDEO_VSYNC,
PARSE_ONLY_BOOL, false) == 0)
count++;
if (menu_displaylist_parse_settings_enum(list,
MENU_ENUM_LABEL_VIDEO_SWAP_INTERVAL,
PARSE_ONLY_UINT, false) == 0)
count++;
if (menu_displaylist_parse_settings_enum(list,
MENU_ENUM_LABEL_VIDEO_ADAPTIVE_VSYNC,
PARSE_ONLY_BOOL, false) == 0)
count++;
if (video_driver_test_all_flags(GFX_CTX_FLAGS_CUSTOMIZABLE_SWAPCHAIN_IMAGES))
{
settings_t *settings = config_get_ptr();
if (menu_displaylist_parse_settings_enum(list,
MENU_ENUM_LABEL_VIDEO_MAX_SWAPCHAIN_IMAGES,
PARSE_ONLY_UINT, false) == 0)
count++;
}
if (video_driver_test_all_flags(GFX_CTX_FLAGS_HARD_SYNC))
{
if (menu_displaylist_parse_settings_enum(list,
MENU_ENUM_LABEL_VIDEO_HARD_SYNC,
MENU_ENUM_LABEL_VIDEO_VSYNC,
PARSE_ONLY_BOOL, false) == 0)
count++;
if (settings->bools.video_vsync)
{
if (menu_displaylist_parse_settings_enum(list,
MENU_ENUM_LABEL_VIDEO_SWAP_INTERVAL,
PARSE_ONLY_UINT, false) == 0)
count++;
if (menu_displaylist_parse_settings_enum(list,
MENU_ENUM_LABEL_VIDEO_ADAPTIVE_VSYNC,
PARSE_ONLY_BOOL, false) == 0)
count++;
if (menu_displaylist_parse_settings_enum(list,
MENU_ENUM_LABEL_VIDEO_FRAME_DELAY,
PARSE_ONLY_UINT, false) == 0)
count++;
}
if (video_driver_test_all_flags(GFX_CTX_FLAGS_HARD_SYNC))
{
if (menu_displaylist_parse_settings_enum(list,
MENU_ENUM_LABEL_VIDEO_HARD_SYNC,
PARSE_ONLY_BOOL, false) == 0)
count++;
if (settings->bools.video_hard_sync)
if (menu_displaylist_parse_settings_enum(list,
MENU_ENUM_LABEL_VIDEO_HARD_SYNC_FRAMES,
PARSE_ONLY_UINT, false) == 0)
count++;
}
if (video_driver_test_all_flags(GFX_CTX_FLAGS_CUSTOMIZABLE_SWAPCHAIN_IMAGES))
{
if (menu_displaylist_parse_settings_enum(list,
MENU_ENUM_LABEL_VIDEO_MAX_SWAPCHAIN_IMAGES,
PARSE_ONLY_UINT, false) == 0)
count++;
}
if (menu_displaylist_parse_settings_enum(list,
MENU_ENUM_LABEL_VIDEO_HARD_SYNC_FRAMES,
PARSE_ONLY_UINT, false) == 0)
MENU_ENUM_LABEL_VRR_RUNLOOP_ENABLE,
PARSE_ONLY_BOOL, false) == 0)
count++;
}
if (menu_displaylist_parse_settings_enum(list,
MENU_ENUM_LABEL_VIDEO_FRAME_DELAY,
PARSE_ONLY_UINT, false) == 0)
count++;
if (menu_displaylist_parse_settings_enum(list,
MENU_ENUM_LABEL_VRR_RUNLOOP_ENABLE,
PARSE_ONLY_BOOL, false) == 0)
count++;
break;
case DISPLAYLIST_VIDEO_SCALING_SETTINGS_LIST:
if (menu_displaylist_parse_settings_enum(list,

View File

@ -10013,6 +10013,8 @@ static bool setting_append_list(
general_read_handler,
SD_FLAG_NONE
);
(*list)[list_info->index - 1].action_left = setting_bool_action_left_with_refresh;
(*list)[list_info->index - 1].action_right = setting_bool_action_right_with_refresh;
CONFIG_UINT(
list, list_info,
@ -10062,6 +10064,8 @@ static bool setting_append_list(
general_write_handler,
general_read_handler,
SD_FLAG_NONE);
(*list)[list_info->index - 1].action_left = setting_bool_action_left_with_refresh;
(*list)[list_info->index - 1].action_right = setting_bool_action_right_with_refresh;
CONFIG_UINT(
list, list_info,