replaced hard-coded 4 with NUM_TEXTURE_TARGETS
authorBrian Paul <brian.paul@tungstengraphics.com>
Thu, 6 Jun 2002 16:31:24 +0000 (16:31 +0000)
committerBrian Paul <brian.paul@tungstengraphics.com>
Thu, 6 Jun 2002 16:31:24 +0000 (16:31 +0000)
src/mesa/main/mtypes.h
src/mesa/main/state.c

index 2864e65..cc6c40f 100644 (file)
@@ -1,4 +1,4 @@
-/* $Id: mtypes.h,v 1.76 2002/05/27 17:04:53 brianp Exp $ */
+/* $Id: mtypes.h,v 1.77 2002/06/06 16:31:24 brianp Exp $ */
 
 /*
  * Mesa 3-D graphics library
@@ -726,6 +726,8 @@ struct gl_stencil_attrib {
 #define R_BIT 4
 #define Q_BIT 8
 
+#define NUM_TEXTURE_TARGETS 4 /* 1D, 2D, 3D and CUBE */
+
 /* Texture Enabled flags */
 #define TEXTURE0_1D   0x1     /* Texture unit 0 (default) */
 #define TEXTURE0_2D   0x2
index c513b4f..d94c9c7 100644 (file)
@@ -1,4 +1,4 @@
-/* $Id: state.c,v 1.83 2002/05/29 15:16:02 brianp Exp $ */
+/* $Id: state.c,v 1.84 2002/06/06 16:31:24 brianp Exp $ */
 
 /*
  * Mesa 3-D graphics library
@@ -836,7 +836,7 @@ update_texture_state( GLcontext *ctx )
       }
 
       {
-        GLuint flag = texUnit->_ReallyEnabled << (i * 4);
+        GLuint flag = texUnit->_ReallyEnabled << (i * NUM_TEXTURE_TARGETS);
         ctx->Texture._ReallyEnabled |= flag;
       }