diff options
author | Brian Paul <[email protected]> | 2003-01-26 14:34:56 +0000 |
---|---|---|
committer | Brian Paul <[email protected]> | 2003-01-26 14:34:56 +0000 |
commit | 7cac85d00a6110aa92236b2e841faeeb34f684c1 (patch) | |
tree | d23c84ffb6d65ca04a097248d2131e378afaa299 /src/mesa/main/pixel.c | |
parent | 9067c26e5dd2ad367c0c4aa4872e08c7790a30bb (diff) |
remove bad assertion, fix minor bug in _mesa_lookup_rgba()
Diffstat (limited to 'src/mesa/main/pixel.c')
-rw-r--r-- | src/mesa/main/pixel.c | 6 |
1 files changed, 2 insertions, 4 deletions
diff --git a/src/mesa/main/pixel.c b/src/mesa/main/pixel.c index 7ae50a77165..cec1982ca3d 100644 --- a/src/mesa/main/pixel.c +++ b/src/mesa/main/pixel.c @@ -1,4 +1,4 @@ -/* $Id: pixel.c,v 1.37 2002/10/24 23:57:21 brianp Exp $ */ +/* $Id: pixel.c,v 1.38 2003/01/26 14:34:56 brianp Exp $ */ /* * Mesa 3-D graphics library @@ -885,7 +885,6 @@ void _mesa_lookup_rgba(const struct gl_color_table *table, GLuint n, GLfloat rgba[][4]) { - ASSERT(table->FloatTable); if (!table->Table || table->Size == 0) return; @@ -899,11 +898,10 @@ _mesa_lookup_rgba(const struct gl_color_table *table, GLuint i; for (i = 0; i < n; i++) { GLint j = IROUND(rgba[i][RCOMP] * scale); - GLfloat c = CHAN_TO_FLOAT(lut[CLAMP(j, 0, 1)]); + GLfloat c = CHAN_TO_FLOAT(lut[CLAMP(j, 0, max)]); rgba[i][RCOMP] = rgba[i][GCOMP] = rgba[i][BCOMP] = rgba[i][ACOMP] = c; } - } else { const GLint max = table->Size - 1; |