Add vertex count variable to menu_display drawing functions

This commit is contained in:
twinaphex 2015-10-24 07:28:49 +02:00
parent 0e7b031d5f
commit 8ecfa76ab9
5 changed files with 20 additions and 16 deletions

View File

@ -120,7 +120,7 @@ static void glui_render_quad(gl_t *gl, int x, int y, int w, int h,
w,
h,
gl->shader, &coords,
&gl->mvp_no_rot, true, glui->textures.white);
&gl->mvp_no_rot, true, glui->textures.white, 4);
gl->coords.color = gl->white_color_ptr;
}
@ -450,7 +450,7 @@ static void glui_frame(void)
gl, width, height,
glui->textures.bg.id, 0.75f, false,
&coord_color[0], &coord_color2[0],
&glui_vertexes[0], &glui_tex_coords[0]);
&glui_vertexes[0], &glui_tex_coords[0], 4);
menu_entries_get_title(title, sizeof(title));

View File

@ -383,7 +383,7 @@ static void xmb_draw_icon(gl_t *gl, xmb_handle_t *xmb,
height - y,
xmb->icon.size,
xmb->icon.size,
gl->shader, &coords, &mymat, false, texture);
gl->shader, &coords, &mymat, false, texture, 4);
}
static void xmb_draw_icon_predone(gl_t *gl, xmb_handle_t *xmb,
@ -417,7 +417,7 @@ static void xmb_draw_icon_predone(gl_t *gl, xmb_handle_t *xmb,
height - y,
xmb->icon.size,
xmb->icon.size,
gl->shader, &coords, mymat, false, texture);
gl->shader, &coords, mymat, false, texture, 4);
}
static void xmb_draw_boxart(gl_t *gl, xmb_handle_t *xmb, GRfloat *color, unsigned width, unsigned height)
@ -448,7 +448,7 @@ static void xmb_draw_boxart(gl_t *gl, xmb_handle_t *xmb, GRfloat *color, unsigne
height - y,
xmb->boxart_size,
xmb->boxart_size,
gl->shader, &coords, &mymat, false, xmb->boxart);
gl->shader, &coords, &mymat, false, xmb->boxart, 4);
}
static void xmb_draw_text(menu_handle_t *menu,
@ -1435,7 +1435,7 @@ static void xmb_draw_cursor(gl_t *gl, xmb_handle_t *xmb,
height - y,
xmb->cursor.size,
xmb->cursor.size,
gl->shader, &coords, &mymat, true, xmb->textures.list[XMB_TEXTURE_POINTER].id);
gl->shader, &coords, &mymat, true, xmb->textures.list[XMB_TEXTURE_POINTER].id, 4);
}
static void xmb_render(void)
@ -1603,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_vertex[0], &rmb_tex_coord[0]);
&coord_color2[0], &rmb_vertex[0], &rmb_tex_coord[0], 4);
xmb_draw_text(menu, xmb,
xmb->title_name, xmb->margins.title.left,
@ -1712,7 +1712,7 @@ static void xmb_frame(void)
width, height,
xmb->textures.bg.id, xmb->alpha, true,
&coord_color[0], &coord_color2[0],
&rmb_vertex[0], &rmb_tex_coord[0]);
&rmb_vertex[0], &rmb_tex_coord[0], 4);
xmb_frame_messagebox(msg);
}

View File

@ -943,7 +943,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_vertexes[0], &zarch_tex_coords[0]);
&zarch_vertexes[0], &zarch_tex_coords[0], 4);
if (gl && gl->shader && gl->shader->use)
gl->shader->use(gl, GL_SHADER_STOCK_BLEND);

View File

@ -490,7 +490,8 @@ void menu_display_draw_frame(
struct gfx_coords *coords,
math_matrix_4x4 *mat,
bool blend,
GLuint texture
GLuint texture,
size_t vertex_count
)
{
const shader_backend_t *shader = (const shader_backend_t*)shader_data;
@ -505,7 +506,7 @@ void menu_display_draw_frame(
if (blend)
glEnable(GL_BLEND);
glDrawArrays(GL_TRIANGLE_STRIP, 0, 4);
glDrawArrays(GL_TRIANGLE_STRIP, 0, vertex_count);
if (blend)
glDisable(GL_BLEND);
@ -523,13 +524,14 @@ void menu_display_frame_background(
GRfloat *coord_color,
GRfloat *coord_color2,
const GRfloat *vertex,
const GRfloat *tex_coord)
const GRfloat *tex_coord,
size_t vertex_count)
{
struct gfx_coords coords;
global_t *global = global_get_ptr();
coords.vertices = 4;
coords.vertices = vertex_count;
coords.vertex = vertex;
coords.tex_coord = tex_coord;
coords.lut_tex_coord = tex_coord;
@ -548,7 +550,7 @@ void menu_display_frame_background(
menu_display_draw_frame(0, 0, width, height,
gl->shader, &coords,
&gl->mvp_no_rot, true, texture);
&gl->mvp_no_rot, true, texture, vertex_count);
gl->coords.color = gl->white_color_ptr;
}

View File

@ -92,7 +92,8 @@ void menu_display_draw_frame(
struct gfx_coords *coords,
math_matrix_4x4 *mat,
bool blend,
GLuint texture
GLuint texture,
size_t vertex_count
);
void menu_display_frame_background(
@ -106,7 +107,8 @@ void menu_display_frame_background(
GRfloat *color,
GRfloat *color2,
const GRfloat *vertex,
const GRfloat *tex_coord);
const GRfloat *tex_coord,
size_t vertex_count);
#endif
const char *menu_video_get_ident(void);