mirror of
https://github.com/libretro/RetroArch.git
synced 2024-11-24 00:20:01 +00:00
move menu_display_get_size to gfx/video_driver.c and rename
it video_driver_get_size
This commit is contained in:
parent
c183f9dd11
commit
d64655c11b
@ -837,3 +837,12 @@ bool video_driver_frame(const void *frame, unsigned width,
|
||||
return true;
|
||||
return false;
|
||||
}
|
||||
|
||||
void video_driver_get_size(unsigned *width, unsigned *height)
|
||||
{
|
||||
global_t *global = global_get_ptr();
|
||||
if (width)
|
||||
*width = global->video_data.width;
|
||||
if (height)
|
||||
*height = global->video_data.height;
|
||||
}
|
||||
|
@ -340,6 +340,8 @@ const char *video_driver_get_ident(void);
|
||||
bool video_driver_set_viewport(unsigned width, unsigned height,
|
||||
bool force_fullscreen, bool allow_rotate);
|
||||
|
||||
void video_driver_get_size(unsigned *width, unsigned *height);
|
||||
|
||||
uint64_t video_driver_get_frame_count(void);
|
||||
|
||||
#ifdef __cplusplus
|
||||
|
@ -65,7 +65,7 @@ static void glui_blit_line(float x, float y,
|
||||
if (!menu)
|
||||
return;
|
||||
|
||||
menu_display_get_size(&width, &height);
|
||||
video_driver_get_size(&width, &height);
|
||||
|
||||
glui = (glui_handle_t*)menu->userdata;
|
||||
|
||||
@ -110,7 +110,7 @@ static void glui_render_quad(gl_t *gl, int x, int y, int w, int h,
|
||||
r, g, b, a,
|
||||
};
|
||||
|
||||
menu_display_get_size(&width, &height);
|
||||
video_driver_get_size(&width, &height);
|
||||
|
||||
glViewport(x, height - y - h, w, h);
|
||||
|
||||
@ -142,7 +142,7 @@ static void glui_draw_scrollbar(gl_t *gl)
|
||||
if (!menu)
|
||||
return;
|
||||
|
||||
menu_display_get_size(&width, &height);
|
||||
video_driver_get_size(&width, &height);
|
||||
|
||||
glui = (glui_handle_t*)menu->userdata;
|
||||
content_height = menu_entries_get_end() * glui->line_height;
|
||||
@ -199,7 +199,7 @@ static void glui_render_messagebox(const char *message)
|
||||
if (list->elems == 0)
|
||||
goto end;
|
||||
|
||||
menu_display_get_size(&width, &height);
|
||||
video_driver_get_size(&width, &height);
|
||||
|
||||
x = width / 2;
|
||||
y = height / 2 - list->size * menu->font.size / 2;
|
||||
@ -228,7 +228,7 @@ static void glui_render(void)
|
||||
if (!menu || !menu->userdata)
|
||||
return;
|
||||
|
||||
menu_display_get_size(&width, &height);
|
||||
video_driver_get_size(&width, &height);
|
||||
|
||||
glui = (glui_handle_t*)menu->userdata;
|
||||
|
||||
@ -286,7 +286,7 @@ static void glui_render_menu_list(runloop_t *runloop,
|
||||
if (!menu_display_update_pending())
|
||||
return;
|
||||
|
||||
menu_display_get_size(&width, &height);
|
||||
video_driver_get_size(&width, &height);
|
||||
|
||||
glui->list_block.carr.coords.vertices = 0;
|
||||
|
||||
@ -354,7 +354,7 @@ static void glui_frame(void)
|
||||
&& !glui->box_message[0])
|
||||
return;
|
||||
|
||||
menu_display_get_size(&width, &height);
|
||||
video_driver_get_size(&width, &height);
|
||||
|
||||
menu_display_set_viewport();
|
||||
|
||||
@ -587,7 +587,7 @@ static float glui_get_scroll(void)
|
||||
if (!menu || !menu->userdata)
|
||||
return 0;
|
||||
|
||||
menu_display_get_size(&width, &height);
|
||||
video_driver_get_size(&width, &height);
|
||||
|
||||
glui = (glui_handle_t*)menu->userdata;
|
||||
half = (height / glui->line_height) / 2;
|
||||
|
@ -273,7 +273,7 @@ static void xmb_draw_icon(gl_t *gl, xmb_handle_t *xmb,
|
||||
if (alpha == 0)
|
||||
return;
|
||||
|
||||
menu_display_get_size(&width, &height);
|
||||
video_driver_get_size(&width, &height);
|
||||
|
||||
if (
|
||||
x < -xmb->icon.size/2 ||
|
||||
@ -320,7 +320,7 @@ static void xmb_draw_icon_predone(gl_t *gl, xmb_handle_t *xmb,
|
||||
if (alpha == 0)
|
||||
return;
|
||||
|
||||
menu_display_get_size(&width, &height);
|
||||
video_driver_get_size(&width, &height);
|
||||
|
||||
if (
|
||||
x < -xmb->icon.size/2 ||
|
||||
@ -368,7 +368,7 @@ static void xmb_draw_text(menu_handle_t *menu,
|
||||
if (a8 == 0)
|
||||
return;
|
||||
|
||||
menu_display_get_size(&width, &height);
|
||||
video_driver_get_size(&width, &height);
|
||||
|
||||
if (x < -xmb->icon.size || x > width + xmb->icon.size
|
||||
|| y < -xmb->icon.size || y > height + xmb->icon.size)
|
||||
@ -414,7 +414,7 @@ static void xmb_frame_messagebox(const char *message)
|
||||
if (!menu)
|
||||
return;
|
||||
|
||||
menu_display_get_size(&width, &height);
|
||||
video_driver_get_size(&width, &height);
|
||||
|
||||
xmb = (xmb_handle_t*)menu->userdata;
|
||||
|
||||
@ -963,7 +963,7 @@ static void xmb_draw_items(xmb_handle_t *xmb, gl_t *gl,
|
||||
if (!list || !list->size)
|
||||
return;
|
||||
|
||||
menu_display_get_size(&width, &height);
|
||||
video_driver_get_size(&width, &height);
|
||||
|
||||
file_list_get_last(stack, NULL, &label, NULL);
|
||||
|
||||
@ -1106,7 +1106,7 @@ static void xmb_draw_cursor(gl_t *gl, xmb_handle_t *xmb, float x, float y)
|
||||
1.0f, 1.0f, 1.0f, xmb->alpha,
|
||||
};
|
||||
|
||||
menu_display_get_size(&width, &height);
|
||||
video_driver_get_size(&width, &height);
|
||||
|
||||
glViewport(x, height - y, xmb->cursor.size, xmb->cursor.size);
|
||||
|
||||
@ -1198,7 +1198,7 @@ static void xmb_frame(void)
|
||||
if (!gl)
|
||||
return;
|
||||
|
||||
menu_display_get_size(&width, &height);
|
||||
video_driver_get_size(&width, &height);
|
||||
|
||||
menu_display_font_bind_block(menu, font_driver, &xmb->raster_block);
|
||||
|
||||
@ -1339,7 +1339,7 @@ static void *xmb_init(void)
|
||||
if (!menu)
|
||||
goto error;
|
||||
|
||||
menu_display_get_size(&width, &height);
|
||||
video_driver_get_size(&width, &height);
|
||||
|
||||
menu->userdata = (xmb_handle_t*)calloc(1, sizeof(xmb_handle_t));
|
||||
|
||||
|
@ -219,19 +219,10 @@ bool menu_display_init_main_font(menu_handle_t *menu,
|
||||
return result;
|
||||
}
|
||||
|
||||
void menu_display_get_size(unsigned *width, unsigned *height)
|
||||
{
|
||||
global_t *global = global_get_ptr();
|
||||
if (width)
|
||||
*width = global->video_data.width;
|
||||
if (height)
|
||||
*height = global->video_data.height;
|
||||
}
|
||||
|
||||
void menu_display_set_viewport(void)
|
||||
{
|
||||
unsigned width, height;
|
||||
menu_display_get_size(&width, &height);
|
||||
video_driver_get_size(&width, &height);
|
||||
|
||||
video_driver_set_viewport(width, height, true, false);
|
||||
}
|
||||
@ -239,7 +230,7 @@ void menu_display_set_viewport(void)
|
||||
void menu_display_unset_viewport(void)
|
||||
{
|
||||
unsigned width, height;
|
||||
menu_display_get_size(&width, &height);
|
||||
video_driver_get_size(&width, &height);
|
||||
|
||||
video_driver_set_viewport(width,
|
||||
height, false, true);
|
||||
|
@ -56,8 +56,6 @@ bool menu_display_init_main_font(menu_handle_t *menu,
|
||||
const char *font_path, float font_size);
|
||||
void menu_display_free_main_font(menu_handle_t *menu);
|
||||
|
||||
void menu_display_get_size(unsigned *width, unsigned *height);
|
||||
|
||||
void menu_display_set_viewport(void);
|
||||
|
||||
void menu_display_unset_viewport(void);
|
||||
|
Loading…
Reference in New Issue
Block a user