mirror of
https://github.com/libretro/RetroArch
synced 2025-02-06 09:40:06 +00:00
Create function pointer for iterate function
This commit is contained in:
parent
0acb119f61
commit
6d4900dc1c
@ -836,6 +836,7 @@ static int glui_environ(menu_environ_cb_t type, void *data)
|
||||
menu_ctx_driver_t menu_ctx_glui = {
|
||||
NULL,
|
||||
glui_get_message,
|
||||
generic_menu_iterate,
|
||||
glui_render,
|
||||
glui_frame,
|
||||
glui_init,
|
||||
|
@ -219,7 +219,7 @@ static enum action_iterate_type action_iterate_type(uint32_t hash)
|
||||
*
|
||||
* Returns: 0 on success, -1 if we need to quit out of the loop.
|
||||
**/
|
||||
int menu_iterate(bool render_this_frame, enum menu_action action)
|
||||
int generic_menu_iterate(bool render_this_frame, enum menu_action action)
|
||||
{
|
||||
size_t selection;
|
||||
menu_entry_t entry;
|
||||
|
@ -20,6 +20,10 @@
|
||||
|
||||
#include <boolean.h>
|
||||
|
||||
#include "../menu_input.h"
|
||||
|
||||
int generic_menu_iterate(bool render_this_frame, enum menu_action action);
|
||||
|
||||
bool generic_menu_init_list(void *data);
|
||||
|
||||
#endif
|
||||
|
@ -26,6 +26,7 @@
|
||||
menu_ctx_driver_t menu_ctx_null = {
|
||||
NULL, /* set_texture */
|
||||
NULL, /* render_messagebox */
|
||||
NULL, /* iterate */
|
||||
NULL, /* render */
|
||||
NULL, /* frame */
|
||||
NULL, /* init */
|
||||
|
@ -851,6 +851,7 @@ static int rgui_environ(menu_environ_cb_t type, void *data)
|
||||
|
||||
menu_ctx_driver_t menu_ctx_rgui = {
|
||||
rgui_set_texture,
|
||||
generic_menu_iterate,
|
||||
rgui_set_message,
|
||||
rgui_render,
|
||||
NULL,
|
||||
|
@ -328,6 +328,7 @@ static int rmenu_environ(menu_environ_cb_t type, void *data)
|
||||
menu_ctx_driver_t menu_ctx_rmenu = {
|
||||
rmenu_set_texture,
|
||||
rmenu_render_messagebox,
|
||||
generic_menu_iterate,
|
||||
rmenu_render,
|
||||
NULL,
|
||||
rmenu_init,
|
||||
|
@ -695,6 +695,7 @@ static int rmenu_xui_environ(menu_environ_cb_t type, void *data)
|
||||
menu_ctx_driver_t menu_ctx_rmenu_xui = {
|
||||
NULL,
|
||||
rmenu_xui_render_messagebox,
|
||||
generic_menu_iterate,
|
||||
rmenu_xui_render,
|
||||
rmenu_xui_frame,
|
||||
rmenu_xui_init,
|
||||
|
@ -2547,6 +2547,7 @@ static int xmb_list_bind_init(menu_file_list_cbs_t *cbs,
|
||||
menu_ctx_driver_t menu_ctx_xmb = {
|
||||
NULL,
|
||||
xmb_render_messagebox_internal,
|
||||
generic_menu_iterate,
|
||||
xmb_render,
|
||||
xmb_frame,
|
||||
xmb_init,
|
||||
|
@ -1008,6 +1008,7 @@ static void zarch_context_reset(void)
|
||||
menu_ctx_driver_t menu_ctx_zarch = {
|
||||
NULL,
|
||||
zarch_get_message,
|
||||
generic_menu_iterate,
|
||||
zarch_render,
|
||||
zarch_frame,
|
||||
zarch_init,
|
||||
|
@ -94,8 +94,6 @@ bool menu_load_content(enum rarch_core_type type)
|
||||
|
||||
/* redraw menu frame */
|
||||
menu_display_ctl(MENU_DISPLAY_CTL_SET_MSG_FORCE, &msg_force);
|
||||
|
||||
menu_iterate(true, MENU_ACTION_NOOP);
|
||||
menu_iterate_render();
|
||||
|
||||
if (!(main_load_content(0, NULL, NULL, menu_environment_get,
|
||||
|
@ -331,6 +331,15 @@ bool menu_driver_alive(void)
|
||||
return menu_alive;
|
||||
}
|
||||
|
||||
int menu_driver_iterate(bool render, enum menu_action action)
|
||||
{
|
||||
const menu_ctx_driver_t *driver = menu_ctx_driver_get_ptr();
|
||||
|
||||
if (driver->iterate)
|
||||
return driver->iterate(render, action);
|
||||
return -1;
|
||||
}
|
||||
|
||||
void menu_driver_toggle(bool latch)
|
||||
{
|
||||
driver_t *driver = driver_get_ptr();
|
||||
|
@ -108,6 +108,7 @@ typedef struct menu_ctx_driver
|
||||
{
|
||||
void (*set_texture)(void);
|
||||
void (*render_messagebox)(const char *msg);
|
||||
int (*iterate)(bool render, enum menu_action action);
|
||||
void (*render)(void);
|
||||
void (*frame)(void);
|
||||
void* (*init)(void);
|
||||
@ -218,6 +219,8 @@ size_t menu_driver_list_get_selection(void);
|
||||
|
||||
bool menu_environment_cb(menu_environ_cb_t type, void *data);
|
||||
|
||||
int menu_driver_iterate(bool render, enum menu_action action);
|
||||
|
||||
int menu_driver_bind_init(menu_file_list_cbs_t *cbs,
|
||||
const char *path, const char *label, unsigned type, size_t idx,
|
||||
const char *elem0, const char *elem1,
|
||||
|
@ -978,7 +978,7 @@ int rarch_main_iterate(unsigned *sleep_ms)
|
||||
#ifdef HAVE_MENU
|
||||
if (menu_driver_alive())
|
||||
{
|
||||
if (menu_iterate(true, (enum menu_action)menu_input_frame(input, trigger_input)) == -1)
|
||||
if (menu_driver_iterate(true, (enum menu_action)menu_input_frame(input, trigger_input)) == -1)
|
||||
rarch_ctl(RARCH_ACTION_STATE_MENU_RUNNING_FINISHED, NULL);
|
||||
|
||||
if (!input && settings->menu.pause_libretro)
|
||||
|
Loading…
x
Reference in New Issue
Block a user