diff --git a/menu/menu_displaylist.c b/menu/menu_displaylist.c index 18609a08cc..dfdc50c52c 100644 --- a/menu/menu_displaylist.c +++ b/menu/menu_displaylist.c @@ -580,3 +580,28 @@ int menu_displaylist_push(file_list_t *list, file_list_t *menu_list) return ret; } + +/** + * menu_displaylist_init: + * @menu : Menu handle. + * + * Creates and initializes menu display list. + * + * Returns: true (1) if successful, otherwise false (0). + **/ +bool menu_displaylist_init(menu_handle_t *menu) +{ + menu_list_t *menu_list = menu_list_get_ptr(); + menu_displaylist_info_t info = {0}; + if (!menu || !menu_list) + return false; + + info.list = menu_list->selection_buf; + info.type = MENU_SETTINGS; + info.flags = SL_FLAG_MAIN_MENU; + strlcpy(info.label, "Main Menu", sizeof(info.label)); + + menu_displaylist_push_list(&info, DISPLAYLIST_MAIN_MENU); + + return true; +} diff --git a/menu/menu_displaylist.h b/menu/menu_displaylist.h index 5dfbc3160a..0f6908b58e 100644 --- a/menu/menu_displaylist.h +++ b/menu/menu_displaylist.h @@ -18,6 +18,7 @@ #include #include +#include "menu.h" #include "menu_list.h" #include "menu_setting.h" @@ -72,6 +73,16 @@ int menu_displaylist_push_list(menu_displaylist_info_t *info, unsigned type); int menu_displaylist_push(file_list_t *list, file_list_t *menu_list); +/** + * menu_displaylist_init: + * @menu : Menu handle. + * + * Creates and initializes menu display list. + * + * Returns: true (1) if successful, otherwise false (0). + **/ +bool menu_displaylist_init(menu_handle_t *menu); + #ifdef __cplusplus } #endif diff --git a/menu/menu_driver.c b/menu/menu_driver.c index c4fc21e630..ea51a7d448 100644 --- a/menu/menu_driver.c +++ b/menu/menu_driver.c @@ -18,7 +18,7 @@ #include #include "menu_driver.h" #include "menu.h" -#include "menu_entries.h" +#include "menu_displaylist.h" #include "../driver.h" #include "../general.h" @@ -156,9 +156,9 @@ void init_menu(void) rarch_fail(1, "init_menu()"); } - if (!(menu_entries_init(driver->menu))) + if (!(menu_displaylist_init(driver->menu))) { - RARCH_ERR("Cannot initialize menu lists.\n"); + RARCH_ERR("Cannot initialize menu display list.\n"); rarch_fail(1, "init_menu()"); } } diff --git a/menu/menu_entries.c b/menu/menu_entries.c index a924e33c63..f8279f0e98 100644 --- a/menu/menu_entries.c +++ b/menu/menu_entries.c @@ -18,10 +18,6 @@ #include "menu_entries.h" #include "menu_setting.h" #include "menu_navigation.h" -#include -#include -#include -#include int menu_entries_setting_set_flags(rarch_setting_t *setting) { @@ -47,28 +43,3 @@ int menu_entries_setting_set_flags(rarch_setting_t *setting) return 0; } - -/** - * menu_entries_init: - * @menu : Menu handle. - * - * Creates and initializes menu entries. - * - * Returns: true (1) if successful, otherwise false (0). - **/ -bool menu_entries_init(menu_handle_t *menu) -{ - menu_list_t *menu_list = menu_list_get_ptr(); - menu_displaylist_info_t info = {0}; - if (!menu || !menu_list) - return false; - - info.list = menu_list->selection_buf; - info.type = MENU_SETTINGS; - info.flags = SL_FLAG_MAIN_MENU; - strlcpy(info.label, "Main Menu", sizeof(info.label)); - - menu_displaylist_push_list(&info, DISPLAYLIST_MAIN_MENU); - - return true; -} diff --git a/menu/menu_entries.h b/menu/menu_entries.h index 5a59292c67..5ca7b185b6 100644 --- a/menu/menu_entries.h +++ b/menu/menu_entries.h @@ -33,16 +33,6 @@ void menu_entries_cbs_init_bind_toggle(menu_file_list_cbs_t *cbs, const char *path, const char *label, unsigned type, size_t idx, const char *elem0, const char *elem1, const char *menu_label); -/** - * menu_entries_init: - * @menu : Menu handle. - * - * Creates and initializes menu entries. - * - * Returns: true (1) if successful, otherwise false (0). - **/ -bool menu_entries_init(menu_handle_t *menu); - int menu_entries_setting_set_flags(rarch_setting_t *setting); #ifdef __cplusplus