From 37a885f42c977ff926a57215b92e8ae466f9a0ac Mon Sep 17 00:00:00 2001 From: twinaphex Date: Sun, 4 Oct 2015 02:34:18 +0200 Subject: [PATCH] (Zarch) More C89_BUILD fixes --- menu/drivers/zarch.c | 35 +++++++++++++++++++++-------------- 1 file changed, 21 insertions(+), 14 deletions(-) diff --git a/menu/drivers/zarch.c b/menu/drivers/zarch.c index 5d9913e943..7970f0dd50 100644 --- a/menu/drivers/zarch.c +++ b/menu/drivers/zarch.c @@ -332,24 +332,31 @@ static void zui_draw_text(zui_t *zui, uint32_t color, int x, int y, const char * static void zui_push_quad(zui_t *zui, uint32_t color, int x1, int y1, int x2, int y2) { - const GLfloat vertex[4 * 2] = { - x1 / (float)zui->width, y1 / (float)zui->height, - x2 / (float)zui->width, y1 / (float)zui->height, - x1 / (float)zui->width, y2 / (float)zui->height, - x2 / (float)zui->width, y2 / (float)zui->height, - }; + gfx_coords_t coords; + GLfloat colors[16]; + GLfloat vertex[8]; + GLfloat tex_coord[8]; - const GLfloat tex_coord[4 * 2] = { - 0, 1, - 1, 1, - 0, 0, - 1, 0, - }; + 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; + + vertex[0] = x1 / (float)zui->width; + vertex[1] = y1 / (float)zui->height; + vertex[2] = x2 / (float)zui->width; + vertex[3] = y1 / (float)zui->height; + vertex[4] = x1 / (float)zui->width; + vertex[5] = y2 / (float)zui->height; + vertex[6] = x2 / (float)zui->width; + vertex[7] = y2 / (float)zui->height; - GLfloat colors[4 * 4]; zui_set_color(colors, 4, color); - gfx_coords_t coords; coords.color = colors; coords.vertex = vertex; coords.tex_coord = tex_coord;