(GX) Video - refactor convert_texture function some more

This commit is contained in:
twinaphex 2012-12-19 04:16:04 +01:00
parent 2e9d84efc3
commit 2ecb4cebe8

View File

@ -554,15 +554,8 @@ static __attribute__ ((noinline)) void update_texture_asm(const uint32_t *src, c
}
static void convert_texture(const uint32_t *_src, uint32_t *_dst,
unsigned width, unsigned height, unsigned pitch, bool rgb32)
unsigned width, unsigned height, unsigned pitch)
{
if (rgb32)
{
// TODO: actually convert this
memcpy(_dst, _src, width * height * 4);
}
else
{
#ifdef ASM_BLITTER
width &= ~3;
height &= ~3;
@ -585,9 +578,7 @@ static void convert_texture(const uint32_t *_src, uint32_t *_dst,
BLIT_LINE(6)
}
#endif
}
DCFlushRange(_dst, height * (width << (rgb32 ? 2 : 1)));
}
static void gx_resize(gx_video_t *gx)
@ -813,10 +804,19 @@ static bool gx_frame(void *data, const void *frame,
g_current_framebuf ^= 1;
if (frame)
convert_texture(frame, g_tex.data, width, height, pitch, gx->rgb32);
{
if(gx->rgb32)
memcpy(g_tex.data, frame, width * height * 4); // TODO: actually convert this
else
convert_texture(frame, g_tex.data, width, height, pitch);
DCFlushRange(g_tex.data, height * (width << (gx->rgb32 ? 2 : 1)));
}
if (g_extern.draw_menu)
convert_texture(gx->menu_data, menu_tex.data, RGUI_WIDTH, RGUI_HEIGHT, RGUI_WIDTH * 2, false);
{
convert_texture(gx->menu_data, menu_tex.data, RGUI_WIDTH, RGUI_HEIGHT, RGUI_WIDTH * 2);
DCFlushRange(menu_tex.data, height * (width << (gx->rgb32 ? 2 : 1)));
}
GX_InvalidateTexAll();