Support for ZHLT ambient light_environment color

Signed-off-by: Joshua Ashton <joshua@froggi.es>
This commit is contained in:
Joshua Ashton 2021-08-22 19:12:54 +01:00
parent 011de3563f
commit ab6c146ddb
No known key found for this signature in database
GPG key ID: C85A08669126BE8D

View file

@ -304,6 +304,10 @@ void CreateEntityLights( void ){
} else { } else {
/* alternative: read color in RGB8 values -eukara */ /* alternative: read color in RGB8 values -eukara */
_color = ValueForKey( e, "ambientcolor255" ); _color = ValueForKey( e, "ambientcolor255" );
if ( !_color || !_color[ 0 ] ) {
/* ZHLT's ambient light_environment color. */
_color = ValueForKey( e, "_diffuse_light" );
}
if ( _color && _color[ 0 ] ) { if ( _color && _color[ 0 ] ) {
sscanf( _color, "%f %f %f", &ambientColor[ 0 ], &ambientColor[ 1 ], &ambientColor[ 2 ] ); sscanf( _color, "%f %f %f", &ambientColor[ 0 ], &ambientColor[ 1 ], &ambientColor[ 2 ] );
ambientColor[0] /= 255; ambientColor[0] /= 255;