summaryrefslogtreecommitdiff
path: root/src/mesa/main/light.c
diff options
context:
space:
mode:
authorBrian Paul <brian.paul@tungstengraphics.com>2001-12-18 04:06:44 +0000
committerBrian Paul <brian.paul@tungstengraphics.com>2001-12-18 04:06:44 +0000
commit30f51ae067379c2b3573c06b707d25a9704df7be (patch)
tree401d75d291724d0d3a47be29d4d3512dcdb66a5a /src/mesa/main/light.c
parent645ced29552da1af5c759d0497d98c8f55b72935 (diff)
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).
Diffstat (limited to 'src/mesa/main/light.c')
-rw-r--r--src/mesa/main/light.c16
1 files changed, 8 insertions, 8 deletions
diff --git a/src/mesa/main/light.c b/src/mesa/main/light.c
index c5f741567d..9286642d3a 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 );