mirror of
https://github.com/ZDoom/gzdoom-gles.git
synced 2024-11-25 13:41:05 +00:00
- fixed blood translation's alpha so that CreateTexBuffer can assume that all palette entries in translations are correct.
This commit is contained in:
parent
a1694a79c6
commit
cf1d94c9bb
2 changed files with 2 additions and 21 deletions
|
@ -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.
|
||||
}
|
||||
|
|
|
@ -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;
|
||||
|
|
Loading…
Reference in a new issue