From ba811d89bf388e88a9623dc87129cca49b1368c5 Mon Sep 17 00:00:00 2001 From: twinaphex Date: Sat, 24 Oct 2015 23:37:59 +0200 Subject: [PATCH] Refactor away zui_finish --- menu/drivers/zarch.c | 40 ++++++++++++---------------------------- 1 file changed, 12 insertions(+), 28 deletions(-) diff --git a/menu/drivers/zarch.c b/menu/drivers/zarch.c index 2c8ef7cee2..98b3f973f1 100644 --- a/menu/drivers/zarch.c +++ b/menu/drivers/zarch.c @@ -213,33 +213,6 @@ static float zui_strwidth(void *fb_buf, const char *text, float scale) return driver->font_osd_driver->get_message_width(fb_buf, text, strlen(text), scale); } -static void zui_finish(zui_t *zui, - unsigned x, unsigned y, - unsigned width, unsigned height, - bool blend, - GLuint texture) -{ - driver_t *driver = (driver_t*)driver_get_ptr(); - gl_t *gl = (gl_t*)video_driver_get_ptr(NULL); - - if (!gl) - return; - - - menu_display_draw_frame( - x, - y, - width, - height, - gl->shader, (struct gfx_coords*)&zui->ca, - &zui->mvp, true, texture, zui->ca.coords.vertices, - MENU_DISPLAY_PRIM_TRIANGLES); - - menu_display_font_flush_block(zui->menu, driver->font_osd_driver); - - zui->rendering = false; -} - static bool check_button_down(zui_t *zui, unsigned id, int x1, int y1, int x2, int y2) { bool result = false; @@ -964,7 +937,18 @@ static void zarch_frame(void) gl->shader->use(gl, GL_SHADER_STOCK_BLEND); - zui_finish(zui, 0, 0, zui->width, zui->height, true, 0); + menu_display_draw_frame( + 0, + 0, + zui->width, + zui->height, + gl->shader, (struct gfx_coords*)&zui->ca, + &zui->mvp, true, 0, zui->ca.coords.vertices, + MENU_DISPLAY_PRIM_TRIANGLES); + + menu_display_font_flush_block(zui->menu, driver->font_osd_driver); + + zui->rendering = false; menu_display_ctl(MENU_DISPLAY_CTL_UNSET_VIEWPORT, NULL); }