From 2e9d84efc336839dfdf6e98c23c5a15ea10b4ff1 Mon Sep 17 00:00:00 2001 From: twinaphex Date: Wed, 19 Dec 2012 04:08:47 +0100 Subject: [PATCH] (GX) Video - small refactor of texture conversion routine --- gx/gx_video.c | 27 ++++++++------------------- 1 file changed, 8 insertions(+), 19 deletions(-) diff --git a/gx/gx_video.c b/gx/gx_video.c index 7a2e876086..cf52601387 100644 --- a/gx/gx_video.c +++ b/gx/gx_video.c @@ -590,24 +590,6 @@ static void convert_texture(const uint32_t *_src, uint32_t *_dst, DCFlushRange(_dst, height * (width << (rgb32 ? 2 : 1))); } -static void update_textures(const uint32_t *src, - unsigned width, unsigned height, unsigned pitch) -{ - gx_video_t *gx = (gx_video_t*)driver.video_data; - - if (src) - { - convert_texture(src, g_tex.data, width, height, pitch, gx->rgb32); - } - - if(g_extern.draw_menu) - { - convert_texture(gx->menu_data, menu_tex.data, RGUI_WIDTH, RGUI_HEIGHT, RGUI_WIDTH * 2, false); - } - - GX_InvalidateTexAll(); -} - static void gx_resize(gx_video_t *gx) { int x = 0, y = 0; @@ -829,7 +811,14 @@ static bool gx_frame(void *data, const void *frame, g_draw_done = false; g_current_framebuf ^= 1; - update_textures(frame, width, height, pitch); + + if (frame) + convert_texture(frame, g_tex.data, width, height, pitch, gx->rgb32); + + if (g_extern.draw_menu) + convert_texture(gx->menu_data, menu_tex.data, RGUI_WIDTH, RGUI_HEIGHT, RGUI_WIDTH * 2, false); + + GX_InvalidateTexAll(); //if (frame) {