mirror of
https://github.com/libretro/RetroArch.git
synced 2025-02-02 15:05:09 +00:00
Pass video_driver_width and video_driver_height
to menu driver render callback function so that we don't have to call video_driver_get_size anymore
This commit is contained in:
parent
3585d56067
commit
022b22a4cd
@ -646,9 +646,11 @@ static void materialui_compute_entries_box(materialui_handle_t* mui, int width)
|
||||
|
||||
/* Called on each frame. We use this callback to implement the touch scroll
|
||||
with acceleration */
|
||||
static void materialui_render(void *data, bool is_idle)
|
||||
static void materialui_render(void *data,
|
||||
unsigned width, unsigned height,
|
||||
bool is_idle)
|
||||
{
|
||||
unsigned bottom, width, height, header_height;
|
||||
unsigned bottom, header_height;
|
||||
size_t i = 0;
|
||||
materialui_handle_t *mui = (materialui_handle_t*)data;
|
||||
settings_t *settings = config_get_ptr();
|
||||
@ -657,8 +659,6 @@ static void materialui_render(void *data, bool is_idle)
|
||||
if (!mui)
|
||||
return;
|
||||
|
||||
video_driver_get_size(&width, &height);
|
||||
|
||||
if (mui->need_compute)
|
||||
{
|
||||
if (mui->font)
|
||||
|
@ -992,7 +992,9 @@ static void ozone_list_free(file_list_t *list, size_t a, size_t b)
|
||||
ozone_list_clear(list);
|
||||
}
|
||||
|
||||
static void ozone_render(void *data, bool is_idle)
|
||||
static void ozone_render(void *data,
|
||||
unsigned width, unsigned height,
|
||||
bool is_idle)
|
||||
{
|
||||
size_t i;
|
||||
unsigned end = (unsigned)menu_entries_get_size();
|
||||
|
@ -3065,7 +3065,9 @@ static void rgui_render_osk(rgui_t *rgui, menu_animation_ctx_ticker_t *ticker)
|
||||
static bool rgui_set_aspect_ratio(rgui_t *rgui, bool delay_update);
|
||||
#endif
|
||||
|
||||
static void rgui_render(void *data, bool is_idle)
|
||||
static void rgui_render(void *data,
|
||||
unsigned width, unsigned height,
|
||||
bool is_idle)
|
||||
{
|
||||
menu_animation_ctx_ticker_t ticker;
|
||||
static const char* const ticker_spacer = RGUI_TICKER_SPACER;
|
||||
|
@ -2655,7 +2655,9 @@ static void stripes_draw_items(
|
||||
menu_display_blend_end(video_info);
|
||||
}
|
||||
|
||||
static void stripes_render(void *data, bool is_idle)
|
||||
static void stripes_render(void *data,
|
||||
unsigned width, unsigned height,
|
||||
bool is_idle)
|
||||
{
|
||||
size_t i;
|
||||
settings_t *settings = config_get_ptr();
|
||||
@ -2674,9 +2676,6 @@ static void stripes_render(void *data, bool is_idle)
|
||||
int16_t mouse_y = menu_input_mouse_state(MENU_MOUSE_Y_AXIS)
|
||||
+ (stripes->cursor_size/2);
|
||||
unsigned first = 0, last = end;
|
||||
unsigned height;
|
||||
|
||||
video_driver_get_size(NULL, &height);
|
||||
|
||||
if (height)
|
||||
stripes_calculate_visible_range(stripes, height,
|
||||
|
@ -3203,7 +3203,8 @@ static void xmb_draw_items(
|
||||
static void xmb_context_reset_internal(xmb_handle_t *xmb,
|
||||
bool is_threaded, bool reinit_textures);
|
||||
|
||||
static void xmb_render(void *data, bool is_idle)
|
||||
static void xmb_render(void *data,
|
||||
unsigned width, unsigned height, bool is_idle)
|
||||
{
|
||||
size_t i;
|
||||
settings_t *settings = config_get_ptr();
|
||||
@ -3212,14 +3213,11 @@ static void xmb_render(void *data, bool is_idle)
|
||||
bool mouse_enable = settings->bools.menu_mouse_enable;
|
||||
bool pointer_enable = settings->bools.menu_pointer_enable;
|
||||
|
||||
unsigned width, height;
|
||||
float scale_factor;
|
||||
|
||||
if (!xmb)
|
||||
if (!xmb)
|
||||
return;
|
||||
|
||||
video_driver_get_size(&width, &height);
|
||||
|
||||
scale_factor = (settings->uints.menu_xmb_scale_factor * (float)width) / (1920.0 * 100);
|
||||
|
||||
if (scale_factor >= 0.1f && scale_factor != xmb->previous_scale_factor)
|
||||
@ -3230,15 +3228,12 @@ static void xmb_render(void *data, bool is_idle)
|
||||
|
||||
if (pointer_enable || mouse_enable)
|
||||
{
|
||||
unsigned height;
|
||||
size_t selection = menu_navigation_get_selection();
|
||||
int16_t pointer_y = menu_input_pointer_state(MENU_POINTER_Y_AXIS);
|
||||
int16_t mouse_y = menu_input_mouse_state(MENU_MOUSE_Y_AXIS)
|
||||
+ (xmb->cursor_size/2);
|
||||
unsigned first = 0, last = end;
|
||||
|
||||
video_driver_get_size(NULL, &height);
|
||||
|
||||
if (height)
|
||||
xmb_calculate_visible_range(xmb, height,
|
||||
end, (unsigned)selection, &first, &last);
|
||||
|
@ -519,7 +519,9 @@ static void xui_set_list_text(int index, const wchar_t* leftText,
|
||||
}
|
||||
}
|
||||
|
||||
static void xui_render(void *data, bool is_idle)
|
||||
static void xui_render(void *data,
|
||||
unsigned width, unsigned height,
|
||||
bool is_idle)
|
||||
{
|
||||
size_t end, i, selection, fb_pitch;
|
||||
unsigned fb_width, fb_height;
|
||||
|
@ -247,7 +247,7 @@ typedef struct menu_ctx_driver
|
||||
/* 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, bool is_idle);
|
||||
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) */
|
||||
void* (*init)(void**, bool);
|
||||
|
@ -23339,7 +23339,10 @@ static enum runloop_state runloop_check_state(void)
|
||||
{
|
||||
if (menu_data->driver_ctx->render)
|
||||
menu_data->driver_ctx->render(
|
||||
menu_data->userdata, runloop_idle);
|
||||
menu_data->userdata,
|
||||
video_driver_width,
|
||||
video_driver_height,
|
||||
runloop_idle);
|
||||
}
|
||||
|
||||
if (menu_driver_alive && !runloop_idle)
|
||||
|
Loading…
x
Reference in New Issue
Block a user