]> de.git.xonotic.org Git - xonotic/darkplaces.git/commitdiff
minor optimization to CL_RelinkLightFlashes
authorhavoc <havoc@d7cf8633-e32d-0410-b094-e92efae38249>
Sat, 3 Oct 2009 04:07:39 +0000 (04:07 +0000)
committerhavoc <havoc@d7cf8633-e32d-0410-b094-e92efae38249>
Sat, 3 Oct 2009 04:07:39 +0000 (04:07 +0000)
git-svn-id: svn://svn.icculus.org/twilight/trunk/darkplaces@9286 d7cf8633-e32d-0410-b094-e92efae38249

cl_main.c

index 926c65a947d500b662b1d0d1c542a26b179e1f42..cd2d7ccbca5af8a5faa3d2f2af1de5fb7f39dbd3 100644 (file)
--- a/cl_main.c
+++ b/cl_main.c
@@ -740,6 +740,16 @@ void CL_RelinkLightFlashes(void)
                }
        }
 
+       if (!cl.lightstyle)
+       {
+               for (j = 0;j < cl.max_lightstyle;j++)
+               {
+                       r_refdef.scene.rtlightstylevalue[j] = 1;
+                       r_refdef.scene.lightstylevalue[j] = 256;
+               }
+               return;
+       }
+
 // light animations
 // 'm' is normal light, 'a' is no light, 'z' is double bright
        f = cl.time * 10;
@@ -747,7 +757,7 @@ void CL_RelinkLightFlashes(void)
        frac = f - i;
        for (j = 0;j < cl.max_lightstyle;j++)
        {
-               if (!cl.lightstyle || !cl.lightstyle[j].length)
+               if (!cl.lightstyle[j].length)
                {
                        r_refdef.scene.rtlightstylevalue[j] = 1;
                        r_refdef.scene.lightstylevalue[j] = 256;