Revert "Don't use the same vertex array in every menu driver"

This reverts commit eefc33ef07f63a342bb1afa9b60a774a588e3100.
This commit is contained in:
twinaphex 2015-11-01 22:35:19 +01:00
parent eefc33ef07
commit 159e9c1910
5 changed files with 36 additions and 16 deletions

View File

@ -104,6 +104,13 @@ typedef struct glui_handle
gfx_font_raster_block_t list_block;
} glui_handle_t;
static const GRfloat glui_vertexes[] = {
0, 0,
1, 0,
0, 1,
1, 1
};
static const GRfloat glui_tex_coords[] = {
0, 1,
1, 1,
@ -185,6 +192,7 @@ static void glui_draw_icon(gl_t *gl, glui_handle_t *glui,
matrix_4x4_multiply(&mymat, &mscal, &mymat);
coords.vertices = 4;
coords.vertex = glui_vertexes;
coords.tex_coord = glui_tex_coords;
coords.lut_tex_coord = glui_tex_coords;
coords.color = (const float*)color;
@ -238,6 +246,7 @@ static void glui_render_quad(gl_t *gl, int x, int y, int w, int h,
glui_handle_t *glui = (glui_handle_t*)menu->userdata;
coords.vertices = 4;
coords.vertex = glui_vertexes;
coords.tex_coord = glui_tex_coords;
coords.lut_tex_coord = glui_tex_coords;
coords.color = coord_color;
@ -577,6 +586,7 @@ static void glui_draw_cursor(gl_t *gl, glui_handle_t *glui,
matrix_4x4_multiply(&mymat, &mrot, &gl->mvp_no_rot);
coords.vertices = 4;
coords.vertex = glui_vertexes;
coords.tex_coord = glui_tex_coords;
coords.lut_tex_coord = glui_tex_coords;
coords.color = (const float*)color;
@ -716,7 +726,7 @@ static void glui_frame(void)
gl, width, height,
glui->textures.white, 0.75f, false,
&white_transp_bg[0], &white_bg[0],
&glui_tex_coords[0], 4,
&glui_vertexes[0], &glui_tex_coords[0], 4,
MENU_DISPLAY_PRIM_TRIANGLESTRIP);
}
else
@ -738,7 +748,7 @@ static void glui_frame(void)
gl, width, height,
glui->textures.bg.id, 0.75f, true,
&white_transp_bg[0], &white_bg[0],
&glui_tex_coords[0], 4,
&glui_vertexes[0], &glui_tex_coords[0], 4,
MENU_DISPLAY_PRIM_TRIANGLESTRIP);
/* Restore opacity of transposed white background */

View File

@ -224,6 +224,13 @@ typedef struct xmb_handle
gfx_font_raster_block_t raster_block;
} xmb_handle_t;
static const GRfloat rmb_vertex[] = {
0, 0,
1, 0,
0, 1,
1, 1,
};
static const GRfloat rmb_tex_coord[] = {
0, 1,
1, 1,
@ -361,6 +368,7 @@ static void xmb_draw_icon(gl_t *gl, xmb_handle_t *xmb,
matrix_4x4_multiply(&mymat, &mscal, &mymat);
coords.vertices = 4;
coords.vertex = rmb_vertex;
coords.tex_coord = rmb_tex_coord;
coords.lut_tex_coord = rmb_tex_coord;
coords.color = (const float*)color;
@ -392,6 +400,7 @@ static void xmb_draw_icon_predone(gl_t *gl, xmb_handle_t *xmb,
return;
coords.vertices = 4;
coords.vertex = rmb_vertex;
coords.tex_coord = rmb_tex_coord;
coords.lut_tex_coord = rmb_tex_coord;
coords.color = color;
@ -423,6 +432,7 @@ static void xmb_draw_boxart(gl_t *gl, xmb_handle_t *xmb, GRfloat *color, unsigne
matrix_4x4_multiply(&mymat, &mscal, &mymat);
coords.vertices = 4;
coords.vertex = rmb_vertex;
coords.tex_coord = rmb_tex_coord;
coords.lut_tex_coord = rmb_tex_coord;
coords.color = (const float*)color;
@ -1425,6 +1435,7 @@ static void xmb_draw_cursor(gl_t *gl, xmb_handle_t *xmb,
matrix_4x4_multiply(&mymat, &mrot, &gl->mvp_no_rot);
coords.vertices = 4;
coords.vertex = rmb_vertex;
coords.tex_coord = rmb_tex_coord;
coords.lut_tex_coord = rmb_tex_coord;
coords.color = (const float*)color;
@ -1592,7 +1603,7 @@ static void xmb_frame(void)
menu_display_frame_background(menu, settings,
gl, width, height, xmb->textures.bg.id, xmb->alpha, false, &coord_color[0],
&coord_color2[0], &rmb_tex_coord[0], 4,
&coord_color2[0], &rmb_vertex[0], &rmb_tex_coord[0], 4,
MENU_DISPLAY_PRIM_TRIANGLESTRIP);
xmb_draw_text(menu, xmb,
@ -1702,7 +1713,7 @@ static void xmb_frame(void)
width, height,
xmb->textures.bg.id, xmb->alpha, true,
&coord_color[0], &coord_color2[0],
&rmb_tex_coord[0], 4,
&rmb_vertex[0], &rmb_tex_coord[0], 4,
MENU_DISPLAY_PRIM_TRIANGLESTRIP);
xmb_frame_messagebox(msg);
}

View File

@ -200,6 +200,13 @@ static enum
LAY_SETTINGS
} layout = LAY_HOME;
static const GRfloat zarch_vertexes[] = {
0, 0,
1, 0,
0, 1,
1, 1
};
static const GRfloat zarch_tex_coords[] = {
0, 1,
1, 1,
@ -1066,7 +1073,7 @@ static void zarch_frame(void)
gl, zui->width, zui->height,
zui->textures.bg.id, 0.75f, false,
&coord_color[0], &coord_color2[0],
&zarch_tex_coords[0], 4,
&zarch_vertexes[0], &zarch_tex_coords[0], 4,
MENU_DISPLAY_PRIM_TRIANGLESTRIP);
menu_display_font_flush_block(zui->menu, driver->font_osd_driver);

View File

@ -487,13 +487,6 @@ void menu_display_msg_queue_push(const char *msg, unsigned prio, unsigned durati
}
#ifdef HAVE_OPENGL
static const GRfloat menu_display_vertex[] = {
0, 0,
1, 0,
0, 1,
1, 1,
};
static GLenum menu_display_prim_to_gl_enum(enum menu_display_prim_type prim_type)
{
switch (prim_type)
@ -549,9 +542,6 @@ void menu_display_draw_frame(
if (height <= 0)
height = 1;
if (!coords->vertex)
coords->vertex = menu_display_vertex;
glViewport(x, y, width, height);
glBindTexture(GL_TEXTURE_2D, texture);
@ -572,6 +562,7 @@ void menu_display_frame_background(
bool force_transparency,
GRfloat *coord_color,
GRfloat *coord_color2,
const GRfloat *vertex,
const GRfloat *tex_coord,
size_t vertex_count,
enum menu_display_prim_type prim_type)
@ -581,7 +572,7 @@ void menu_display_frame_background(
global_t *global = global_get_ptr();
coords.vertices = vertex_count;
coords.vertex = menu_display_vertex;
coords.vertex = vertex;
coords.tex_coord = tex_coord;
coords.lut_tex_coord = tex_coord;
coords.color = (const float*)coord_color;

View File

@ -118,6 +118,7 @@ void menu_display_frame_background(
bool force_transparency,
GRfloat *color,
GRfloat *color2,
const GRfloat *vertex,
const GRfloat *tex_coord,
size_t vertex_count,
enum menu_display_prim_type prim_type