Clean up 2.1 pal conversion code a lil bit in palshader
This commit is contained in:
parent
7bf9975547
commit
7a5d5c7a80
1 changed files with 10 additions and 10 deletions
|
|
@ -1709,7 +1709,7 @@ void HWR_SetMapPalette(void)
|
|||
{
|
||||
RGBA_t RGBA_converted[256];
|
||||
RGBA_t *palette;
|
||||
size_t i;
|
||||
int i;
|
||||
|
||||
if (!(gamestate == GS_LEVEL || (gamestate == GS_TITLESCREEN && titlemapinaction)))
|
||||
{
|
||||
|
|
@ -1737,22 +1737,22 @@ void HWR_SetMapPalette(void)
|
|||
|
||||
// remap the palette from 2.1 to 2.2 indices in compatmode
|
||||
RGBA_t *palcopy = NULL;
|
||||
size_t realpalsize = 256;
|
||||
|
||||
if (wadfiles[WADFILENUM(lumpnum)]->compatmode)
|
||||
{
|
||||
palcopy = malloc(sizeof(*palcopy)*realpalsize);
|
||||
memcpy(palcopy, RGBA_converted, sizeof(*palcopy)*realpalsize);
|
||||
}
|
||||
|
||||
for (i = 0; i < realpalsize; i++)
|
||||
{
|
||||
if (palcopy)
|
||||
RGBA_converted[i].rgba = palcopy[R_InvPaletteRemap(i)].rgba;
|
||||
palcopy = malloc(sizeof(*palcopy)*256);
|
||||
memcpy(palcopy, RGBA_converted, sizeof(*palcopy)*256);
|
||||
}
|
||||
|
||||
if (palcopy)
|
||||
{
|
||||
for (i = 0; i < 256; i++)
|
||||
{
|
||||
RGBA_converted[i].rgba = palcopy[R_InvPaletteRemap(i)].rgba;
|
||||
}
|
||||
|
||||
free(palcopy);
|
||||
}
|
||||
|
||||
palette = RGBA_converted;
|
||||
}
|
||||
|
|
|
|||
Loading…
Reference in a new issue