From 54a9910c0de96bf655ce3ea5aeb11cb819831336 Mon Sep 17 00:00:00 2001 From: twinaphex Date: Sun, 6 Sep 2015 20:53:52 +0200 Subject: [PATCH] Simplify menu_video_frame_background --- menu/drivers/glui.c | 3 ++- menu/drivers/xmb.c | 6 ++++-- menu/menu_video.c | 24 ++++-------------------- menu/menu_video.h | 4 +++- 4 files changed, 13 insertions(+), 24 deletions(-) diff --git a/menu/drivers/glui.c b/menu/drivers/glui.c index 396be0ba94..d1a1451255 100644 --- a/menu/drivers/glui.c +++ b/menu/drivers/glui.c @@ -404,7 +404,8 @@ static void glui_frame(void) } } menu_video_frame_background(menu, settings, - gl, glui->textures.bg.id, 0.75f, false, &coord_color[0]); + gl, glui->textures.bg.id, 0.75f, false, &coord_color[0], + &glui_vertexes[0], &glui_tex_coords[0]); menu_entries_get_title(title, sizeof(title)); diff --git a/menu/drivers/xmb.c b/menu/drivers/xmb.c index bf4703a763..a609dc41cf 100644 --- a/menu/drivers/xmb.c +++ b/menu/drivers/xmb.c @@ -1620,7 +1620,8 @@ static void xmb_frame(void) } menu_video_frame_background(menu, settings, - gl, xmb->textures.bg.id, xmb->alpha, false, &coord_color[0]); + gl, xmb->textures.bg.id, xmb->alpha, false, &coord_color[0], + &rmb_vertex[0], &rmb_tex_coord[0]); xmb_draw_text(menu, xmb, xmb->title_name, xmb->margins.title.left, @@ -1703,7 +1704,8 @@ static void xmb_frame(void) if (render_background) { menu_video_frame_background(menu, settings, gl, - xmb->textures.bg.id, xmb->alpha, true, &coord_color[0]); + xmb->textures.bg.id, xmb->alpha, true, &coord_color[0], + &rmb_vertex[0], &rmb_tex_coord[0]); xmb_frame_messagebox(msg); } diff --git a/menu/menu_video.c b/menu/menu_video.c index bb1af82bf9..52a9fe9c69 100644 --- a/menu/menu_video.c +++ b/menu/menu_video.c @@ -56,32 +56,16 @@ void menu_video_frame_background( GLuint texture, float handle_alpha, bool force_transparency, - GRfloat *coord_color) + GRfloat *coord_color, + const GRfloat *vertex, + const GRfloat *tex_coord) { struct gfx_coords coords; unsigned width, height; - GRfloat color[16], vertex[8], tex_coord[8]; + GRfloat color[16]; global_t *global = global_get_ptr(); - vertex[0] = 0; - vertex[1] = 0; - vertex[2] = 1; - vertex[3] = 0; - vertex[4] = 0; - vertex[5] = 1; - vertex[6] = 1; - vertex[7] = 1; - - tex_coord[0] = 0; - tex_coord[1] = 1; - tex_coord[2] = 1; - tex_coord[3] = 1; - tex_coord[4] = 0; - tex_coord[5] = 0; - tex_coord[6] = 1; - tex_coord[7] = 0; - color[ 0] = 1.0f; color[ 1] = 1.0f; color[ 2] = 1.0f; diff --git a/menu/menu_video.h b/menu/menu_video.h index 10701f6696..0842e04ef8 100644 --- a/menu/menu_video.h +++ b/menu/menu_video.h @@ -43,7 +43,9 @@ void menu_video_frame_background( GLuint texture, float handle_alpha, bool force_transparency, - GRfloat *color); + GRfloat *color, + const GRfloat *vertex, + const GRfloat *tex_coord); #endif const char *menu_video_get_ident(void);