summaryrefslogtreecommitdiffstats
path: root/src/mesa
diff options
context:
space:
mode:
authorBrian Paul <[email protected]>2001-07-23 16:08:19 +0000
committerBrian Paul <[email protected]>2001-07-23 16:08:19 +0000
commit4fa5c1966a985f81c615a9f5ef2f64dd466b252a (patch)
treeb39e92d339b1d6c1cc6a0af829942c15ecb9db71 /src/mesa
parent55180f4b9216f8feb86dd6ecb4426fc6394c54b3 (diff)
don't clamp colors if GLchan==GLfloat in add_colors()
Diffstat (limited to 'src/mesa')
-rw-r--r--src/mesa/swrast/s_span.c9
1 files changed, 8 insertions, 1 deletions
diff --git a/src/mesa/swrast/s_span.c b/src/mesa/swrast/s_span.c
index a3e4e702f08..8e57296a09a 100644
--- a/src/mesa/swrast/s_span.c
+++ b/src/mesa/swrast/s_span.c
@@ -1,4 +1,4 @@
-/* $Id: s_span.c,v 1.15 2001/06/18 23:55:18 brianp Exp $ */
+/* $Id: s_span.c,v 1.16 2001/07/23 16:08:19 brianp Exp $ */
/*
* Mesa 3-D graphics library
@@ -777,12 +777,19 @@ add_colors(GLuint n, GLchan rgba[][4], CONST GLchan specular[][4] )
{
GLuint i;
for (i = 0; i < n; i++) {
+#if CHAN_TYPE == GL_FLOAT
+ /* no clamping */
+ rgba[i][RCOMP] += specular[i][RCOMP];
+ rgba[i][GCOMP] += specular[i][GCOMP];
+ rgba[i][BCOMP] += specular[i][BCOMP];
+#else
GLint r = rgba[i][RCOMP] + specular[i][RCOMP];
GLint g = rgba[i][GCOMP] + specular[i][GCOMP];
GLint b = rgba[i][BCOMP] + specular[i][BCOMP];
rgba[i][RCOMP] = (GLchan) MIN2(r, CHAN_MAX);
rgba[i][GCOMP] = (GLchan) MIN2(g, CHAN_MAX);
rgba[i][BCOMP] = (GLchan) MIN2(b, CHAN_MAX);
+#endif
}
}