mirror of
https://git.do.srb2.org/STJr/SRB2.git
synced 2024-11-28 23:21:58 +00:00
Recreate the CLUT when the palette changes
This commit is contained in:
parent
d467d2b229
commit
6e0ff4a4a4
1 changed files with 3 additions and 1 deletions
|
@ -2218,13 +2218,15 @@ void InitColorLUT(void)
|
|||
{
|
||||
UINT8 r, g, b;
|
||||
static boolean clutinit = false;
|
||||
if (!clutinit)
|
||||
static RGBA_t *lastpalette = NULL;
|
||||
if ((!clutinit) || (lastpalette != pLocalPalette))
|
||||
{
|
||||
for (r = 0; r < CLUTSIZE; r++)
|
||||
for (g = 0; g < CLUTSIZE; g++)
|
||||
for (b = 0; b < CLUTSIZE; b++)
|
||||
colorlookup[r][g][b] = NearestColor(r << SHIFTCOLORBITS, g << SHIFTCOLORBITS, b << SHIFTCOLORBITS);
|
||||
clutinit = true;
|
||||
lastpalette = pLocalPalette;
|
||||
}
|
||||
}
|
||||
|
||||
|
|
Loading…
Reference in a new issue