]> git.rm.cloudns.org Git - xonotic/darkplaces.git/commitdiff
added a couple checks to hopefully fix a lit sprite dlight problem (an organe dlight...
authorhavoc <havoc@d7cf8633-e32d-0410-b094-e92efae38249>
Sat, 14 May 2005 05:38:40 +0000 (05:38 +0000)
committerhavoc <havoc@d7cf8633-e32d-0410-b094-e92efae38249>
Sat, 14 May 2005 05:38:40 +0000 (05:38 +0000)
git-svn-id: svn://svn.icculus.org/twilight/trunk/darkplaces@5296 d7cf8633-e32d-0410-b094-e92efae38249

r_light.c

index 83d9630332d4df5b781367afba412facf193eaef..4c7e48e85a0f9f642d7af365084d91dd42005cbe 100644 (file)
--- a/r_light.c
+++ b/r_light.c
@@ -199,7 +199,8 @@ void R_CompleteLightPoint(vec3_t ambientcolor, vec3_t diffusecolor, vec3_t diffu
                                if (f > 0 && CL_TraceBox(p, vec3_origin, vec3_origin, sl->origin, false, NULL, SUPERCONTENTS_SOLID, false).fraction == 1)
                                {
                                        f *= d_lightstylevalue[sl->style] * (1.0f / 65536.0f);
-                                       VectorMA(ambientcolor, f, sl->light, ambientcolor);
+                                       if (f > 0)
+                                               VectorMA(ambientcolor, f, sl->light, ambientcolor);
                                }
                        }
                }
@@ -219,7 +220,8 @@ void R_CompleteLightPoint(vec3_t ambientcolor, vec3_t diffusecolor, vec3_t diffu
                        if (f < light->rtlight.lightmap_cullradius2 && CL_TraceBox(p, vec3_origin, vec3_origin, light->origin, false, NULL, SUPERCONTENTS_SOLID, false).fraction == 1)
                        {
                                f = (1.0f / (f + LIGHTOFFSET)) - light->rtlight.lightmap_subtract;
-                               VectorMA(ambientcolor, f, light->rtlight.lightmap_light, ambientcolor);
+                               if (f > 0)
+                                       VectorMA(ambientcolor, f, light->rtlight.lightmap_light, ambientcolor);
                        }
                }
        }