From 16a40af1732395b8b392e5b2d1ce2835f56d6f05 Mon Sep 17 00:00:00 2001 From: twinaphex Date: Thu, 18 Apr 2013 22:22:25 +0200 Subject: [PATCH] (RGUI) Move menu_stack code back into rgui.c --- frontend/menu/menu_common.c | 12 ------------ frontend/menu/rgui.c | 14 +++++++++++++- 2 files changed, 13 insertions(+), 13 deletions(-) diff --git a/frontend/menu/menu_common.c b/frontend/menu/menu_common.c index bf851d4b6d..3e022262ea 100644 --- a/frontend/menu/menu_common.c +++ b/frontend/menu/menu_common.c @@ -392,15 +392,6 @@ void menu_init(void) sizeof(rgui->browser->current_dir.root_dir)); filebrowser_iterate(rgui->browser, FILEBROWSER_ACTION_RESET); -#else - strlcpy(rgui->base_path, g_settings.rgui_browser_directory, sizeof(rgui->base_path)); - - rgui->menu_stack = (rgui_list_t*)calloc(1, sizeof(rgui_list_t)); - rgui->selection_buf = (rgui_list_t*)calloc(1, sizeof(rgui_list_t)); - rgui_list_push(rgui->menu_stack, g_settings.rgui_browser_directory, RGUI_FILE_DIRECTORY, 0); - rgui_list_push(rgui->menu_stack, "", RGUI_SETTINGS, 0); - - rgui_iterate(rgui, RGUI_ACTION_REFRESH); #endif #ifdef HAVE_SHADER_MANAGER @@ -414,9 +405,6 @@ void menu_free(void) #ifdef HAVE_FILEBROWSER filebrowser_free(rgui->browser); -#else - rgui_list_free(rgui->menu_stack); - rgui_list_free(rgui->selection_buf); #endif free(rgui); diff --git a/frontend/menu/rgui.c b/frontend/menu/rgui.c index 4df85591b4..d80d417186 100644 --- a/frontend/menu/rgui.c +++ b/frontend/menu/rgui.c @@ -198,13 +198,22 @@ rgui_handle_t *rgui_init(void) else { RARCH_ERR("no font bmp or bin, abort"); - return NULL; /* TODO - should be refactored - perhaps don't do rarch_fail but instead * exit program */ g_extern.lifecycle_mode_state &= ~((1ULL << MODE_MENU) | (1ULL << MODE_MENU_INGAME) | (1ULL << MODE_GAME)); g_extern.lifecycle_mode_state |= (1ULL << MODE_EXIT); + return NULL; } + strlcpy(rgui->base_path, g_settings.rgui_browser_directory, sizeof(rgui->base_path)); + + rgui->menu_stack = (rgui_list_t*)calloc(1, sizeof(rgui_list_t)); + rgui->selection_buf = (rgui_list_t*)calloc(1, sizeof(rgui_list_t)); + rgui_list_push(rgui->menu_stack, g_settings.rgui_browser_directory, RGUI_FILE_DIRECTORY, 0); + rgui_list_push(rgui->menu_stack, "", RGUI_SETTINGS, 0); + + rgui_iterate(rgui, RGUI_ACTION_REFRESH); + return rgui; } @@ -216,6 +225,9 @@ void rgui_free(rgui_handle_t *rgui) #ifdef HAVE_DYNAMIC libretro_free_system_info(&rgui->info); #endif + + rgui_list_free(rgui->menu_stack); + rgui_list_free(rgui->selection_buf); } static uint16_t gray_filler(unsigned x, unsigned y)