diff options
-rw-r--r-- | src/mesa/main/context.c | 3 | ||||
-rw-r--r-- | src/mesa/main/get.c | 101 | ||||
-rw-r--r-- | src/mesa/main/matrix.c | 8 | ||||
-rw-r--r-- | src/mesa/main/mtypes.h | 3 | ||||
-rw-r--r-- | src/mesa/main/texstate.c | 11 |
5 files changed, 56 insertions, 70 deletions
diff --git a/src/mesa/main/context.c b/src/mesa/main/context.c index 49146ce079..9da1526535 100644 --- a/src/mesa/main/context.c +++ b/src/mesa/main/context.c @@ -1,4 +1,4 @@ -/* $Id: context.c,v 1.141 2001/06/05 23:54:00 davem69 Exp $ */ +/* $Id: context.c,v 1.142 2001/06/12 22:08:41 brianp Exp $ */ /* * Mesa 3-D graphics library @@ -1128,7 +1128,6 @@ init_attrib_groups( GLcontext *ctx ) /* Texture group */ ctx->Texture.CurrentUnit = 0; /* multitexture */ - ctx->Texture.CurrentTransformUnit = 0; /* multitexture */ ctx->Texture._ReallyEnabled = 0; for (i=0; i<MAX_TEXTURE_UNITS; i++) init_texture_unit( ctx, i ); diff --git a/src/mesa/main/get.c b/src/mesa/main/get.c index cdd86ebf08..36487df912 100644 --- a/src/mesa/main/get.c +++ b/src/mesa/main/get.c @@ -1,4 +1,4 @@ -/* $Id: get.c,v 1.61 2001/05/29 15:23:49 brianp Exp $ */ +/* $Id: get.c,v 1.62 2001/06/12 22:08:41 brianp Exp $ */ /* * Mesa 3-D graphics library @@ -82,14 +82,12 @@ pixel_texgen_mode(const GLcontext *ctx) } - void _mesa_GetBooleanv( GLenum pname, GLboolean *params ) { GET_CURRENT_CONTEXT(ctx); GLuint i; GLuint texUnit = ctx->Texture.CurrentUnit; - GLuint texTransformUnit = ctx->Texture.CurrentTransformUnit; const struct gl_texture_unit *textureUnit = &ctx->Texture.Unit[texUnit]; ASSERT_OUTSIDE_BEGIN_END(ctx); @@ -267,20 +265,20 @@ _mesa_GetBooleanv( GLenum pname, GLboolean *params ) params[3] = FLOAT_TO_BOOL(ctx->Current.RasterPos[3]); break; case GL_CURRENT_RASTER_TEXTURE_COORDS: - params[0] = FLOAT_TO_BOOL(ctx->Current.RasterMultiTexCoord[texTransformUnit][0]); - params[1] = FLOAT_TO_BOOL(ctx->Current.RasterMultiTexCoord[texTransformUnit][1]); - params[2] = FLOAT_TO_BOOL(ctx->Current.RasterMultiTexCoord[texTransformUnit][2]); - params[3] = FLOAT_TO_BOOL(ctx->Current.RasterMultiTexCoord[texTransformUnit][3]); + params[0] = FLOAT_TO_BOOL(ctx->Current.RasterMultiTexCoord[texUnit][0]); + params[1] = FLOAT_TO_BOOL(ctx->Current.RasterMultiTexCoord[texUnit][1]); + params[2] = FLOAT_TO_BOOL(ctx->Current.RasterMultiTexCoord[texUnit][2]); + params[3] = FLOAT_TO_BOOL(ctx->Current.RasterMultiTexCoord[texUnit][3]); break; case GL_CURRENT_RASTER_POSITION_VALID: *params = ctx->Current.RasterPosValid; break; case GL_CURRENT_TEXTURE_COORDS: FLUSH_CURRENT(ctx, 0); - params[0] = FLOAT_TO_BOOL(ctx->Current.Texcoord[texTransformUnit][0]); - params[1] = FLOAT_TO_BOOL(ctx->Current.Texcoord[texTransformUnit][1]); - params[2] = FLOAT_TO_BOOL(ctx->Current.Texcoord[texTransformUnit][2]); - params[3] = FLOAT_TO_BOOL(ctx->Current.Texcoord[texTransformUnit][3]); + params[0] = FLOAT_TO_BOOL(ctx->Current.Texcoord[texUnit][0]); + params[1] = FLOAT_TO_BOOL(ctx->Current.Texcoord[texUnit][1]); + params[2] = FLOAT_TO_BOOL(ctx->Current.Texcoord[texUnit][2]); + params[3] = FLOAT_TO_BOOL(ctx->Current.Texcoord[texUnit][3]); break; case GL_DEPTH_BIAS: *params = FLOAT_TO_BOOL(ctx->Pixel.DepthBias); @@ -852,11 +850,11 @@ _mesa_GetBooleanv( GLenum pname, GLboolean *params ) case GL_TEXTURE_MATRIX: for (i=0;i<16;i++) { params[i] = - FLOAT_TO_BOOL(ctx->TextureMatrix[texTransformUnit].m[i]); + FLOAT_TO_BOOL(ctx->TextureMatrix[texUnit].m[i]); } break; case GL_TEXTURE_STACK_DEPTH: - *params = INT_TO_BOOL(ctx->TextureStackDepth[texTransformUnit] + 1); + *params = INT_TO_BOOL(ctx->TextureStackDepth[texUnit] + 1); break; case GL_UNPACK_ALIGNMENT: *params = INT_TO_BOOL(ctx->Unpack.Alignment); @@ -1069,7 +1067,7 @@ _mesa_GetBooleanv( GLenum pname, GLboolean *params ) { GLfloat tm[16]; GLuint i; - _math_transposef(tm, ctx->TextureMatrix[texTransformUnit].m); + _math_transposef(tm, ctx->TextureMatrix[texUnit].m); for (i=0;i<16;i++) { params[i] = FLOAT_TO_BOOL(tm[i]); } @@ -1363,15 +1361,12 @@ _mesa_GetBooleanv( GLenum pname, GLboolean *params ) } - - void _mesa_GetDoublev( GLenum pname, GLdouble *params ) { GET_CURRENT_CONTEXT(ctx); GLuint i; GLuint texUnit = ctx->Texture.CurrentUnit; - GLuint texTransformUnit = ctx->Texture.CurrentTransformUnit; const struct gl_texture_unit *textureUnit = &ctx->Texture.Unit[texUnit]; ASSERT_OUTSIDE_BEGIN_END(ctx); @@ -1548,20 +1543,20 @@ _mesa_GetDoublev( GLenum pname, GLdouble *params ) params[3] = (GLdouble) ctx->Current.RasterPos[3]; break; case GL_CURRENT_RASTER_TEXTURE_COORDS: - params[0] = (GLdouble) ctx->Current.RasterMultiTexCoord[texTransformUnit][0]; - params[1] = (GLdouble) ctx->Current.RasterMultiTexCoord[texTransformUnit][1]; - params[2] = (GLdouble) ctx->Current.RasterMultiTexCoord[texTransformUnit][2]; - params[3] = (GLdouble) ctx->Current.RasterMultiTexCoord[texTransformUnit][3]; + params[0] = (GLdouble) ctx->Current.RasterMultiTexCoord[texUnit][0]; + params[1] = (GLdouble) ctx->Current.RasterMultiTexCoord[texUnit][1]; + params[2] = (GLdouble) ctx->Current.RasterMultiTexCoord[texUnit][2]; + params[3] = (GLdouble) ctx->Current.RasterMultiTexCoord[texUnit][3]; break; case GL_CURRENT_RASTER_POSITION_VALID: *params = (GLdouble) ctx->Current.RasterPosValid; break; case GL_CURRENT_TEXTURE_COORDS: FLUSH_CURRENT(ctx, 0); - params[0] = (GLdouble) ctx->Current.Texcoord[texTransformUnit][0]; - params[1] = (GLdouble) ctx->Current.Texcoord[texTransformUnit][1]; - params[2] = (GLdouble) ctx->Current.Texcoord[texTransformUnit][2]; - params[3] = (GLdouble) ctx->Current.Texcoord[texTransformUnit][3]; + params[0] = (GLdouble) ctx->Current.Texcoord[texUnit][0]; + params[1] = (GLdouble) ctx->Current.Texcoord[texUnit][1]; + params[2] = (GLdouble) ctx->Current.Texcoord[texUnit][2]; + params[3] = (GLdouble) ctx->Current.Texcoord[texUnit][3]; break; case GL_DEPTH_BIAS: *params = (GLdouble) ctx->Pixel.DepthBias; @@ -2130,11 +2125,11 @@ _mesa_GetDoublev( GLenum pname, GLdouble *params ) break; case GL_TEXTURE_MATRIX: for (i=0;i<16;i++) { - params[i] = (GLdouble) ctx->TextureMatrix[texTransformUnit].m[i]; + params[i] = (GLdouble) ctx->TextureMatrix[texUnit].m[i]; } break; case GL_TEXTURE_STACK_DEPTH: - *params = (GLdouble) (ctx->TextureStackDepth[texTransformUnit] + 1); + *params = (GLdouble) (ctx->TextureStackDepth[texUnit] + 1); break; case GL_UNPACK_ALIGNMENT: *params = (GLdouble) ctx->Unpack.Alignment; @@ -2350,7 +2345,7 @@ _mesa_GetDoublev( GLenum pname, GLdouble *params ) { GLfloat tm[16]; GLuint i; - _math_transposef(tm, ctx->TextureMatrix[texTransformUnit].m); + _math_transposef(tm, ctx->TextureMatrix[texUnit].m); for (i=0;i<16;i++) { params[i] = (GLdouble) tm[i]; } @@ -2644,15 +2639,12 @@ _mesa_GetDoublev( GLenum pname, GLdouble *params ) } - - void _mesa_GetFloatv( GLenum pname, GLfloat *params ) { GET_CURRENT_CONTEXT(ctx); GLuint i; GLuint texUnit = ctx->Texture.CurrentUnit; - GLuint texTransformUnit = ctx->Texture.CurrentTransformUnit; const struct gl_texture_unit *textureUnit = &ctx->Texture.Unit[texUnit]; ASSERT_OUTSIDE_BEGIN_END(ctx); @@ -2829,20 +2821,20 @@ _mesa_GetFloatv( GLenum pname, GLfloat *params ) params[3] = ctx->Current.RasterPos[3]; break; case GL_CURRENT_RASTER_TEXTURE_COORDS: - params[0] = ctx->Current.RasterMultiTexCoord[texTransformUnit][0]; - params[1] = ctx->Current.RasterMultiTexCoord[texTransformUnit][1]; - params[2] = ctx->Current.RasterMultiTexCoord[texTransformUnit][2]; - params[3] = ctx->Current.RasterMultiTexCoord[texTransformUnit][3]; + params[0] = ctx->Current.RasterMultiTexCoord[texUnit][0]; + params[1] = ctx->Current.RasterMultiTexCoord[texUnit][1]; + params[2] = ctx->Current.RasterMultiTexCoord[texUnit][2]; + params[3] = ctx->Current.RasterMultiTexCoord[texUnit][3]; break; case GL_CURRENT_RASTER_POSITION_VALID: *params = (GLfloat) ctx->Current.RasterPosValid; break; case GL_CURRENT_TEXTURE_COORDS: FLUSH_CURRENT(ctx, 0); - params[0] = (GLfloat) ctx->Current.Texcoord[texTransformUnit][0]; - params[1] = (GLfloat) ctx->Current.Texcoord[texTransformUnit][1]; - params[2] = (GLfloat) ctx->Current.Texcoord[texTransformUnit][2]; - params[3] = (GLfloat) ctx->Current.Texcoord[texTransformUnit][3]; + params[0] = (GLfloat) ctx->Current.Texcoord[texUnit][0]; + params[1] = (GLfloat) ctx->Current.Texcoord[texUnit][1]; + params[2] = (GLfloat) ctx->Current.Texcoord[texUnit][2]; + params[3] = (GLfloat) ctx->Current.Texcoord[texUnit][3]; break; case GL_DEPTH_BIAS: *params = (GLfloat) ctx->Pixel.DepthBias; @@ -3413,11 +3405,11 @@ _mesa_GetFloatv( GLenum pname, GLfloat *params ) break; case GL_TEXTURE_MATRIX: for (i=0;i<16;i++) { - params[i] = ctx->TextureMatrix[texTransformUnit].m[i]; + params[i] = ctx->TextureMatrix[texUnit].m[i]; } break; case GL_TEXTURE_STACK_DEPTH: - *params = (GLfloat) (ctx->TextureStackDepth[texTransformUnit] + 1); + *params = (GLfloat) (ctx->TextureStackDepth[texUnit] + 1); break; case GL_UNPACK_ALIGNMENT: *params = (GLfloat) ctx->Unpack.Alignment; @@ -3609,7 +3601,7 @@ _mesa_GetFloatv( GLenum pname, GLfloat *params ) _math_transposef(params, ctx->ProjectionMatrix.m); break; case GL_TRANSPOSE_TEXTURE_MATRIX_ARB: - _math_transposef(params, ctx->TextureMatrix[texTransformUnit].m); + _math_transposef(params, ctx->TextureMatrix[texUnit].m); break; /* GL_HP_occlusion_test */ @@ -3899,15 +3891,12 @@ _mesa_GetFloatv( GLenum pname, GLfloat *params ) } - - void _mesa_GetIntegerv( GLenum pname, GLint *params ) { GET_CURRENT_CONTEXT(ctx); GLuint i; GLuint texUnit = ctx->Texture.CurrentUnit; - GLuint texTransformUnit = ctx->Texture.CurrentTransformUnit; const struct gl_texture_unit *textureUnit = &ctx->Texture.Unit[texUnit]; ASSERT_OUTSIDE_BEGIN_END(ctx); @@ -4086,20 +4075,20 @@ _mesa_GetIntegerv( GLenum pname, GLint *params ) params[3] = (GLint) ctx->Current.RasterPos[3]; break; case GL_CURRENT_RASTER_TEXTURE_COORDS: - params[0] = (GLint) ctx->Current.RasterMultiTexCoord[texTransformUnit][0]; - params[1] = (GLint) ctx->Current.RasterMultiTexCoord[texTransformUnit][1]; - params[2] = (GLint) ctx->Current.RasterMultiTexCoord[texTransformUnit][2]; - params[3] = (GLint) ctx->Current.RasterMultiTexCoord[texTransformUnit][3]; + params[0] = (GLint) ctx->Current.RasterMultiTexCoord[texUnit][0]; + params[1] = (GLint) ctx->Current.RasterMultiTexCoord[texUnit][1]; + params[2] = (GLint) ctx->Current.RasterMultiTexCoord[texUnit][2]; + params[3] = (GLint) ctx->Current.RasterMultiTexCoord[texUnit][3]; break; case GL_CURRENT_RASTER_POSITION_VALID: *params = (GLint) ctx->Current.RasterPosValid; break; case GL_CURRENT_TEXTURE_COORDS: FLUSH_CURRENT(ctx, 0); - params[0] = (GLint) ctx->Current.Texcoord[texTransformUnit][0]; - params[1] = (GLint) ctx->Current.Texcoord[texTransformUnit][1]; - params[2] = (GLint) ctx->Current.Texcoord[texTransformUnit][2]; - params[3] = (GLint) ctx->Current.Texcoord[texTransformUnit][3]; + params[0] = (GLint) ctx->Current.Texcoord[texUnit][0]; + params[1] = (GLint) ctx->Current.Texcoord[texUnit][1]; + params[2] = (GLint) ctx->Current.Texcoord[texUnit][2]; + params[3] = (GLint) ctx->Current.Texcoord[texUnit][3]; break; case GL_DEPTH_BIAS: *params = (GLint) ctx->Pixel.DepthBias; @@ -4668,11 +4657,11 @@ _mesa_GetIntegerv( GLenum pname, GLint *params ) break; case GL_TEXTURE_MATRIX: for (i=0;i<16;i++) { - params[i] = (GLint) ctx->TextureMatrix[texTransformUnit].m[i]; + params[i] = (GLint) ctx->TextureMatrix[texUnit].m[i]; } break; case GL_TEXTURE_STACK_DEPTH: - *params = (GLint) (ctx->TextureStackDepth[texTransformUnit] + 1); + *params = (GLint) (ctx->TextureStackDepth[texUnit] + 1); break; case GL_UNPACK_ALIGNMENT: *params = ctx->Unpack.Alignment; @@ -4888,7 +4877,7 @@ _mesa_GetIntegerv( GLenum pname, GLint *params ) { GLfloat tm[16]; GLuint i; - _math_transposef(tm, ctx->TextureMatrix[texTransformUnit].m); + _math_transposef(tm, ctx->TextureMatrix[texUnit].m); for (i=0;i<16;i++) { params[i] = (GLint) tm[i]; } diff --git a/src/mesa/main/matrix.c b/src/mesa/main/matrix.c index a2b7af02ba..cb786607df 100644 --- a/src/mesa/main/matrix.c +++ b/src/mesa/main/matrix.c @@ -1,4 +1,4 @@ -/* $Id: matrix.c,v 1.34 2001/03/19 22:45:52 brianp Exp $ */ +/* $Id: matrix.c,v 1.35 2001/06/12 22:08:41 brianp Exp $ */ /* * Mesa 3-D graphics library @@ -70,7 +70,7 @@ do { \ flags |= _NEW_PROJECTION; \ break; \ case GL_TEXTURE: \ - mat = &ctx->TextureMatrix[ctx->Texture.CurrentTransformUnit]; \ + mat = &ctx->TextureMatrix[ctx->Texture.CurrentUnit]; \ flags |= _NEW_TEXTURE_MATRIX; \ break; \ case GL_COLOR: \ @@ -183,7 +183,7 @@ _mesa_PushMatrix( void ) break; case GL_TEXTURE: { - GLuint t = ctx->Texture.CurrentTransformUnit; + GLuint t = ctx->Texture.CurrentUnit; if (ctx->TextureStackDepth[t] >= MAX_TEXTURE_STACK_DEPTH - 1) { _mesa_error( ctx, GL_STACK_OVERFLOW, "glPushMatrix"); return; @@ -239,7 +239,7 @@ _mesa_PopMatrix( void ) break; case GL_TEXTURE: { - GLuint t = ctx->Texture.CurrentTransformUnit; + GLuint t = ctx->Texture.CurrentUnit; if (ctx->TextureStackDepth[t]==0) { _mesa_error( ctx, GL_STACK_UNDERFLOW, "glPopMatrix"); return; diff --git a/src/mesa/main/mtypes.h b/src/mesa/main/mtypes.h index 4dfdbe4619..fce2616112 100644 --- a/src/mesa/main/mtypes.h +++ b/src/mesa/main/mtypes.h @@ -1,4 +1,4 @@ -/* $Id: mtypes.h,v 1.44 2001/05/30 15:22:04 brianp Exp $ */ +/* $Id: mtypes.h,v 1.45 2001/06/12 22:08:41 brianp Exp $ */ /* * Mesa 3-D graphics library @@ -920,7 +920,6 @@ struct gl_texture_unit { struct gl_texture_attrib { /* multitexture */ GLuint CurrentUnit; /* Active texture unit */ - GLuint CurrentTransformUnit; /* Client active texture xform unit */ GLuint _ReallyEnabled; /* enables for all texture units: */ /* = (Unit[0]._ReallyEnabled << 0) | */ diff --git a/src/mesa/main/texstate.c b/src/mesa/main/texstate.c index afa3d07753..9615684a01 100644 --- a/src/mesa/main/texstate.c +++ b/src/mesa/main/texstate.c @@ -1,4 +1,4 @@ -/* $Id: texstate.c,v 1.51 2001/05/21 16:41:03 brianp Exp $ */ +/* $Id: texstate.c,v 1.52 2001/06/12 22:08:41 brianp Exp $ */ /* * Mesa 3-D graphics library @@ -1469,7 +1469,7 @@ void _mesa_TexGenfv( GLenum coord, GLenum pname, const GLfloat *params ) { GET_CURRENT_CONTEXT(ctx); - GLuint tUnit = ctx->Texture.CurrentTransformUnit; + GLuint tUnit = ctx->Texture.CurrentUnit; struct gl_texture_unit *texUnit = &ctx->Texture.Unit[tUnit]; ASSERT_OUTSIDE_BEGIN_END(ctx); @@ -1754,7 +1754,7 @@ void _mesa_GetTexGendv( GLenum coord, GLenum pname, GLdouble *params ) { GET_CURRENT_CONTEXT(ctx); - GLuint tUnit = ctx->Texture.CurrentTransformUnit; + GLuint tUnit = ctx->Texture.CurrentUnit; struct gl_texture_unit *texUnit = &ctx->Texture.Unit[tUnit]; ASSERT_OUTSIDE_BEGIN_END(ctx); @@ -1831,7 +1831,7 @@ void _mesa_GetTexGenfv( GLenum coord, GLenum pname, GLfloat *params ) { GET_CURRENT_CONTEXT(ctx); - GLuint tUnit = ctx->Texture.CurrentTransformUnit; + GLuint tUnit = ctx->Texture.CurrentUnit; struct gl_texture_unit *texUnit = &ctx->Texture.Unit[tUnit]; ASSERT_OUTSIDE_BEGIN_END(ctx); @@ -1908,7 +1908,7 @@ void _mesa_GetTexGeniv( GLenum coord, GLenum pname, GLint *params ) { GET_CURRENT_CONTEXT(ctx); - GLuint tUnit = ctx->Texture.CurrentTransformUnit; + GLuint tUnit = ctx->Texture.CurrentUnit; struct gl_texture_unit *texUnit = &ctx->Texture.Unit[tUnit]; ASSERT_OUTSIDE_BEGIN_END(ctx); @@ -2023,7 +2023,6 @@ _mesa_ActiveTextureARB( GLenum target ) FLUSH_VERTICES(ctx, _NEW_TEXTURE); ctx->Texture.CurrentUnit = texUnit; - ctx->Texture.CurrentTransformUnit = texUnit; if (ctx->Driver.ActiveTexture) { (*ctx->Driver.ActiveTexture)( ctx, (GLuint) texUnit ); } |