Create more menu driver wrapper functions

This commit is contained in:
twinaphex 2015-03-22 05:32:43 +01:00
parent a760d25384
commit e8060a2423
3 changed files with 27 additions and 6 deletions

View File

@ -155,8 +155,7 @@ bool menu_load_content(void)
if (driver->menu)
driver->menu->msg_force = true;
if (driver->menu_ctx && driver->menu_ctx->entry_iterate)
driver->menu_ctx->entry_iterate(MENU_ACTION_NOOP);
menu_driver_entry_iterate(MENU_ACTION_NOOP);
draw_frame();
@ -294,8 +293,7 @@ void menu_free(void *data)
menu->shader = NULL;
#endif
if (driver->menu_ctx && driver->menu_ctx->free)
driver->menu_ctx->free(menu);
menu_driver_free(menu);
#ifdef HAVE_LIBRETRODB
menu_database_free(menu);
@ -426,8 +424,7 @@ int menu_iterate(retro_input_t input,
last_clock_update = menu->cur_time;
}
if (driver->menu_ctx && driver->menu_ctx->entry_iterate)
ret = driver->menu_ctx->entry_iterate(action);
menu_driver_entry_iterate(action);
if (runloop->is_menu && !runloop->is_idle)
draw_frame();

View File

@ -255,3 +255,23 @@ void menu_driver_frame(void)
if (driver->menu_ctx && driver->menu_ctx->frame)
driver->menu_ctx->frame();
}
void menu_driver_entry_iterate(unsigned action)
{
driver_t *driver = driver_get_ptr();
if (!driver)
return;
if (driver->menu_ctx && driver->menu_ctx->entry_iterate)
driver->menu_ctx->entry_iterate(action);
}
void menu_driver_free(menu_handle_t *menu)
{
driver_t *driver = driver_get_ptr();
if (!driver)
return;
if (driver->menu_ctx && driver->menu_ctx->free)
driver->menu_ctx->free(menu);
}

View File

@ -304,6 +304,10 @@ void menu_driver_frame(void);
void menu_driver_context_reset(void);
void menu_driver_entry_iterate(unsigned action);
void menu_driver_free(menu_handle_t *menu);
#ifdef __cplusplus
}
#endif