From 9e15f269235a8e4b4fe33d9589b0557185638dde Mon Sep 17 00:00:00 2001 From: Magnus Norddahl Date: Mon, 17 Dec 2018 01:32:15 +0100 Subject: [PATCH] - fix decal upscaling --- src/swrenderer/textures/r_swtexture.cpp | 19 ++++++++++++++++--- 1 file changed, 16 insertions(+), 3 deletions(-) diff --git a/src/swrenderer/textures/r_swtexture.cpp b/src/swrenderer/textures/r_swtexture.cpp index a53e61d57e..1b6192eee9 100644 --- a/src/swrenderer/textures/r_swtexture.cpp +++ b/src/swrenderer/textures/r_swtexture.cpp @@ -124,11 +124,24 @@ const uint8_t *FSoftwareTexture::GetPixels(int style) auto tempbuffer = mTexture->CreateTexBuffer(0, mBufferFlags); Pixels.Resize(GetPhysicalWidth()*GetPhysicalHeight()); PalEntry *pe = (PalEntry*)tempbuffer.mBuffer; - for (int y = 0; y < GetPhysicalHeight(); y++) + if (!style) { - for (int x = 0; x < GetPhysicalWidth(); x++) + for (int y = 0; y < GetPhysicalHeight(); y++) { - Pixels[y + x * GetPhysicalHeight()] = ImageHelpers::RGBToPalette(false, pe[x + y * GetPhysicalWidth()], true); + for (int x = 0; x < GetPhysicalWidth(); x++) + { + Pixels[y + x * GetPhysicalHeight()] = ImageHelpers::RGBToPalette(false, pe[x + y * GetPhysicalWidth()], true); + } + } + } + else + { + for (int y = 0; y < GetPhysicalHeight(); y++) + { + for (int x = 0; x < GetPhysicalWidth(); x++) + { + Pixels[y + x * GetPhysicalHeight()] = pe[x + y * GetPhysicalWidth()].r; + } } } }