(Menu displaylist) Cleanups

This commit is contained in:
twinaphex 2019-04-23 04:19:28 +02:00
parent 3c130927d3
commit afbc113e7b

View File

@ -3716,6 +3716,27 @@ unsigned menu_displaylist_build_list(file_list_t *list, enum menu_displaylist_ct
switch (type)
{
case DISPLAYLIST_ONSCREEN_OVERLAY_SETTINGS_LIST:
{
menu_displaylist_build_info_t build_list[] = {
{MENU_ENUM_LABEL_INPUT_OVERLAY_ENABLE, PARSE_ONLY_BOOL },
{MENU_ENUM_LABEL_INPUT_OVERLAY_HIDE_IN_MENU, PARSE_ONLY_BOOL },
{MENU_ENUM_LABEL_INPUT_OVERLAY_SHOW_PHYSICAL_INPUTS, PARSE_ONLY_BOOL },
{MENU_ENUM_LABEL_INPUT_OVERLAY_SHOW_PHYSICAL_INPUTS_PORT,PARSE_ONLY_BOOL },
{MENU_ENUM_LABEL_OVERLAY_PRESET, PARSE_ONLY_PATH },
{MENU_ENUM_LABEL_OVERLAY_OPACITY, PARSE_ONLY_FLOAT },
{MENU_ENUM_LABEL_OVERLAY_SCALE, PARSE_ONLY_FLOAT },
};
for (i = 0; i < ARRAY_SIZE(build_list); i++)
{
if (menu_displaylist_parse_settings_enum(list,
build_list[i].enum_idx, build_list[i].parse_type,
false) == 0)
count++;
}
}
break;
case DISPLAYLIST_LATENCY_SETTINGS_LIST:
{
menu_displaylist_build_info_t build_list[] = {
@ -3965,55 +3986,28 @@ unsigned menu_displaylist_build_list(file_list_t *list, enum menu_displaylist_ct
}
break;
case DISPLAYLIST_QUICK_MENU_VIEWS_SETTINGS_LIST:
if (menu_displaylist_parse_settings_enum(list,
MENU_ENUM_LABEL_QUICK_MENU_SHOW_TAKE_SCREENSHOT,
PARSE_ONLY_BOOL, false) == 0)
count++;
{
menu_displaylist_build_info_t build_list[] = {
{MENU_ENUM_LABEL_QUICK_MENU_SHOW_TAKE_SCREENSHOT, PARSE_ONLY_BOOL},
{MENU_ENUM_LABEL_QUICK_MENU_SHOW_SAVE_LOAD_STATE, PARSE_ONLY_BOOL},
{MENU_ENUM_LABEL_QUICK_MENU_SHOW_UNDO_SAVE_LOAD_STATE, PARSE_ONLY_BOOL},
{MENU_ENUM_LABEL_QUICK_MENU_SHOW_ADD_TO_FAVORITES, PARSE_ONLY_BOOL},
{MENU_ENUM_LABEL_QUICK_MENU_SHOW_START_RECORDING, PARSE_ONLY_BOOL},
{MENU_ENUM_LABEL_QUICK_MENU_SHOW_START_STREAMING, PARSE_ONLY_BOOL},
{MENU_ENUM_LABEL_QUICK_MENU_SHOW_RESET_CORE_ASSOCIATION, PARSE_ONLY_BOOL},
{MENU_ENUM_LABEL_QUICK_MENU_SHOW_OPTIONS, PARSE_ONLY_BOOL},
{MENU_ENUM_LABEL_QUICK_MENU_SHOW_CONTROLS, PARSE_ONLY_BOOL},
{MENU_ENUM_LABEL_QUICK_MENU_SHOW_CHEATS, PARSE_ONLY_BOOL},
};
if (menu_displaylist_parse_settings_enum(list,
MENU_ENUM_LABEL_QUICK_MENU_SHOW_SAVE_LOAD_STATE,
PARSE_ONLY_BOOL, false) == 0)
count++;
if (menu_displaylist_parse_settings_enum(list,
MENU_ENUM_LABEL_QUICK_MENU_SHOW_UNDO_SAVE_LOAD_STATE,
PARSE_ONLY_BOOL, false) == 0)
count++;
if (menu_displaylist_parse_settings_enum(list,
MENU_ENUM_LABEL_QUICK_MENU_SHOW_ADD_TO_FAVORITES,
PARSE_ONLY_BOOL, false) == 0)
count++;
if (menu_displaylist_parse_settings_enum(list,
MENU_ENUM_LABEL_QUICK_MENU_SHOW_START_RECORDING,
PARSE_ONLY_BOOL, false) == 0)
count++;
if (menu_displaylist_parse_settings_enum(list,
MENU_ENUM_LABEL_QUICK_MENU_SHOW_START_STREAMING,
PARSE_ONLY_BOOL, false) == 0)
count++;
if (menu_displaylist_parse_settings_enum(list,
MENU_ENUM_LABEL_QUICK_MENU_SHOW_RESET_CORE_ASSOCIATION,
PARSE_ONLY_BOOL, false) == 0)
count++;
if (menu_displaylist_parse_settings_enum(list,
MENU_ENUM_LABEL_QUICK_MENU_SHOW_OPTIONS,
PARSE_ONLY_BOOL, false) == 0)
count++;
if (menu_displaylist_parse_settings_enum(list,
MENU_ENUM_LABEL_QUICK_MENU_SHOW_CONTROLS,
PARSE_ONLY_BOOL, false) == 0)
count++;
if (menu_displaylist_parse_settings_enum(list,
MENU_ENUM_LABEL_QUICK_MENU_SHOW_CHEATS,
PARSE_ONLY_BOOL, false) == 0)
count++;
for (i = 0; i < ARRAY_SIZE(build_list); i++)
{
if (menu_displaylist_parse_settings_enum(list,
build_list[i].enum_idx, build_list[i].parse_type,
false) == 0)
count++;
}
}
if (video_shader_any_supported())
{
@ -4022,32 +4016,25 @@ unsigned menu_displaylist_build_list(file_list_t *list, enum menu_displaylist_ct
PARSE_ONLY_BOOL, false) == 0)
count++;
}
if (menu_displaylist_parse_settings_enum(list,
MENU_ENUM_LABEL_CONTENT_SHOW_REWIND,
PARSE_ONLY_BOOL, false) == 0)
count++;
if (menu_displaylist_parse_settings_enum(list,
MENU_ENUM_LABEL_CONTENT_SHOW_LATENCY,
PARSE_ONLY_BOOL, false) == 0)
count++;
if (menu_displaylist_parse_settings_enum(list,
MENU_ENUM_LABEL_CONTENT_SHOW_OVERLAYS,
PARSE_ONLY_BOOL, false) == 0)
count++;
if (menu_displaylist_parse_settings_enum(list,
MENU_ENUM_LABEL_QUICK_MENU_SHOW_SAVE_CORE_OVERRIDES,
PARSE_ONLY_BOOL, false) == 0)
count++;
if (menu_displaylist_parse_settings_enum(list,
MENU_ENUM_LABEL_QUICK_MENU_SHOW_SAVE_GAME_OVERRIDES,
PARSE_ONLY_BOOL, false) == 0)
count++;
{
menu_displaylist_build_info_t build_list[] = {
{MENU_ENUM_LABEL_CONTENT_SHOW_REWIND, PARSE_ONLY_BOOL},
{MENU_ENUM_LABEL_CONTENT_SHOW_LATENCY, PARSE_ONLY_BOOL},
{MENU_ENUM_LABEL_CONTENT_SHOW_OVERLAYS, PARSE_ONLY_BOOL},
{MENU_ENUM_LABEL_QUICK_MENU_SHOW_SAVE_CORE_OVERRIDES, PARSE_ONLY_BOOL},
{MENU_ENUM_LABEL_QUICK_MENU_SHOW_SAVE_GAME_OVERRIDES, PARSE_ONLY_BOOL},
{MENU_ENUM_LABEL_QUICK_MENU_SHOW_INFORMATION, PARSE_ONLY_BOOL},
};
if (menu_displaylist_parse_settings_enum(list,
MENU_ENUM_LABEL_QUICK_MENU_SHOW_INFORMATION,
PARSE_ONLY_BOOL, false) == 0)
count++;
for (i = 0; i < ARRAY_SIZE(build_list); i++)
{
if (menu_displaylist_parse_settings_enum(list,
build_list[i].enum_idx, build_list[i].parse_type,
false) == 0)
count++;
}
}
break;
case DISPLAYLIST_CORE_SETTINGS_LIST:
{
@ -4304,7 +4291,7 @@ bool menu_displaylist_ctl(enum menu_displaylist_ctl_state type, menu_displaylist
unsigned i;
char text[PATH_MAX_LENGTH];
char current_profile[PATH_MAX_LENGTH];
FILE *profile = NULL;
FILE *profile = NULL;
const size_t profiles_count = sizeof(SWITCH_CPU_PROFILES)/sizeof(SWITCH_CPU_PROFILES[1]);
runloop_msg_queue_push("Warning : extended overclocking can damage the Switch", 1, 90, true, NULL, MESSAGE_QUEUE_ICON_DEFAULT, MESSAGE_QUEUE_CATEGORY_INFO);
@ -4356,7 +4343,7 @@ bool menu_displaylist_ctl(enum menu_displaylist_ctl_state type, menu_displaylist
unsigned i;
char text[PATH_MAX_LENGTH];
char current_profile[PATH_MAX_LENGTH];
FILE *profile = NULL;
FILE *profile = NULL;
const size_t profiles_count = sizeof(SWITCH_GPU_PROFILES)/sizeof(SWITCH_GPU_PROFILES[1]);
runloop_msg_queue_push("Warning : extented overclocking can damage the Switch", 1, 90, true, NULL, MESSAGE_QUEUE_ICON_DEFAULT, MESSAGE_QUEUE_CATEGORY_INFO);
@ -5258,6 +5245,7 @@ bool menu_displaylist_ctl(enum menu_displaylist_ctl_state type, menu_displaylist
case DISPLAYLIST_CONFIGURATIONS_LIST:
case DISPLAYLIST_ONSCREEN_NOTIFICATIONS_SETTINGS_LIST:
case DISPLAYLIST_LATENCY_SETTINGS_LIST:
case DISPLAYLIST_ONSCREEN_OVERLAY_SETTINGS_LIST:
menu_entries_ctl(MENU_ENTRIES_CTL_CLEAR, info->list);
count = menu_displaylist_build_list(info->list, type);
@ -5496,38 +5484,6 @@ bool menu_displaylist_ctl(enum menu_displaylist_ctl_state type, menu_displaylist
info->need_push = true;
break;
}
case DISPLAYLIST_ONSCREEN_OVERLAY_SETTINGS_LIST:
menu_entries_ctl(MENU_ENTRIES_CTL_CLEAR, info->list);
menu_displaylist_parse_settings_enum(info->list,
MENU_ENUM_LABEL_INPUT_OVERLAY_ENABLE,
PARSE_ONLY_BOOL, false);
#if 0
menu_displaylist_parse_settings_enum(info->list,
MENU_ENUM_LABEL_OVERLAY_AUTOLOAD_PREFERRED,
PARSE_ONLY_BOOL, false);
#endif
menu_displaylist_parse_settings_enum(info->list,
MENU_ENUM_LABEL_INPUT_OVERLAY_HIDE_IN_MENU,
PARSE_ONLY_BOOL, false);
menu_displaylist_parse_settings_enum(info->list,
MENU_ENUM_LABEL_INPUT_OVERLAY_SHOW_PHYSICAL_INPUTS,
PARSE_ONLY_BOOL, false);
menu_displaylist_parse_settings_enum(info->list,
MENU_ENUM_LABEL_INPUT_OVERLAY_SHOW_PHYSICAL_INPUTS_PORT,
PARSE_ONLY_UINT, false);
menu_displaylist_parse_settings_enum(info->list,
MENU_ENUM_LABEL_OVERLAY_PRESET,
PARSE_ONLY_PATH, false);
menu_displaylist_parse_settings_enum(info->list,
MENU_ENUM_LABEL_OVERLAY_OPACITY,
PARSE_ONLY_FLOAT, false);
menu_displaylist_parse_settings_enum(info->list,
MENU_ENUM_LABEL_OVERLAY_SCALE,
PARSE_ONLY_FLOAT, false);
info->need_refresh = true;
info->need_push = true;
break;
case DISPLAYLIST_MENU_FILE_BROWSER_SETTINGS_LIST:
menu_entries_ctl(MENU_ENTRIES_CTL_CLEAR, info->list);
menu_displaylist_parse_settings_enum(info->list,