mirror of
https://gitlab.freedesktop.org/mesa/mesa.git
synced 2026-05-07 07:08:04 +02:00
remove bad assertion, fix minor bug in _mesa_lookup_rgba()
This commit is contained in:
parent
9067c26e5d
commit
7cac85d00a
1 changed files with 2 additions and 4 deletions
|
|
@ -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
|
* Mesa 3-D graphics library
|
||||||
|
|
@ -885,7 +885,6 @@ void
|
||||||
_mesa_lookup_rgba(const struct gl_color_table *table,
|
_mesa_lookup_rgba(const struct gl_color_table *table,
|
||||||
GLuint n, GLfloat rgba[][4])
|
GLuint n, GLfloat rgba[][4])
|
||||||
{
|
{
|
||||||
ASSERT(table->FloatTable);
|
|
||||||
if (!table->Table || table->Size == 0)
|
if (!table->Table || table->Size == 0)
|
||||||
return;
|
return;
|
||||||
|
|
||||||
|
|
@ -899,11 +898,10 @@ _mesa_lookup_rgba(const struct gl_color_table *table,
|
||||||
GLuint i;
|
GLuint i;
|
||||||
for (i = 0; i < n; i++) {
|
for (i = 0; i < n; i++) {
|
||||||
GLint j = IROUND(rgba[i][RCOMP] * scale);
|
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][RCOMP] = rgba[i][GCOMP] =
|
||||||
rgba[i][BCOMP] = rgba[i][ACOMP] = c;
|
rgba[i][BCOMP] = rgba[i][ACOMP] = c;
|
||||||
}
|
}
|
||||||
|
|
||||||
}
|
}
|
||||||
else {
|
else {
|
||||||
const GLint max = table->Size - 1;
|
const GLint max = table->Size - 1;
|
||||||
|
|
|
||||||
Loading…
Add table
Reference in a new issue