mirror of
https://github.com/libretro/RetroArch
synced 2025-03-29 22:20:21 +00:00
Pass userdata pointer to render callback
This commit is contained in:
parent
2930997c25
commit
f4695c7547
@ -401,12 +401,12 @@ end:
|
||||
string_list_free(list);
|
||||
}
|
||||
|
||||
static void mui_render(void)
|
||||
static void mui_render(void *data)
|
||||
{
|
||||
float delta_time, dt;
|
||||
unsigned bottom, width, height, header_height;
|
||||
menu_handle_t *menu = menu_driver_get_ptr();
|
||||
mui_handle_t *mui = menu ? (mui_handle_t*)menu->userdata : NULL;
|
||||
mui_handle_t *mui = (mui_handle_t*)data;
|
||||
settings_t *settings = config_get_ptr();
|
||||
|
||||
if (!mui)
|
||||
|
@ -360,7 +360,7 @@ int menu_iterate_render(void)
|
||||
{
|
||||
menu_animation_ctl(MENU_ANIMATION_CTL_UPDATE_TIME, NULL);
|
||||
if (driver->render)
|
||||
driver->render();
|
||||
driver->render(menu->userdata);
|
||||
}
|
||||
|
||||
if (menu_driver_ctl(RARCH_MENU_CTL_IS_ALIVE, NULL) && !runloop_ctl(RUNLOOP_CTL_IS_IDLE, NULL))
|
||||
|
@ -405,7 +405,7 @@ static void rgui_blit_cursor(void)
|
||||
color_rect(fb_data, fb_pitch, fb_width, fb_height, x - 5, y, 11, 1, 0xFFFF);
|
||||
}
|
||||
|
||||
static void rgui_render(void)
|
||||
static void rgui_render(void *data)
|
||||
{
|
||||
unsigned x, y;
|
||||
bool display_kb, msg_force;
|
||||
@ -417,9 +417,9 @@ static void rgui_render(void)
|
||||
char title[256], title_buf[256], title_msg[64];
|
||||
char msg[PATH_MAX_LENGTH], timedate[PATH_MAX_LENGTH];
|
||||
uint16_t *fb_data = NULL;
|
||||
rgui_t *rgui = NULL;
|
||||
menu_handle_t *menu = menu_driver_get_ptr();
|
||||
settings_t *settings = config_get_ptr();
|
||||
rgui_t *rgui = (rgui_t*)data;
|
||||
|
||||
video_driver_ctl(RARCH_DISPLAY_CTL_GET_FRAME_COUNT, &frame_count);
|
||||
|
||||
@ -429,11 +429,9 @@ static void rgui_render(void)
|
||||
title_msg[0] = '\0';
|
||||
timedate[0] = '\0';
|
||||
|
||||
if (!menu || !menu->userdata)
|
||||
if (!menu || !rgui)
|
||||
return;
|
||||
|
||||
rgui = (rgui_t*)menu->userdata;
|
||||
|
||||
if (!rgui->force_redraw)
|
||||
{
|
||||
menu_display_ctl(MENU_DISPLAY_CTL_MSG_FORCE, &msg_force);
|
||||
|
@ -115,7 +115,7 @@ end:
|
||||
string_list_free(list);
|
||||
}
|
||||
|
||||
static void rmenu_render(void)
|
||||
static void rmenu_render(void *data)
|
||||
{
|
||||
bool msg_force;
|
||||
uint64_t *frame_count;
|
||||
|
@ -528,7 +528,7 @@ static void rmenu_xui_set_list_text(int index, const wchar_t* leftText,
|
||||
}
|
||||
}
|
||||
|
||||
static void rmenu_xui_render(void)
|
||||
static void rmenu_xui_render(void *data)
|
||||
{
|
||||
uint64_t *frame_count;
|
||||
bool display_kb, msg_force;
|
||||
|
@ -1561,19 +1561,13 @@ static void xmb_draw_cursor(xmb_handle_t *xmb,
|
||||
menu_display_blend_end();
|
||||
}
|
||||
|
||||
static void xmb_render(void)
|
||||
static void xmb_render(void *data)
|
||||
{
|
||||
float delta_time, dt;
|
||||
size_t selection;
|
||||
unsigned i, end, height = 0;
|
||||
xmb_handle_t *xmb = NULL;
|
||||
unsigned i, end, height = 0;
|
||||
settings_t *settings = config_get_ptr();
|
||||
menu_handle_t *menu = menu_driver_get_ptr();
|
||||
|
||||
if (!menu)
|
||||
return;
|
||||
|
||||
xmb = (xmb_handle_t*)menu->userdata;
|
||||
xmb_handle_t *xmb = (xmb_handle_t*)data;
|
||||
|
||||
if (!xmb)
|
||||
return;
|
||||
|
@ -886,25 +886,6 @@ static void zarch_zui_draw_cursor(float x, float y)
|
||||
{
|
||||
}
|
||||
|
||||
static void zarch_render(void)
|
||||
{
|
||||
int bottom;
|
||||
unsigned width, height;
|
||||
zui_t *zarch = NULL;
|
||||
menu_handle_t *menu = menu_driver_get_ptr();
|
||||
settings_t *settings = config_get_ptr();
|
||||
|
||||
if (!menu || !menu->userdata)
|
||||
return;
|
||||
|
||||
(void)settings;
|
||||
(void)bottom;
|
||||
(void)zarch;
|
||||
|
||||
video_driver_get_size(&width, &height);
|
||||
|
||||
}
|
||||
|
||||
static int zarch_zui_render_pick_core(zui_t *zui)
|
||||
{
|
||||
static zui_tabbed_t tabbed = {~0U};
|
||||
@ -1324,7 +1305,7 @@ menu_ctx_driver_t menu_ctx_zarch = {
|
||||
NULL,
|
||||
NULL,
|
||||
zarch_iterate,
|
||||
zarch_render,
|
||||
NULL,
|
||||
zarch_frame,
|
||||
zarch_init,
|
||||
zarch_free,
|
||||
|
@ -253,7 +253,7 @@ typedef struct menu_ctx_driver
|
||||
void (*set_texture)(void);
|
||||
void (*render_messagebox)(void *data, const char *msg);
|
||||
int (*iterate)(enum menu_action action);
|
||||
void (*render)(void);
|
||||
void (*render)(void *data);
|
||||
void (*frame)(void);
|
||||
void* (*init)(void);
|
||||
void (*free)(void*);
|
||||
|
Loading…
x
Reference in New Issue
Block a user