From: Rudolf Polzer Date: Wed, 14 Dec 2011 08:31:18 +0000 (+0100) Subject: support -sRGBcolor for all _color keys X-Git-Tag: xonotic-v0.6.0~40 X-Git-Url: https://git.rm.cloudns.org/?a=commitdiff_plain;h=084d085966542dd2977ed689922d9e8a2c496b97;p=xonotic%2Fnetradiant.git support -sRGBcolor for all _color keys --- diff --git a/tools/quake3/q3map2/light.c b/tools/quake3/q3map2/light.c index 67c0b4ca..74ed5a46 100644 --- a/tools/quake3/q3map2/light.c +++ b/tools/quake3/q3map2/light.c @@ -388,6 +388,12 @@ void CreateEntityLights( void ) if( _color && _color[ 0 ] ) { sscanf( _color, "%f %f %f", &light->color[ 0 ], &light->color[ 1 ], &light->color[ 2 ] ); + if (colorsRGB) + { + light->color[0] = Image_LinearFloatFromsRGBFloat(light->color[0]); + light->color[1] = Image_LinearFloatFromsRGBFloat(light->color[1]); + light->color[2] = Image_LinearFloatFromsRGBFloat(light->color[2]); + } if (!(light->flags & LIGHT_UNNORMALIZED)) { ColorNormalize( light->color, light->color ); @@ -1850,6 +1856,12 @@ void LightWorld( void ) /* find the optional minimum lighting values */ GetVectorForKey( &entities[ 0 ], "_color", color ); + if (colorsRGB) + { + color[0] = Image_LinearFloatFromsRGBFloat(color[0]); + color[1] = Image_LinearFloatFromsRGBFloat(color[1]); + color[2] = Image_LinearFloatFromsRGBFloat(color[2]); + } if( VectorLength( color ) == 0.0f ) VectorSet( color, 1.0, 1.0, 1.0 );