- added colorization for untranslated fonts. This uses the light color of the vertices. The software rendered 2D code will ignore this infomation.

- added a virtual OnRetrun method to menus.
This commit is contained in:
Christoph Oelckers 2017-03-29 21:22:05 +02:00
commit 01b095c911
10 changed files with 53 additions and 7 deletions

View file

@ -80,7 +80,9 @@ void DCanvas::DrawChar (FFont *font, int normalcolor, double x, double y, int ch
{
return;
}
parms.remap = font->GetColorTranslation((EColorRange)normalcolor);
PalEntry color;
parms.remap = font->GetColorTranslation((EColorRange)normalcolor, &color);
parms.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);
DrawTextureParms(pic, parms);
}
}
@ -102,7 +104,9 @@ void DCanvas::DrawChar(FFont *font, int normalcolor, double x, double y, int cha
uint32_t tag = ListGetInt(args);
bool res = ParseDrawTextureTags(pic, x, y, tag, args, &parms, false);
if (!res) return;
parms.remap = font->GetColorTranslation((EColorRange)normalcolor);
PalEntry color;
parms.remap = font->GetColorTranslation((EColorRange)normalcolor, &color);
parms.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);
DrawTextureParms(pic, parms);
}
}
@ -151,7 +155,10 @@ void DCanvas::DrawTextCommon(FFont *font, int normalcolor, double x, double y, c
normalcolor = CR_UNTRANSLATED;
boldcolor = normalcolor ? normalcolor - 1 : NumTextColors - 1;
range = font->GetColorTranslation((EColorRange)normalcolor);
PalEntry colorparm = parms.color;
PalEntry color;
range = font->GetColorTranslation((EColorRange)normalcolor, &color);
parms.color = PalEntry((color.a * colorparm.a) / 255, (color.r * colorparm.r) / 255, (color.g * colorparm.g) / 255, (color.b * colorparm.b) / 255);
kerning = font->GetDefaultKerning();
@ -171,7 +178,8 @@ void DCanvas::DrawTextCommon(FFont *font, int normalcolor, double x, double y, c
EColorRange newcolor = V_ParseFontColor(ch, normalcolor, boldcolor);
if (newcolor != CR_UNDEFINED)
{
range = font->GetColorTranslation(newcolor);
range = font->GetColorTranslation(newcolor, &color);
parms.color = PalEntry((color.a * colorparm.a) / 255, (color.r * colorparm.r) / 255, (color.g * colorparm.g) / 255, (color.b * colorparm.b) / 255);
}
continue;
}