From e477a765e10a84df2158ce4e95f43c5f5098bbb4 Mon Sep 17 00:00:00 2001 From: "Unknown W. Brackets" Date: Sat, 31 May 2014 18:21:28 -0700 Subject: [PATCH] Scale bits better in MakePixelTexture(). --- GPU/GLES/Framebuffer.cpp | 20 ++++++++++---------- 1 file changed, 10 insertions(+), 10 deletions(-) diff --git a/GPU/GLES/Framebuffer.cpp b/GPU/GLES/Framebuffer.cpp index 16d13e3d2a..d82642408e 100644 --- a/GPU/GLES/Framebuffer.cpp +++ b/GPU/GLES/Framebuffer.cpp @@ -418,9 +418,9 @@ void FramebufferManager::MakePixelTexture(const u8 *srcPixels, GEBufferFormat sr for (int x = 0; x < width; x++) { u16 col = src[x]; - dst[x * 4] = ((col) & 0x1f) << 3; - dst[x * 4 + 1] = ((col >> 5) & 0x3f) << 2; - dst[x * 4 + 2] = ((col >> 11) & 0x1f) << 3; + dst[x * 4] = Convert5To8((col) & 0x1f); + dst[x * 4 + 1] = Convert6To8((col >> 5) & 0x3f); + dst[x * 4 + 2] = Convert5To8((col >> 11) & 0x1f); dst[x * 4 + 3] = 255; } } @@ -433,9 +433,9 @@ void FramebufferManager::MakePixelTexture(const u8 *srcPixels, GEBufferFormat sr for (int x = 0; x < width; x++) { u16 col = src[x]; - dst[x * 4] = ((col) & 0x1f) << 3; - dst[x * 4 + 1] = ((col >> 5) & 0x1f) << 3; - dst[x * 4 + 2] = ((col >> 10) & 0x1f) << 3; + dst[x * 4] = Convert5To8((col) & 0x1f); + dst[x * 4 + 1] = Convert5To8((col >> 5) & 0x1f); + dst[x * 4 + 2] = Convert5To8((col >> 10) & 0x1f); dst[x * 4 + 3] = (col >> 15) ? 255 : 0; } } @@ -448,10 +448,10 @@ void FramebufferManager::MakePixelTexture(const u8 *srcPixels, GEBufferFormat sr for (int x = 0; x < width; x++) { u16 col = src[x]; - dst[x * 4] = ((col >> 8) & 0xf) << 4; - dst[x * 4 + 1] = ((col >> 4) & 0xf) << 4; - dst[x * 4 + 2] = (col & 0xf) << 4; - dst[x * 4 + 3] = (col >> 12) << 4; + dst[x * 4] = Convert4To8((col >> 8) & 0xf); + dst[x * 4 + 1] = Convert4To8((col >> 4) & 0xf); + dst[x * 4 + 2] = Convert4To8(col & 0xf); + dst[x * 4 + 3] = Convert4To8(col >> 12); } } break;