From 30f51ae067379c2b3573c06b707d25a9704df7be Mon Sep 17 00:00:00 2001 From: Brian Paul Date: Tue, 18 Dec 2001 04:06:44 +0000 Subject: Replace old matrix stacks with new code based on struct matrix_stack. Moved vertex program hash table into shared context state. Implemented reference counting for vertex programs. Replaced tnl "ProjectedClip" with "Ndc" (normalized device coordinates). --- src/mesa/main/light.c | 16 ++++++++-------- 1 file changed, 8 insertions(+), 8 deletions(-) (limited to 'src/mesa/main/light.c') diff --git a/src/mesa/main/light.c b/src/mesa/main/light.c index c5f741567da..9286642d3ad 100644 --- a/src/mesa/main/light.c +++ b/src/mesa/main/light.c @@ -1,4 +1,4 @@ -/* $Id: light.c,v 1.47 2001/12/14 02:50:02 brianp Exp $ */ +/* $Id: light.c,v 1.48 2001/12/18 04:06:45 brianp Exp $ */ /* * Mesa 3-D graphics library @@ -117,7 +117,7 @@ _mesa_Lightfv( GLenum light, GLenum pname, const GLfloat *params ) case GL_POSITION: { GLfloat tmp[4]; /* transform position by ModelView matrix */ - TRANSFORM_POINT( tmp, ctx->ModelView.m, params ); + TRANSFORM_POINT( tmp, ctx->ModelviewMatrixStack.Top->m, params ); if (TEST_EQ_4V(l->EyePosition, tmp)) return; FLUSH_VERTICES(ctx, _NEW_LIGHT); @@ -131,10 +131,10 @@ _mesa_Lightfv( GLenum light, GLenum pname, const GLfloat *params ) case GL_SPOT_DIRECTION: { GLfloat tmp[4]; /* transform direction by inverse modelview */ - if (ctx->ModelView.flags & MAT_DIRTY_INVERSE) { - _math_matrix_analyse( &ctx->ModelView ); + if (ctx->ModelviewMatrixStack.Top->flags & MAT_DIRTY_INVERSE) { + _math_matrix_analyse( ctx->ModelviewMatrixStack.Top ); } - TRANSFORM_NORMAL( tmp, params, ctx->ModelView.inv ); + TRANSFORM_NORMAL( tmp, params, ctx->ModelviewMatrixStack.Top->inv ); if (TEST_EQ_3V(l->EyeDirection, tmp)) return; FLUSH_VERTICES(ctx, _NEW_LIGHT); @@ -1254,7 +1254,7 @@ _mesa_compute_light_positions( GLcontext *ctx ) COPY_3V( ctx->_EyeZDir, eye_z ); } else { - TRANSFORM_NORMAL( ctx->_EyeZDir, eye_z, ctx->ModelView.m ); + TRANSFORM_NORMAL( ctx->_EyeZDir, eye_z, ctx->ModelviewMatrixStack.Top->m ); } foreach (light, &ctx->Light.EnabledList) { @@ -1263,7 +1263,7 @@ _mesa_compute_light_positions( GLcontext *ctx ) COPY_4FV( light->_Position, light->EyePosition ); } else { - TRANSFORM_POINT( light->_Position, ctx->ModelView.inv, + TRANSFORM_POINT( light->_Position, ctx->ModelviewMatrixStack.Top->inv, light->EyePosition ); } @@ -1287,7 +1287,7 @@ _mesa_compute_light_positions( GLcontext *ctx ) else { TRANSFORM_NORMAL( light->_NormDirection, light->EyeDirection, - ctx->ModelView.m); + ctx->ModelviewMatrixStack.Top->m); } NORMALIZE_3FV( light->_NormDirection ); -- cgit v1.2.3