diff options
author | Brian Paul <brian.paul@tungstengraphics.com> | 2003-01-26 14:35:17 +0000 |
---|---|---|
committer | Brian Paul <brian.paul@tungstengraphics.com> | 2003-01-26 14:35:17 +0000 |
commit | 015c4787d7c231d2b2ee8d4bf739b98984af9ded (patch) | |
tree | 9b6fc249bb16efb2d61669e5189f153bb1257a79 | |
parent | 19c628d27992cec9ae9b950f984effd00877941b (diff) |
remove bad assertion, fix minor bug in _mesa_lookup_rgba()
-rw-r--r-- | src/mesa/main/pixel.c | 9 |
1 files changed, 4 insertions, 5 deletions
diff --git a/src/mesa/main/pixel.c b/src/mesa/main/pixel.c index 7ae50a7716..4f6a774d49 100644 --- a/src/mesa/main/pixel.c +++ b/src/mesa/main/pixel.c @@ -1,10 +1,10 @@ -/* $Id: pixel.c,v 1.37 2002/10/24 23:57:21 brianp Exp $ */ +/* $Id: pixel.c,v 1.37.2.1 2003/01/26 14:35:17 brianp Exp $ */ /* * Mesa 3-D graphics library - * Version: 4.1 + * Version: 5.0.1 * - * Copyright (C) 1999-2002 Brian Paul All Rights Reserved. + * Copyright (C) 1999-2003 Brian Paul All Rights Reserved. * * Permission is hereby granted, free of charge, to any person obtaining a * copy of this software and associated documentation files (the "Software"), @@ -899,11 +899,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; |