light: minor tidy up of spot falloff check in SingleLightFace

Signed-off-by: Kevin Shanahan <kmshanah@disenchant.net>
This commit is contained in:
Kevin Shanahan 2013-03-02 11:30:49 +10:30
parent c0ebc18d96
commit 4cbbb44a23
1 changed files with 5 additions and 4 deletions

View File

@ -564,10 +564,11 @@ SingleLightFace(const entity_t *light, lightinfo_t * l,
VectorSubtract(light->origin, surf, incoming);
VectorNormalize(incoming);
angle = DotProduct(incoming, l->facenormal);
if (light->spotlight &&
DotProduct(light->spotvec, incoming) > light->spotfalloff)
/* spotlight cutoff */
continue;
if (light->spotlight) {
vec_t falloff = DotProduct(light->spotvec, incoming);
if (falloff > light->spotfalloff)
continue;
}
angle = (1.0 - scalecos) + scalecos * angle;
add = scaledLight(CastRay(light->origin, surf), light);