(Console) Should bring up menu context in case it fails the first time

This commit is contained in:
twinaphex 2014-05-27 19:21:44 +02:00
parent 8fc357647d
commit 1416e47195
3 changed files with 25 additions and 10 deletions

View File

@ -76,7 +76,7 @@ void find_next_menu_driver(void)
RARCH_WARN("Couldn't find any next menu driver (current one: \"%s\").\n", g_settings.menu.driver);
}
static void find_menu_driver(void)
void find_menu_driver(void)
{
int i = find_menu_driver_index(g_settings.menu.driver);
if (i >= 0)

View File

@ -373,9 +373,21 @@ returntype main_entry(signature())
if (!driver.menu)
{
RARCH_ERR("Couldn't initialize menu, exiting...\n");
RARCH_ERR("Couldn't initialize menu.\n");
if (!driver.menu_ctx)
{
RARCH_WARN("Trying to bring up menu context interface.\n");
find_menu_driver();
}
if (!(driver.menu = (rgui_handle_t*)menu_init()))
{
RARCH_ERR("Couldn't initialize menu (2nd attempt).\n");
rarch_fail(1, "main_entry()");
returnfunc();
}
}
if (driver.frontend_ctx && driver.frontend_ctx->process_args)
driver.frontend_ctx->process_args(argc, argv, args);

View File

@ -316,16 +316,19 @@ void *menu_init(void)
{
rgui_handle_t *rgui;
if (!driver.menu_ctx)
return NULL;
rgui = NULL;
if (!driver.menu_ctx)
{
RARCH_ERR("menu_init() - menu context interface not initialized.\n");
return NULL;
}
if (driver.menu_ctx->init)
rgui = (rgui_handle_t*)driver.menu_ctx->init();
if (!rgui)
{
RARCH_ERR("Could not initialize menu.\n");
rarch_fail(1, "menu_init()");
}
return NULL;
strlcpy(g_settings.menu.driver, driver.menu_ctx->ident, sizeof(g_settings.menu.driver));