diff options
author | Mathias Fröhlich <[email protected]> | 2012-02-29 18:19:33 +0100 |
---|---|---|
committer | Mathias Fröhlich <[email protected]> | 2012-02-29 20:35:37 +0100 |
commit | 6b48d7e83d4ed09ae8db0da2f8a100d68d6e5e66 (patch) | |
tree | 518a6bafec602ec25e1d09e7f011a8d2971697f5 /src/mesa/main/light.c | |
parent | 7f9692b97dab498ad47f82394892455d43dcd08b (diff) |
mesa: Remove _CosCutoffNeg from light state.
It is only used as a temporary variable during computation of
_CosCutoff. So, don't store it.
Reviewed-by: Alex Deucher <[email protected]>
Reviewed-by: Brian Paul <[email protected]>
Signed-off-by: Mathias Froehlich <[email protected]>
Diffstat (limited to 'src/mesa/main/light.c')
-rw-r--r-- | src/mesa/main/light.c | 7 |
1 files changed, 2 insertions, 5 deletions
diff --git a/src/mesa/main/light.c b/src/mesa/main/light.c index a16d0e99884..552efa7f0a6 100644 --- a/src/mesa/main/light.c +++ b/src/mesa/main/light.c @@ -161,11 +161,9 @@ _mesa_light(struct gl_context *ctx, GLuint lnum, GLenum pname, const GLfloat *pa return; FLUSH_VERTICES(ctx, _NEW_LIGHT); light->SpotCutoff = params[0]; - light->_CosCutoffNeg = (GLfloat) (cos(light->SpotCutoff * DEG2RAD)); - if (light->_CosCutoffNeg < 0) + light->_CosCutoff = (GLfloat) (cos(light->SpotCutoff * DEG2RAD)); + if (light->_CosCutoff < 0) light->_CosCutoff = 0; - else - light->_CosCutoff = light->_CosCutoffNeg; if (light->SpotCutoff != 180.0F) light->_Flags |= LIGHT_SPOT; else @@ -1260,7 +1258,6 @@ init_light( struct gl_light *l, GLuint n ) ASSIGN_3V( l->SpotDirection, 0.0, 0.0, -1.0 ); l->SpotExponent = 0.0; l->SpotCutoff = 180.0; - l->_CosCutoffNeg = -1.0f; l->_CosCutoff = 0.0; /* KW: -ve values not admitted */ l->ConstantAttenuation = 1.0; l->LinearAttenuation = 0.0; |