From c5215a0737de66ef436aba339c6b6c5f9827e129 Mon Sep 17 00:00:00 2001 From: Joshua Ashton Date: Sun, 22 Aug 2021 19:15:45 +0100 Subject: [PATCH] Support for ZHLT's sun spread angle Signed-off-by: Joshua Ashton --- tools/vmap/light.c | 11 +++++++++-- 1 file changed, 9 insertions(+), 2 deletions(-) diff --git a/tools/vmap/light.c b/tools/vmap/light.c index afd264b..e41e48c 100644 --- a/tools/vmap/light.c +++ b/tools/vmap/light.c @@ -246,7 +246,7 @@ void CreateEntityLights( void ){ const char *name; const char *target; vec3_t dest; - const char *_color, *_light_brightness; + const char *_color, *_light_brightness, *_spread; float intensity, scale, deviance, filterRadius; int spawnflags, flags, numSamples; qboolean junior; @@ -340,7 +340,14 @@ void CreateEntityLights( void ){ /* get filter radius from shader */ sun->filterRadius = FloatForKey( e, "filterradius" ); - sun->deviance = FloatForKey( e, "sunspreadangle" ); + _spread = ValueForKey( e, "_spread" ); + if ( _spread && _spread[ 0 ] ) { + /* ZHLT's sun spread angle. */ + sun->deviance = atof( _spread ); + } + else { + sun->deviance = FloatForKey( e, "sunspreadangle" ); + } sun->deviance = sun->deviance / 180.0f * Q_PI; sun->numSamples = IntForKey( e, "samples" );