summaryrefslogtreecommitdiffstats
path: root/src/mesa/main/texstate.c
diff options
context:
space:
mode:
authorBrian Paul <[email protected]>2008-06-10 16:13:42 -0600
committerBrian Paul <[email protected]>2008-06-10 16:13:42 -0600
commit40d1a40f294f1ed2dacfad6f5498322fc08cc2d1 (patch)
treef82624643856ed57346b91a25274a492258d3fde /src/mesa/main/texstate.c
parentef27bdbfa8fd4b7cdd7f1ab0e65bc30f17150d2e (diff)
mesa: refactor: move #define FEATURE flags into new mfeatures.h file
Also, check the FEATURE flags in many places.
Diffstat (limited to 'src/mesa/main/texstate.c')
-rw-r--r--src/mesa/main/texstate.c15
1 files changed, 11 insertions, 4 deletions
diff --git a/src/mesa/main/texstate.c b/src/mesa/main/texstate.c
index 84acfbd92cb..2a83d6df4af 100644
--- a/src/mesa/main/texstate.c
+++ b/src/mesa/main/texstate.c
@@ -30,7 +30,9 @@
#include "glheader.h"
#include "colormac.h"
+#if FEATURE_colortable
#include "colortab.h"
+#endif
#include "context.h"
#include "enums.h"
#include "macros.h"
@@ -3213,7 +3215,9 @@ _mesa_init_texture(GLcontext *ctx)
for (i=0; i<MAX_TEXTURE_UNITS; i++)
init_texture_unit( ctx, i );
ctx->Texture.SharedPalette = GL_FALSE;
+#if FEATURE_colortable
_mesa_init_colortable(&ctx->Texture.Palette);
+#endif
/* Allocate proxy textures */
if (!alloc_proxy_textures( ctx ))
@@ -3229,8 +3233,6 @@ _mesa_init_texture(GLcontext *ctx)
void
_mesa_free_texture_data(GLcontext *ctx)
{
- GLuint i;
-
/* Free proxy texture objects */
(ctx->Driver.DeleteTexture)(ctx, ctx->Texture.Proxy1D );
(ctx->Driver.DeleteTexture)(ctx, ctx->Texture.Proxy2D );
@@ -3240,6 +3242,11 @@ _mesa_free_texture_data(GLcontext *ctx)
(ctx->Driver.DeleteTexture)(ctx, ctx->Texture.Proxy1DArray );
(ctx->Driver.DeleteTexture)(ctx, ctx->Texture.Proxy2DArray );
- for (i = 0; i < MAX_TEXTURE_IMAGE_UNITS; i++)
- _mesa_free_colortable_data( &ctx->Texture.Unit[i].ColorTable );
+#if FEATURE_colortable
+ {
+ GLuint i;
+ for (i = 0; i < MAX_TEXTURE_IMAGE_UNITS; i++)
+ _mesa_free_colortable_data( &ctx->Texture.Unit[i].ColorTable );
+ }
+#endif
}