From c61e552f08de2e776bd27d336f0182c3aa11072b Mon Sep 17 00:00:00 2001 From: twinaphex Date: Thu, 4 Sep 2014 05:27:47 +0200 Subject: [PATCH] (Menu) Get rid of performance counters enums --- frontend/menu/backend/menu_common_backend.c | 2 -- frontend/menu/disp/shared.h | 6 ++--- frontend/menu/menu_common.c | 4 +-- frontend/menu/menu_common.h | 2 -- frontend/menu/menu_entries.c | 30 +++++++++++---------- 5 files changed, 21 insertions(+), 23 deletions(-) diff --git a/frontend/menu/backend/menu_common_backend.c b/frontend/menu/backend/menu_common_backend.c index e853eeceaa..c5c54ee73e 100644 --- a/frontend/menu/backend/menu_common_backend.c +++ b/frontend/menu/backend/menu_common_backend.c @@ -2339,8 +2339,6 @@ static void menu_common_setting_set_label(char *type_str, case MENU_SETTINGS_SHADER_PRESET: case MENU_SETTINGS_SHADER_PRESET_SAVE: case MENU_SETTINGS_DISK_APPEND: - case MENU_SETTINGS_PERFORMANCE_COUNTERS_FRONTEND: - case MENU_SETTINGS_PERFORMANCE_COUNTERS_LIBRETRO: case MENU_SETTINGS_CUSTOM_BIND_ALL: case MENU_SETTINGS_CUSTOM_BIND_DEFAULT_ALL: strlcpy(type_str, "...", type_str_size); diff --git a/frontend/menu/disp/shared.h b/frontend/menu/disp/shared.h index 8d430a17f0..119a5c4968 100644 --- a/frontend/menu/disp/shared.h +++ b/frontend/menu/disp/shared.h @@ -33,10 +33,10 @@ static void get_title(const char *label, const char *dir, strlcpy(title, "DRIVER OPTIONS", sizeof_title); else if (!strcmp(label, "performance_counters")) strlcpy(title, "PERFORMANCE COUNTERS", sizeof_title); - else if (menu_type == MENU_SETTINGS_PERFORMANCE_COUNTERS_LIBRETRO) - strlcpy(title, "CORE PERFORMANCE COUNTERS", sizeof_title); - else if (menu_type == MENU_SETTINGS_PERFORMANCE_COUNTERS_FRONTEND) + else if (!strcmp(label, "frontend_counters")) strlcpy(title, "FRONTEND PERFORMANCE COUNTERS", sizeof_title); + else if (!strcmp(label, "core_counters")) + strlcpy(title, "CORE PERFORMANCE COUNTERS", sizeof_title); #ifdef HAVE_SHADER_MANAGER else if (menu_type == MENU_SETTINGS_SHADER_OPTIONS) strlcpy(title, "SHADER OPTIONS", sizeof_title); diff --git a/frontend/menu/menu_common.c b/frontend/menu/menu_common.c index d99446feff..a329346b70 100644 --- a/frontend/menu/menu_common.c +++ b/frontend/menu/menu_common.c @@ -662,8 +662,8 @@ unsigned menu_common_type_is(const char *label, unsigned type) type == MENU_SETTINGS_OPTIONS || type == MENU_SETTINGS_DRIVERS || !strcmp(label, "performance_counters") || - type == MENU_SETTINGS_PERFORMANCE_COUNTERS_LIBRETRO || - type == MENU_SETTINGS_PERFORMANCE_COUNTERS_FRONTEND || + !strcmp(label, "frontend_counters") || + !strcmp(label, "core_counters") || type == MENU_SETTINGS_INPUT_OPTIONS ) return MENU_SETTINGS; diff --git a/frontend/menu/menu_common.h b/frontend/menu/menu_common.h index c83a652625..435316d378 100644 --- a/frontend/menu/menu_common.h +++ b/frontend/menu/menu_common.h @@ -115,8 +115,6 @@ typedef enum MENU_SETTINGS_PRIVACY_OPTIONS, MENU_SETTINGS_OPTIONS, MENU_SETTINGS_DRIVERS, - MENU_SETTINGS_PERFORMANCE_COUNTERS_LIBRETRO, - MENU_SETTINGS_PERFORMANCE_COUNTERS_FRONTEND, MENU_SETTINGS_DISK_OPTIONS, MENU_SETTINGS_DISK_INDEX, MENU_SETTINGS_DISK_APPEND, diff --git a/frontend/menu/menu_entries.c b/frontend/menu/menu_entries.c index b4aa4be601..c9e46acf99 100644 --- a/frontend/menu/menu_entries.c +++ b/frontend/menu/menu_entries.c @@ -178,10 +178,10 @@ int menu_entries_push_list(menu_handle_t *menu, else if (!strcmp(label, "performance_counters")) { file_list_clear(list); - file_list_push(list, "Frontend Counters", "", - MENU_SETTINGS_PERFORMANCE_COUNTERS_FRONTEND, 0); - file_list_push(list, "Core Counters", "", - MENU_SETTINGS_PERFORMANCE_COUNTERS_LIBRETRO, 0); + file_list_push(list, "Frontend Counters", "frontend_counters", + MENU_FILE_SWITCH, 0); + file_list_push(list, "Core Counters", "core_counters", + MENU_FILE_SWITCH, 0); } else if (!strcmp(label, "core_information")) { @@ -303,6 +303,18 @@ int menu_entries_push_list(menu_handle_t *menu, add_setting_entry(menu,list,"netplay_tcp_udp_port", 0, setting_data); add_setting_entry(menu,list,"netplay_delay_frames", 0, setting_data); } + else if (!strcmp(label, "core_counters")) + { + file_list_clear(list); + menu_entries_push_perfcounter(menu, list, perf_counters_libretro, + perf_ptr_libretro, MENU_SETTINGS_LIBRETRO_PERF_COUNTERS_BEGIN); + } + else if (!strcmp(label, "frontend_counters")) + { + file_list_clear(list); + menu_entries_push_perfcounter(menu, list, perf_counters_rarch, + perf_ptr_rarch, MENU_SETTINGS_PERF_COUNTERS_BEGIN); + } else { switch (menu_type) @@ -529,16 +541,6 @@ int menu_entries_push_list(menu_handle_t *menu, add_setting_entry(menu,list,"location_driver", 0, setting_data); add_setting_entry(menu,list,"menu_driver", 0, setting_data); break; - case MENU_SETTINGS_PERFORMANCE_COUNTERS_LIBRETRO: - file_list_clear(list); - menu_entries_push_perfcounter(menu, list, perf_counters_libretro, - perf_ptr_libretro, MENU_SETTINGS_LIBRETRO_PERF_COUNTERS_BEGIN); - break; - case MENU_SETTINGS_PERFORMANCE_COUNTERS_FRONTEND: - file_list_clear(list); - menu_entries_push_perfcounter(menu, list, perf_counters_rarch, - perf_ptr_rarch, MENU_SETTINGS_PERF_COUNTERS_BEGIN); - break; } }