From bbb8374b061a5adda494d43e1e4b2374b7dd9bf6 Mon Sep 17 00:00:00 2001 From: "alexey.lysiuk" Date: Wed, 19 Jul 2017 15:00:55 +0300 Subject: [PATCH] Fixed applying of color to untranslated fonts in hardware renderer https://forum.zdoom.org/viewtopic.php?t=57268 --- src/gl/renderer/gl_2ddrawer.cpp | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/gl/renderer/gl_2ddrawer.cpp b/src/gl/renderer/gl_2ddrawer.cpp index 0e08073cca..130b6931a6 100644 --- a/src/gl/renderer/gl_2ddrawer.cpp +++ b/src/gl/renderer/gl_2ddrawer.cpp @@ -133,14 +133,14 @@ void F2DDrawer::AddTexture(FTexture *img, DrawParms &parms) if (parms.style.Flags & STYLEF_ColorIsFixed) { color = parms.fillcolor; - std::swap(color.r, color.b); } else { color = PalEntry(light, light, light); } color.a = (uint8_t)(parms.Alpha * 255); - color = PalEntry((color.a * parms.color.a) / 255, (color.r * parms.color.r) / 255, (color.g * parms.color.g) / 255, (color.b * parms.color.b) / 255); + // red and blue channels are swapped to use value as vertex color + color = PalEntry((color.a * parms.color.a) / 255, (color.b * parms.color.b) / 255, (color.g * parms.color.g) / 255, (color.r * parms.color.r) / 255); // scissor test doesn't use the current viewport for the coordinates, so use real screen coordinates dg.mScissor[0] = GLRenderer->ScreenToWindowX(parms.lclip);