mirror of
https://github.com/libretro/RetroArch
synced 2025-03-02 19:13:34 +00:00
(Menu) Iterate function callback was never used, remove it
- Also turn menu_driver_iterate into static function and redesign code a bit; non-functional
This commit is contained in:
parent
a6c11b5ed3
commit
14248f7401
@ -10349,7 +10349,6 @@ static void materialui_refresh_thumbnail_image(void *userdata, unsigned i)
|
||||
menu_ctx_driver_t menu_ctx_mui = {
|
||||
NULL,
|
||||
materialui_get_message,
|
||||
NULL, /* iterate */
|
||||
materialui_render,
|
||||
materialui_frame,
|
||||
materialui_init,
|
||||
|
@ -4157,7 +4157,6 @@ void ozone_apply_cursor_wiggle_offset(ozone_handle_t* ozone, int* x, size_t* y)
|
||||
menu_ctx_driver_t menu_ctx_ozone = {
|
||||
NULL, /* set_texture */
|
||||
ozone_messagebox,
|
||||
NULL, /* iterate */
|
||||
ozone_render,
|
||||
ozone_frame,
|
||||
ozone_init,
|
||||
|
@ -6374,7 +6374,6 @@ static int rgui_menu_entry_action(
|
||||
menu_ctx_driver_t menu_ctx_rgui = {
|
||||
rgui_set_texture,
|
||||
rgui_set_message,
|
||||
NULL, /* iterate */
|
||||
rgui_render,
|
||||
rgui_frame,
|
||||
rgui_init,
|
||||
|
@ -4390,7 +4390,6 @@ static int stripes_pointer_up(void *userdata,
|
||||
menu_ctx_driver_t menu_ctx_stripes = {
|
||||
NULL,
|
||||
stripes_messagebox,
|
||||
NULL, /* iterate */
|
||||
stripes_render,
|
||||
stripes_frame,
|
||||
stripes_init,
|
||||
|
@ -7104,7 +7104,6 @@ static int xmb_pointer_up(void *userdata,
|
||||
menu_ctx_driver_t menu_ctx_xmb = {
|
||||
NULL,
|
||||
xmb_messagebox,
|
||||
NULL, /* iterate */
|
||||
xmb_render,
|
||||
xmb_frame,
|
||||
xmb_init,
|
||||
|
@ -248,7 +248,6 @@ typedef struct menu_ctx_driver
|
||||
void (*set_texture)(void *data);
|
||||
/* Render a messagebox to the screen. */
|
||||
void (*render_messagebox)(void *data, const char *msg);
|
||||
int (*iterate)(void *data, void *userdata, enum menu_action action);
|
||||
void (*render)(void *data, unsigned width, unsigned height, bool is_idle);
|
||||
void (*frame)(void *data, video_frame_info_t *video_info);
|
||||
/* Initializes the menu driver. (setup) */
|
||||
@ -474,9 +473,6 @@ bool menu_driver_ctl(enum rarch_menu_ctl_state state, void *data);
|
||||
|
||||
void menu_driver_frame(bool menu_is_alive, video_frame_info_t *video_info);
|
||||
|
||||
bool menu_driver_iterate(menu_ctx_iterate_t *iterate,
|
||||
retro_time_t current_time);
|
||||
|
||||
int menu_driver_deferred_push_content_list(file_list_t *list);
|
||||
|
||||
bool menu_driver_list_cache(menu_ctx_list_t *list);
|
||||
|
79
retroarch.c
79
retroarch.c
@ -4339,52 +4339,17 @@ void menu_display_powerstate(gfx_display_ctx_powerstate_t *powerstate)
|
||||
}
|
||||
|
||||
/* Iterate the menu driver for one frame. */
|
||||
bool menu_driver_iterate(menu_ctx_iterate_t *iterate,
|
||||
static bool menu_driver_iterate(
|
||||
struct rarch_state *p_rarch,
|
||||
enum menu_action action,
|
||||
retro_time_t current_time)
|
||||
{
|
||||
struct rarch_state *p_rarch = &rarch_st;
|
||||
struct menu_state *menu_st = &p_rarch->menu_driver_state;
|
||||
|
||||
/* Get current time */
|
||||
menu_st->current_time_us = current_time;
|
||||
|
||||
if (menu_st->pending_quick_menu)
|
||||
{
|
||||
/* If the user had requested that the Quick Menu
|
||||
* be spawned during the previous frame, do this now
|
||||
* and exit the function to go to the next frame.
|
||||
*/
|
||||
|
||||
menu_st->pending_quick_menu = false;
|
||||
menu_entries_flush_stack(NULL, MENU_SETTINGS);
|
||||
gfx_display_set_msg_force(true);
|
||||
|
||||
generic_action_ok_displaylist_push("", NULL,
|
||||
"", 0, 0, 0, ACTION_OK_DL_CONTENT_SETTINGS);
|
||||
|
||||
menu_st->selection_ptr = 0;
|
||||
|
||||
return true;
|
||||
}
|
||||
|
||||
if ( p_rarch->menu_driver_ctx
|
||||
&& p_rarch->menu_driver_ctx->iterate)
|
||||
{
|
||||
if (p_rarch->menu_driver_ctx->iterate(
|
||||
p_rarch->menu_driver_data,
|
||||
p_rarch->menu_userdata, iterate->action) != -1)
|
||||
return true;
|
||||
}
|
||||
else
|
||||
if (p_rarch->menu_driver_data)
|
||||
if (generic_menu_iterate(
|
||||
p_rarch,
|
||||
p_rarch->menu_driver_data,
|
||||
p_rarch->menu_userdata, iterate->action,
|
||||
current_time) != -1)
|
||||
return true;
|
||||
|
||||
return false;
|
||||
return (p_rarch->menu_driver_data &&
|
||||
generic_menu_iterate(
|
||||
p_rarch,
|
||||
p_rarch->menu_driver_data,
|
||||
p_rarch->menu_userdata, action,
|
||||
current_time) != -1);
|
||||
}
|
||||
|
||||
int menu_driver_deferred_push_content_list(file_list_t *list)
|
||||
@ -37305,10 +37270,10 @@ static enum runloop_state runloop_check_state(
|
||||
if (menu_is_alive)
|
||||
{
|
||||
enum menu_action action;
|
||||
menu_ctx_iterate_t iter;
|
||||
static input_bits_t old_input = {{0}};
|
||||
static enum menu_action
|
||||
old_action = MENU_ACTION_CANCEL;
|
||||
struct menu_state *menu_st = &p_rarch->menu_driver_state;
|
||||
bool focused = false;
|
||||
input_bits_t trigger_input = current_bits;
|
||||
global_t *global = &p_rarch->g_extern;
|
||||
@ -37324,8 +37289,6 @@ static enum runloop_state runloop_check_state(
|
||||
focused = focused &&
|
||||
!p_rarch->main_ui_companion_is_on_foreground;
|
||||
|
||||
iter.action = action;
|
||||
|
||||
if (global)
|
||||
{
|
||||
if (action == old_action)
|
||||
@ -37367,7 +37330,27 @@ static enum runloop_state runloop_check_state(
|
||||
}
|
||||
}
|
||||
|
||||
if (!menu_driver_iterate(&iter, current_time))
|
||||
/* Get current time */
|
||||
menu_st->current_time_us = current_time;
|
||||
|
||||
/* Iterate the menu driver for one frame. */
|
||||
|
||||
if (menu_st->pending_quick_menu)
|
||||
{
|
||||
/* If the user had requested that the Quick Menu
|
||||
* be spawned during the previous frame, do this now
|
||||
* and exit the function to go to the next frame.
|
||||
*/
|
||||
menu_entries_flush_stack(NULL, MENU_SETTINGS);
|
||||
gfx_display_set_msg_force(true);
|
||||
|
||||
generic_action_ok_displaylist_push("", NULL,
|
||||
"", 0, 0, 0, ACTION_OK_DL_CONTENT_SETTINGS);
|
||||
|
||||
menu_st->selection_ptr = 0;
|
||||
menu_st->pending_quick_menu = false;
|
||||
}
|
||||
else if (!menu_driver_iterate(p_rarch, action, current_time))
|
||||
{
|
||||
if (p_rarch->rarch_error_on_init)
|
||||
{
|
||||
|
@ -2766,8 +2766,6 @@ static const struct cmd_map map[] = {
|
||||
#endif
|
||||
|
||||
#ifdef HAVE_MENU
|
||||
static int null_menu_iterate(void *data, void *userdata,
|
||||
enum menu_action action) { return 1; }
|
||||
static void *null_menu_init(void **userdata, bool video_is_threaded)
|
||||
{
|
||||
menu_handle_t *menu = (menu_handle_t*)calloc(1, sizeof(*menu));
|
||||
@ -2781,7 +2779,6 @@ static int null_menu_list_bind_init(menu_file_list_cbs_t *cbs,
|
||||
static menu_ctx_driver_t menu_ctx_null = {
|
||||
NULL, /* set_texture */
|
||||
NULL, /* render_messagebox */
|
||||
null_menu_iterate,
|
||||
NULL, /* render */
|
||||
NULL, /* frame */
|
||||
null_menu_init,
|
||||
|
Loading…
x
Reference in New Issue
Block a user