- fixed blood translation's alpha so that CreateTexBuffer can assume that all palette entries in translations are correct.

This commit is contained in:
Christoph Oelckers 2017-06-18 09:23:56 +02:00
parent a1694a79c6
commit cf1d94c9bb
2 changed files with 2 additions and 21 deletions

View File

@ -242,26 +242,7 @@ unsigned char * FGLTexture::CreateTexBuffer(int translation, int & w, int & h, F
{
// When using translations everything must be mapped to the base palette.
// so use CopyTrueColorTranslated
PalEntry penew[256];
PalEntry *pal;
// Todo: Give all palettes proper alpha and make sure the software renderer can handle it.
PalEntry *ptrans = GLTranslationPalette::GetPalette(translation);
if (ptrans && !alphatrans)
{
for (int i = 1; i < 256; i++)
{
penew[i] = (ptrans[i] | 0xff000000);
}
penew[0] = 0;
pal = penew;
}
else if (ptrans)
{
pal = ptrans;
}
tex->CopyTrueColorTranslated(&bmp, exx, exx, 0, pal);
tex->CopyTrueColorTranslated(&bmp, exx, exx, 0, GLTranslationPalette::GetPalette(translation));
isTransparent = 0;
// This is not conclusive for setting the texture's transparency info.
}

View File

@ -757,7 +757,7 @@ int CreateBloodTranslation(PalEntry color)
for (i = 0; i < 256; i++)
{
int bright = MAX(MAX(GPalette.BaseColors[i].r, GPalette.BaseColors[i].g), GPalette.BaseColors[i].b);
PalEntry pe = PalEntry(color.r*bright/255, color.g*bright/255, color.b*bright/255);
PalEntry pe = PalEntry(255, color.r*bright/255, color.g*bright/255, color.b*bright/255);
int entry = ColorMatcher.Pick(pe.r, pe.g, pe.b);
trans->Palette[i] = pe;