diff options
Diffstat (limited to 'src/mesa/swrast')
-rw-r--r-- | src/mesa/swrast/s_drawpix.c | 11 | ||||
-rw-r--r-- | src/mesa/swrast/s_fog.c | 10 | ||||
-rw-r--r-- | src/mesa/swrast/s_texture.c | 13 |
3 files changed, 19 insertions, 15 deletions
diff --git a/src/mesa/swrast/s_drawpix.c b/src/mesa/swrast/s_drawpix.c index ccb48a7ef95..63281b2f730 100644 --- a/src/mesa/swrast/s_drawpix.c +++ b/src/mesa/swrast/s_drawpix.c @@ -1,4 +1,4 @@ -/* $Id: s_drawpix.c,v 1.5 2000/12/26 05:09:32 keithw Exp $ */ +/* $Id: s_drawpix.c,v 1.6 2001/01/03 15:59:30 brianp Exp $ */ /* * Mesa 3-D graphics library @@ -605,11 +605,12 @@ draw_depth_pixels( GLcontext *ctx, GLint x, GLint y, /* Colors or indexes */ if (ctx->Visual.RGBAflag) { - GLint r = FLOAT_TO_CHAN(ctx->Current.RasterColor[0]); - GLint g = FLOAT_TO_CHAN(ctx->Current.RasterColor[1]); - GLint b = FLOAT_TO_CHAN(ctx->Current.RasterColor[2]); - GLint a = FLOAT_TO_CHAN(ctx->Current.RasterColor[3]); GLint i; + GLint r, g, b, a; + UNCLAMPED_FLOAT_TO_CHAN(r, ctx->Current.RasterColor[0]); + UNCLAMPED_FLOAT_TO_CHAN(g, ctx->Current.RasterColor[1]); + UNCLAMPED_FLOAT_TO_CHAN(b, ctx->Current.RasterColor[2]); + UNCLAMPED_FLOAT_TO_CHAN(a, ctx->Current.RasterColor[3]); for (i = 0; i < drawWidth; i++) { rgba[i][RCOMP] = r; rgba[i][GCOMP] = g; diff --git a/src/mesa/swrast/s_fog.c b/src/mesa/swrast/s_fog.c index 0e65f784f8e..6e6c207aa4a 100644 --- a/src/mesa/swrast/s_fog.c +++ b/src/mesa/swrast/s_fog.c @@ -1,4 +1,4 @@ -/* $Id: s_fog.c,v 1.6 2001/01/02 21:09:50 brianp Exp $ */ +/* $Id: s_fog.c,v 1.7 2001/01/03 15:59:30 brianp Exp $ */ /* * Mesa 3-D graphics library @@ -49,10 +49,12 @@ _mesa_fog_rgba_pixels( const GLcontext *ctx, const GLfixed fog[], GLchan rgba[][4] ) { - const GLchan rFog = FLOAT_TO_CHAN(ctx->Fog.Color[RCOMP]); - const GLchan gFog = FLOAT_TO_CHAN(ctx->Fog.Color[GCOMP]); - const GLchan bFog = FLOAT_TO_CHAN(ctx->Fog.Color[BCOMP]); GLuint i; + GLchan rFog, gFog, bFog; + + UNCLAMPED_FLOAT_TO_CHAN(rFog, ctx->Fog.Color[RCOMP]); + UNCLAMPED_FLOAT_TO_CHAN(gFog, ctx->Fog.Color[GCOMP]); + UNCLAMPED_FLOAT_TO_CHAN(bFog, ctx->Fog.Color[BCOMP]); #if CHAN_TYPE == GL_FLOAT for (i = 0; i < n; i++) { diff --git a/src/mesa/swrast/s_texture.c b/src/mesa/swrast/s_texture.c index bcc5f2677d9..29d6b46f4db 100644 --- a/src/mesa/swrast/s_texture.c +++ b/src/mesa/swrast/s_texture.c @@ -1,4 +1,4 @@ -/* $Id: s_texture.c,v 1.5 2001/01/02 22:02:52 brianp Exp $ */ +/* $Id: s_texture.c,v 1.6 2001/01/03 15:59:30 brianp Exp $ */ /* * Mesa 3-D graphics library @@ -1841,8 +1841,8 @@ _mesa_texture_combine(const GLcontext *ctx, break; case GL_CONSTANT_EXT: { - GLchan (*c)[4] = ccolor[j]; - GLchan alpha = FLOAT_TO_CHAN(textureUnit->EnvColor[3]); + GLchan alpha, (*c)[4] = ccolor[j]; + UNCLAMPED_FLOAT_TO_CHAN(alpha, textureUnit->EnvColor[3]); for (i = 0; i < n; i++) c[i][ACOMP] = alpha; argA[j] = ccolor[j]; @@ -1865,9 +1865,10 @@ _mesa_texture_combine(const GLcontext *ctx, case GL_CONSTANT_EXT: { GLchan (*c)[4] = ccolor[j]; - const GLchan red = FLOAT_TO_CHAN(textureUnit->EnvColor[0]); - const GLchan green = FLOAT_TO_CHAN(textureUnit->EnvColor[1]); - const GLchan blue = FLOAT_TO_CHAN(textureUnit->EnvColor[2]); + GLchan red, green, blue; + UNCLAMPED_FLOAT_TO_CHAN(red, textureUnit->EnvColor[0]); + UNCLAMPED_FLOAT_TO_CHAN(green, textureUnit->EnvColor[1]); + UNCLAMPED_FLOAT_TO_CHAN(blue, textureUnit->EnvColor[2]); for (i = 0; i < n; i++) { c[i][RCOMP] = red; c[i][GCOMP] = green; |