diff options
author | Brian Paul <[email protected]> | 2003-07-23 17:13:48 +0000 |
---|---|---|
committer | Brian Paul <[email protected]> | 2003-07-23 17:13:48 +0000 |
commit | 9f9bed9c8ea8a1baa922320debbf04128b2b58de (patch) | |
tree | c0600de102d663cfc781965e8e36777d69f7ca22 /src/mesa/swrast/s_texture.c | |
parent | d19b5db5dce92efd55359607006a32076dc95d12 (diff) |
fix GL_SGI_texture_colortable bugs
Diffstat (limited to 'src/mesa/swrast/s_texture.c')
-rw-r--r-- | src/mesa/swrast/s_texture.c | 12 |
1 files changed, 6 insertions, 6 deletions
diff --git a/src/mesa/swrast/s_texture.c b/src/mesa/swrast/s_texture.c index 1343b289fbd..cb124724624 100644 --- a/src/mesa/swrast/s_texture.c +++ b/src/mesa/swrast/s_texture.c @@ -533,19 +533,19 @@ _swrast_texture_table_lookup(const struct gl_color_table *table, break; case GL_RGBA: /* replace RGBA with RGBA */ - if (!table->FloatTable) { + if (table->FloatTable) { const GLfloat scale = (GLfloat) (table->Size - 1) / CHAN_MAXF; - const GLchan *lut = (const GLchan *) table->Table; + const GLfloat *lut = (const GLfloat *) table->Table; GLuint i; for (i = 0; i < n; i++) { GLint jR = IROUND((GLfloat) rgba[i][RCOMP] * scale); GLint jG = IROUND((GLfloat) rgba[i][GCOMP] * scale); GLint jB = IROUND((GLfloat) rgba[i][BCOMP] * scale); GLint jA = IROUND((GLfloat) rgba[i][ACOMP] * scale); - rgba[i][RCOMP] = lut[jR * 4 + 0]; - rgba[i][GCOMP] = lut[jG * 4 + 1]; - rgba[i][BCOMP] = lut[jB * 4 + 2]; - rgba[i][ACOMP] = lut[jA * 4 + 3]; + CLAMPED_FLOAT_TO_CHAN(rgba[i][RCOMP], lut[jR * 4 + 0]); + CLAMPED_FLOAT_TO_CHAN(rgba[i][GCOMP], lut[jG * 4 + 1]); + CLAMPED_FLOAT_TO_CHAN(rgba[i][BCOMP], lut[jB * 4 + 2]); + CLAMPED_FLOAT_TO_CHAN(rgba[i][ACOMP], lut[jA * 4 + 3]); } } else { |