From aaad687d510b3c933e4ca532e1c12ec723d33588 Mon Sep 17 00:00:00 2001 From: Brian Paul Date: Sat, 28 Feb 2004 19:34:05 +0000 Subject: replace color table FloatTable boolean with Type enum --- src/mesa/swrast/s_texture.c | 17 +++++++++-------- 1 file changed, 9 insertions(+), 8 deletions(-) (limited to 'src/mesa/swrast') diff --git a/src/mesa/swrast/s_texture.c b/src/mesa/swrast/s_texture.c index 496812f203..5dff9874d5 100644 --- a/src/mesa/swrast/s_texture.c +++ b/src/mesa/swrast/s_texture.c @@ -346,6 +346,7 @@ repeat_remainder(GLint a, GLint b) /* * Do the lookup for GL_SGI_texture_color_table. + * XXX merge with _mesa_lookup_rgba in pixel.c */ void _swrast_texture_table_lookup(const struct gl_color_table *table, @@ -357,7 +358,7 @@ _swrast_texture_table_lookup(const struct gl_color_table *table, switch (table->Format) { case GL_INTENSITY: /* replace RGBA with I */ - if (table->FloatTable) { + if (table->Type == GL_FLOAT) { const GLfloat scale = (GLfloat) (table->Size - 1) / CHAN_MAXF; const GLfloat *lut = (const GLfloat *) table->Table; GLuint i; @@ -397,7 +398,7 @@ _swrast_texture_table_lookup(const struct gl_color_table *table, break; case GL_LUMINANCE: /* replace RGB with L */ - if (table->FloatTable) { + if (table->Type == GL_FLOAT) { const GLfloat scale = (GLfloat) (table->Size - 1) / CHAN_MAXF; const GLfloat *lut = (const GLfloat *) table->Table; GLuint i; @@ -434,7 +435,7 @@ _swrast_texture_table_lookup(const struct gl_color_table *table, break; case GL_ALPHA: /* replace A with A */ - if (table->FloatTable) { + if (table->Type == GL_FLOAT) { const GLfloat scale = (GLfloat) (table->Size - 1) / CHAN_MAXF; const GLfloat *lut = (const GLfloat *) table->Table; GLuint i; @@ -470,7 +471,7 @@ _swrast_texture_table_lookup(const struct gl_color_table *table, break; case GL_LUMINANCE_ALPHA: /* replace RGBA with LLLA */ - if (table->FloatTable) { + if (table->Type == GL_FLOAT) { const GLfloat scale = (GLfloat) (table->Size - 1) / CHAN_MAXF; const GLfloat *lut = (const GLfloat *) table->Table; GLuint i; @@ -516,7 +517,7 @@ _swrast_texture_table_lookup(const struct gl_color_table *table, break; case GL_RGB: /* replace RGB with RGB */ - if (table->FloatTable) { + if (table->Type == GL_FLOAT) { const GLfloat scale = (GLfloat) (table->Size - 1) / CHAN_MAXF; const GLfloat *lut = (const GLfloat *) table->Table; GLuint i; @@ -560,7 +561,7 @@ _swrast_texture_table_lookup(const struct gl_color_table *table, break; case GL_RGBA: /* replace RGBA with RGBA */ - if (table->FloatTable) { + if (table->Type == GL_FLOAT) { const GLfloat scale = (GLfloat) (table->Size - 1) / CHAN_MAXF; const GLfloat *lut = (const GLfloat *) table->Table; GLuint i; @@ -627,12 +628,12 @@ palette_sample(const GLcontext *ctx, GLenum format; if (ctx->Texture.SharedPalette) { - ASSERT(!ctx->Texture.Palette.FloatTable); + ASSERT(ctx->Texture.Palette.Type != GL_FLOAT); palette = (const GLchan *) ctx->Texture.Palette.Table; format = ctx->Texture.Palette.Format; } else { - ASSERT(!tObj->Palette.FloatTable); + ASSERT(tObj->Palette.Type != GL_FLOAT); palette = (const GLchan *) tObj->Palette.Table; format = tObj->Palette.Format; } -- cgit v1.2.3