- fixed palette setup for duplicate base palettes.

Due to some old code it could happen that these weren't fully set up and missed their translations.
Fixes #301 - Blood's invulnerability palette is identical to the base.
This commit is contained in:
Christoph Oelckers 2021-04-10 21:42:53 +02:00
parent addfe4e904
commit 184d9be6b1

View file

@ -268,16 +268,13 @@ void LookupTableInfo::postLoadLookups()
{
const uint8_t* lookup = (uint8_t*)tables[l].Shades.GetChars();
FRemapTable remap;
if (i == 0 || (palette != basepalette && !palette->TwodOnly))
memcpy(remap.Remap, lookup, 256);
for (int j = 0; j < 256; j++)
{
memcpy(remap.Remap, lookup, 256);
for (int j = 0; j < 256; j++)
{
remap.Palette[j] = palette->Palette[remap.Remap[j]];
}
remap.NumEntries = 256;
GPalette.UpdateTranslation(TRANSLATION(i + Translation_Remap, l), &remap);
remap.Palette[j] = palette->Palette[remap.Remap[j]];
}
remap.NumEntries = 256;
GPalette.UpdateTranslation(TRANSLATION(i + Translation_Remap, l), &remap);
}
}
}