From 889f722e7359db1f3dd0476cffda985b0a4c30e0 Mon Sep 17 00:00:00 2001 From: Flyinghead Date: Mon, 9 Jul 2018 19:20:33 +0200 Subject: [PATCH] Fix PAL4 textures --- core/rend/TexCache.h | 2 +- core/rend/gles/gltex.cpp | 6 +++--- 2 files changed, 4 insertions(+), 4 deletions(-) diff --git a/core/rend/TexCache.h b/core/rend/TexCache.h index af8d1bf2f..c0e79c784 100644 --- a/core/rend/TexCache.h +++ b/core/rend/TexCache.h @@ -293,7 +293,7 @@ pixelcvt32_start(convYUV_TW,2,2) } pixelcvt_end; -pixelcvt_size_start(convPAL4_TW,2,4) +pixelcvt_size_start(convPAL4_TW,4,4) { u8* p_in=(u8*)data; u32* pal=&palette_ram[palette_index]; diff --git a/core/rend/gles/gltex.cpp b/core/rend/gles/gltex.cpp index 4819240d4..c45508dc8 100644 --- a/core/rend/gles/gltex.cpp +++ b/core/rend/gles/gltex.cpp @@ -309,7 +309,7 @@ struct TextureCacheData if (texconv32 != NULL && (pal_table_rev == NULL || textype == GL_UNSIGNED_INT_8_8_8_8)) { PixelBuffer pbt; - pbt.p_buffer_start = pbt.p_current_line = (u32*)temp_tex_buffer; + pbt.p_buffer_start = pbt.p_current_line = pbt.p_current_pixel = (u32*)temp_tex_buffer; pbt.pixels_per_line = w; texconv32(&pbt, (u8*)&vram[sa], stride, h); @@ -317,8 +317,8 @@ struct TextureCacheData else if (texconv != NULL) { PixelBuffer pbt; - pbt.p_buffer_start=pbt.p_current_line=temp_tex_buffer; - pbt.pixels_per_line=w; + pbt.p_buffer_start = pbt.p_current_line = pbt.p_current_pixel = temp_tex_buffer; + pbt.pixels_per_line = w; texconv(&pbt,(u8*)&vram[sa],stride,h); }