Fixed applying of color to untranslated fonts in hardware renderer

https://forum.zdoom.org/viewtopic.php?t=57268
This commit is contained in:
alexey.lysiuk 2017-07-19 15:00:55 +03:00
parent f4672d67bc
commit bbb8374b06

View file

@ -133,14 +133,14 @@ void F2DDrawer::AddTexture(FTexture *img, DrawParms &parms)
if (parms.style.Flags & STYLEF_ColorIsFixed) if (parms.style.Flags & STYLEF_ColorIsFixed)
{ {
color = parms.fillcolor; color = parms.fillcolor;
std::swap(color.r, color.b);
} }
else else
{ {
color = PalEntry(light, light, light); color = PalEntry(light, light, light);
} }
color.a = (uint8_t)(parms.Alpha * 255); 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 // scissor test doesn't use the current viewport for the coordinates, so use real screen coordinates
dg.mScissor[0] = GLRenderer->ScreenToWindowX(parms.lclip); dg.mScissor[0] = GLRenderer->ScreenToWindowX(parms.lclip);