mirror of
https://github.com/YGGverse/xash3d-fwgs.git
synced 2025-01-27 07:14:30 +00:00
engine: imagelib: apply texgamma to palette (ideally should be applied only to BSP/WAD textures)
This commit is contained in:
parent
ee4cb39f3e
commit
a311923d4e
@ -287,16 +287,15 @@ void Image_SetPalette( const byte *pal, uint *d_table )
|
|||||||
uint uirgba; // TODO: palette looks byte-swapped on big-endian
|
uint uirgba; // TODO: palette looks byte-swapped on big-endian
|
||||||
int i;
|
int i;
|
||||||
|
|
||||||
|
|
||||||
// setup palette
|
// setup palette
|
||||||
switch( image.d_rendermode )
|
switch( image.d_rendermode )
|
||||||
{
|
{
|
||||||
case LUMP_NORMAL:
|
case LUMP_NORMAL:
|
||||||
for( i = 0; i < 256; i++ )
|
for( i = 0; i < 256; i++ )
|
||||||
{
|
{
|
||||||
rgba[0] = pal[i*3+0];
|
rgba[0] = TextureToGamma( pal[i*3+0] );
|
||||||
rgba[1] = pal[i*3+1];
|
rgba[1] = TextureToGamma( pal[i*3+1] );
|
||||||
rgba[2] = pal[i*3+2];
|
rgba[2] = TextureToGamma( pal[i*3+2] );
|
||||||
rgba[3] = 0xFF;
|
rgba[3] = 0xFF;
|
||||||
memcpy( &uirgba, rgba, sizeof( uirgba ));
|
memcpy( &uirgba, rgba, sizeof( uirgba ));
|
||||||
d_table[i] = uirgba;
|
d_table[i] = uirgba;
|
||||||
|
Loading…
x
Reference in New Issue
Block a user