From 13b85a3458ba32d9a454017f093a8e1663c85973 Mon Sep 17 00:00:00 2001 From: twinaphex Date: Thu, 4 Sep 2014 03:40:48 +0200 Subject: [PATCH] (Menu) Add MENU_FILE_CORE --- frontend/menu/disp/rgui.c | 19 ++++--------------- frontend/menu/menu_common.h | 1 + frontend/menu/menu_entries.c | 6 +++++- 3 files changed, 10 insertions(+), 16 deletions(-) diff --git a/frontend/menu/disp/rgui.c b/frontend/menu/disp/rgui.c index 1be4751b0e..8a12f34df9 100644 --- a/frontend/menu/disp/rgui.c +++ b/frontend/menu/disp/rgui.c @@ -400,22 +400,11 @@ static void rgui_render(void) } else #endif - /* Pretty-print libretro cores from menu. */ - if (!strcmp(label, "core_list") || - !strcmp(label, "deferred_core_list")) + if (type == MENU_FILE_CORE) { - if (type == MENU_FILE_PLAIN) - { - strlcpy(type_str, "(CORE)", sizeof(type_str)); - file_list_get_alt_at_offset(driver.menu->selection_buf, i, &path); - w = 6; - } - else - { - strlcpy(type_str, "(DIR)", sizeof(type_str)); - type = MENU_FILE_DIRECTORY; - w = 5; - } + strlcpy(type_str, "(CORE)", sizeof(type_str)); + file_list_get_alt_at_offset(driver.menu->selection_buf, i, &path); + w = 6; } else if (type == MENU_FILE_PLAIN) { diff --git a/frontend/menu/menu_common.h b/frontend/menu/menu_common.h index 0042023207..c83a652625 100644 --- a/frontend/menu/menu_common.h +++ b/frontend/menu/menu_common.h @@ -59,6 +59,7 @@ typedef enum MENU_FILE_PLAIN = 1, MENU_FILE_DIRECTORY, MENU_FILE_DEVICE, + MENU_FILE_CORE, MENU_FILE_PLAYLIST_ENTRY, MENU_FILE_USE_DIRECTORY, MENU_FILE_SWITCH, diff --git a/frontend/menu/menu_entries.c b/frontend/menu/menu_entries.c index 0f28991273..9e2542936f 100644 --- a/frontend/menu/menu_entries.c +++ b/frontend/menu/menu_entries.c @@ -279,7 +279,7 @@ int menu_entries_push_list(menu_handle_t *menu, for (i = 0; i < list_size; i++) { file_list_push(list, info[i].path, "", - MENU_FILE_PLAIN, 0); + MENU_FILE_CORE, 0); file_list_set_alt_at_offset(list, i, info[i].display_name); } @@ -760,6 +760,10 @@ int menu_parse_and_resolve(file_list_t *list, file_list_t *menu_list) /* Push menu_type further down in the chain. * Needed for shader manager currently. */ + if (!strcmp(label, "core_list")) + file_list_push(list, path, "", + is_dir ? MENU_FILE_DIRECTORY : MENU_FILE_CORE, 0); + else file_list_push(list, path, "", is_dir ? MENU_FILE_DIRECTORY : MENU_FILE_PLAIN, 0); }