diff --git a/menu/drivers/menu_generic.c b/menu/drivers/menu_generic.c index d078024aef..e43217e488 100644 --- a/menu/drivers/menu_generic.c +++ b/menu/drivers/menu_generic.c @@ -329,10 +329,10 @@ end: return 0; } -int menu_iterate_render(void) +int menu_iterate_render(void *data, void *userdata) { const menu_ctx_driver_t *driver = menu_ctx_driver_get_ptr(); - menu_handle_t *menu = menu_driver_get_ptr(); + menu_handle_t *menu = (menu_handle_t*)data; if (!menu) return -1; @@ -346,7 +346,7 @@ int menu_iterate_render(void) if (BIT64_GET(menu->state, MENU_STATE_RENDER_MESSAGEBOX) && menu->menu_state.msg[0] != '\0') { if (driver->render_messagebox) - driver->render_messagebox(menu->userdata, menu->menu_state.msg); + driver->render_messagebox(userdata, menu->menu_state.msg); if (ui_companion_is_on_foreground()) { @@ -360,7 +360,7 @@ int menu_iterate_render(void) { menu_animation_ctl(MENU_ANIMATION_CTL_UPDATE_TIME, NULL); if (driver->render) - driver->render(menu->userdata); + driver->render(userdata); } if (menu_driver_ctl(RARCH_MENU_CTL_IS_ALIVE, NULL) && !runloop_ctl(RUNLOOP_CTL_IS_IDLE, NULL)) diff --git a/menu/menu_driver.c b/menu/menu_driver.c index 280a69a7ee..d379c60495 100644 --- a/menu/menu_driver.c +++ b/menu/menu_driver.c @@ -452,7 +452,7 @@ bool menu_load_content(enum rarch_core_type type) runloop_ctl(RUNLOOP_CTL_GET_CONTENT_PATH, &fullpath); /* redraw menu frame */ menu_display_ctl(MENU_DISPLAY_CTL_SET_MSG_FORCE, &msg_force); - menu_iterate_render(); + menu_driver_ctl(RARCH_MENU_CTL_RENDER, NULL); if (!(main_load_content(0, NULL, NULL, menu_environment_get))) { @@ -660,6 +660,10 @@ bool menu_driver_ctl(enum rarch_menu_ctl_state state, void *data) menu_driver_data_own = false; menu_driver_ctx = NULL; break; + case RARCH_MENU_CTL_RENDER: + menu_iterate_render(menu_driver_data, + menu_driver_data ? menu_driver_data->userdata : NULL); + break; case RARCH_MENU_CTL_FRAME: if (!menu_driver_alive) return false; diff --git a/menu/menu_driver.h b/menu/menu_driver.h index 9fceaf5586..24d3b228cc 100644 --- a/menu/menu_driver.h +++ b/menu/menu_driver.h @@ -93,6 +93,7 @@ enum rarch_menu_ctl_state { RARCH_MENU_CTL_NONE = 0, RARCH_MENU_CTL_DEINIT, + RARCH_MENU_CTL_RENDER, RARCH_MENU_CTL_FRAME, RARCH_MENU_CTL_SET_PREVENT_POPULATE, RARCH_MENU_CTL_UNSET_PREVENT_POPULATE, @@ -402,7 +403,7 @@ void *menu_init(const void *data); **/ int menu_iterate(bool render_this_frame, enum menu_action action); -int menu_iterate_render(void); +int menu_iterate_render(void *data, void *userdata); /** * menu_free: diff --git a/runloop.c b/runloop.c index 8bba68ec41..1103b29e22 100644 --- a/runloop.c +++ b/runloop.c @@ -1286,7 +1286,7 @@ int runloop_iterate(unsigned *sleep_ms) rarch_ctl(RARCH_CTL_MENU_RUNNING_FINISHED, NULL); if (focused || !is_idle) - menu_iterate_render(); + menu_driver_ctl(RARCH_MENU_CTL_RENDER, NULL); if (!focused || is_idle) {