]> de.git.xonotic.org Git - xonotic/netradiant.git/blobdiff - tools/quake3/q3map2/light_bounce.c
ported over the 1.5 branch version of q3map2 which is newer
[xonotic/netradiant.git] / tools / quake3 / q3map2 / light_bounce.c
index 4181ce53b70a430c776450cb4212cf6f1b7adb74..dba5b131500c0390a09b4fb55f0da6c45b46d107 100644 (file)
@@ -1,4 +1,5 @@
-/*
+/* -------------------------------------------------------------------------------
+
 Copyright (C) 1999-2007 id Software, Inc. and contributors.
 For a list of contributors, see the accompanying CONTRIBUTORS file.
 
@@ -509,7 +510,7 @@ static void RadSubdivideDiffuseLight( int lightmapNum, bspDrawSurface_t *ds, raw
                        break;
                
                case MST_TRIANGLE_SOUP:
-                       numTriangleDiffuseLights;
+                       numTriangleDiffuseLights++;
                        break;
                
                case MST_PATCH:
@@ -546,9 +547,9 @@ static void RadSubdivideDiffuseLight( int lightmapNum, bspDrawSurface_t *ds, raw
                light->add = value * formFactorValueScale * areaScale;
                VectorCopy( si->color, light->color );
                VectorScale( light->color, light->add, light->emitColor );
-               light->style = si->lightStyle;
-               if( light->style < 0 || light->style >= LS_NONE )
-                       light->style = 0;
+               light->style = noStyles ? LS_NORMAL : si->lightStyle;
+               if( light->style < LS_NORMAL || light->style >= LS_NONE )
+                       light->style = LS_NORMAL;
                
                /* set origin */
                VectorAdd( mins, maxs, light->origin );
@@ -577,7 +578,7 @@ static void RadSubdivideDiffuseLight( int lightmapNum, bspDrawSurface_t *ds, raw
                        VectorMA( light->origin, si->backsplashDistance, normal, splash->origin );
                        VectorCopy( si->color, splash->color );
                        splash->falloffTolerance = falloffTolerance;
-                       splash->style = light->style;
+                       splash->style = noStyles ? LS_NORMAL : light->style;
                        
                        /* add to counts */
                        numPointLights++;
@@ -591,9 +592,9 @@ static void RadSubdivideDiffuseLight( int lightmapNum, bspDrawSurface_t *ds, raw
                light->add = value * formFactorValueScale * bounceScale;
                VectorCopy( color, light->color );
                VectorScale( light->color, light->add, light->emitColor );
-               light->style = style;
-               if( light->style < 0 || light->style >= LS_NONE )
-                       light->style = 0;
+               light->style = noStyles ? LS_NORMAL : style;
+               if( light->style < LS_NORMAL || light->style >= LS_NONE )
+                       light->style = LS_NORMAL;
                
                /* set origin */
                WindingCenter( w, light->origin );
@@ -952,3 +953,4 @@ void RadCreateDiffuseLights( void )
 
 
 
+