Browse Source

engine: imagelib: apply texgamma to palette (ideally should be applied only to BSP/WAD textures)

pull/2/head
Alibek Omarov 6 months ago
parent
commit
a311923d4e
  1. 7
      engine/common/imagelib/img_utils.c

7
engine/common/imagelib/img_utils.c

@ -287,16 +287,15 @@ void Image_SetPalette( const byte *pal, uint *d_table ) @@ -287,16 +287,15 @@ void Image_SetPalette( const byte *pal, uint *d_table )
uint uirgba; // TODO: palette looks byte-swapped on big-endian
int i;
// setup palette
switch( image.d_rendermode )
{
case LUMP_NORMAL:
for( i = 0; i < 256; i++ )
{
rgba[0] = pal[i*3+0];
rgba[1] = pal[i*3+1];
rgba[2] = pal[i*3+2];
rgba[0] = TextureToGamma( pal[i*3+0] );
rgba[1] = TextureToGamma( pal[i*3+1] );
rgba[2] = TextureToGamma( pal[i*3+2] );
rgba[3] = 0xFF;
memcpy( &uirgba, rgba, sizeof( uirgba ));
d_table[i] = uirgba;

Loading…
Cancel
Save