From 395dc79f6c3ebbe7a316664db35d4013daea85b4 Mon Sep 17 00:00:00 2001 From: twinaphex Date: Thu, 16 Oct 2014 04:25:38 +0200 Subject: [PATCH] Simplify menu_common_type_is --- frontend/menu/backend/menu_common_backend.c | 2 +- frontend/menu/menu_common.c | 18 ------------------ frontend/menu/menu_entries.c | 7 +++++-- frontend/menu/menu_entries_cbs.c | 9 +++++---- 4 files changed, 11 insertions(+), 25 deletions(-) diff --git a/frontend/menu/backend/menu_common_backend.c b/frontend/menu/backend/menu_common_backend.c index 552880e95f..9a7faf3eaa 100644 --- a/frontend/menu/backend/menu_common_backend.c +++ b/frontend/menu/backend/menu_common_backend.c @@ -545,7 +545,7 @@ static int menu_common_iterate(unsigned action) return menu_load_or_open_zip_iterate(action); else if (!strcmp(label, "info_screen")) return menu_info_screen_iterate(action); - else if (menu_common_type_is(label, type) == MENU_SETTINGS) + else if (type == MENU_SETTINGS || type == MENU_FILE_CATEGORY) return menu_settings_iterate(action, cbs); else if ( type == MENU_SETTINGS_CUSTOM_VIEWPORT || diff --git a/frontend/menu/menu_common.c b/frontend/menu/menu_common.c index 2328d03f99..52d91ade02 100644 --- a/frontend/menu/menu_common.c +++ b/frontend/menu/menu_common.c @@ -440,24 +440,6 @@ int menu_iterate(retro_input_t input, unsigned menu_common_type_is(const char *label, unsigned type) { - if ( - type == MENU_SETTINGS || - type == MENU_FILE_CATEGORY || - !strcmp(label, "Shader Options") || - !strcmp(label, "Input Options") || - !strcmp(label, "core_options") || - !strcmp(label, "core_information") || - !strcmp(label, "video_shader_parameters") || - !strcmp(label, "video_shader_preset_parameters") || - !strcmp(label, "disk_options") || - !strcmp(label, "settings") || - !strcmp(label, "performance_counters") || - !strcmp(label, "frontend_counters") || - !strcmp(label, "core_counters") - ) - return MENU_SETTINGS; - - if ( !strcmp(label, "rgui_browser_directory") || !strcmp(label, "content_directory") || diff --git a/frontend/menu/menu_entries.c b/frontend/menu/menu_entries.c index c834510995..c6636a23de 100644 --- a/frontend/menu/menu_entries.c +++ b/frontend/menu/menu_entries.c @@ -109,14 +109,17 @@ int setting_set_flags(rarch_setting_t *setting) { if (setting->flags & SD_FLAG_ALLOW_INPUT) return MENU_FILE_LINEFEED; + if ( + setting->flags & SD_FLAG_IS_CATEGORY || + setting->type == ST_GROUP || + setting->type == ST_SUB_GROUP) + return MENU_FILE_CATEGORY; if (setting->flags & SD_FLAG_PUSH_ACTION) return MENU_FILE_SWITCH; if (setting->flags & SD_FLAG_IS_DRIVER) return MENU_FILE_DRIVER; if (setting->type == ST_PATH) return MENU_FILE_PATH; - if (setting->flags & SD_FLAG_IS_CATEGORY) - return MENU_FILE_CATEGORY; return 0; } diff --git a/frontend/menu/menu_entries_cbs.c b/frontend/menu/menu_entries_cbs.c index 8cf16fd996..c3648b4ad9 100644 --- a/frontend/menu/menu_entries_cbs.c +++ b/frontend/menu/menu_entries_cbs.c @@ -1826,9 +1826,9 @@ static int deferred_push_shader_options(void *data, void *userdata, file_list_push(list, "Shader Preset Save As", "video_shader_preset_save_as", MENU_FILE_LINEFEED_SWITCH, 0); file_list_push(list, "Parameters (Current)", - "video_shader_parameters", MENU_FILE_SWITCH, 0); + "video_shader_parameters", MENU_FILE_CATEGORY, 0); file_list_push(list, "Parameters (Menu)", - "video_shader_preset_parameters", MENU_FILE_SWITCH, 0); + "video_shader_preset_parameters", MENU_FILE_CATEGORY, 0); file_list_push(list, "Shader Passes", "video_shader_num_passes", 0, 0); @@ -2433,10 +2433,11 @@ static void menu_entries_cbs_init_bind_deferred_push(menu_file_list_cbs_t *cbs, cbs->action_deferred_push = deferred_push_default; + if (type == MENU_FILE_CATEGORY) + cbs->action_deferred_push = deferred_push_category; + if (!strcmp(label, "history_list")) cbs->action_deferred_push = deferred_push_history_list; - else if (type == MENU_FILE_CATEGORY) - cbs->action_deferred_push = deferred_push_category; else if (!strcmp(label, "deferred_core_list")) cbs->action_deferred_push = deferred_push_core_list_deferred; else if (!strcmp(label, "Input Options"))