More color macro clean-ups.

FLOAT_TO_CHAN() macro removed.
This commit is contained in:
Brian Paul
2001-01-03 15:59:30 +00:00
parent 3b399df638
commit 6532db9868
10 changed files with 75 additions and 63 deletions

View File

@@ -93,8 +93,6 @@ extern float gl_ubyte_to_float_255_color_tab[256];
(*(int *)&(f)) = ((int *)gl_ubyte_to_float_255_color_tab)[c] (*(int *)&(f)) = ((int *)gl_ubyte_to_float_255_color_tab)[c]
#define LINTERP(T, A, B) ((A) + (T) * ((B) - (A)))
/* Should have size == 16 * sizeof(float). /* Should have size == 16 * sizeof(float).

View File

@@ -1,4 +1,4 @@
/* $Id: colormac.h,v 1.5 2001/01/02 22:02:51 brianp Exp $ */ /* $Id: colormac.h,v 1.6 2001/01/03 15:59:30 brianp Exp $ */
/* /*
* Mesa 3-D graphics library * Mesa 3-D graphics library
@@ -52,7 +52,6 @@
#define UINT_TO_CHAN(i) ((GLchan) ((i) >> 24)) #define UINT_TO_CHAN(i) ((GLchan) ((i) >> 24))
#define CHAN_TO_FLOAT(c) UBYTE_TO_FLOAT(c) #define CHAN_TO_FLOAT(c) UBYTE_TO_FLOAT(c)
#define FLOAT_TO_CHAN(f) ( (GLchan) IROUND((f) * CHAN_MAXF) )
#define CLAMPED_FLOAT_TO_CHAN(c, f) CLAMPED_FLOAT_TO_UBYTE(c, f) #define CLAMPED_FLOAT_TO_CHAN(c, f) CLAMPED_FLOAT_TO_UBYTE(c, f)
#define UNCLAMPED_FLOAT_TO_CHAN(c, f) UNCLAMPED_FLOAT_TO_UBYTE(c, f) #define UNCLAMPED_FLOAT_TO_CHAN(c, f) UNCLAMPED_FLOAT_TO_UBYTE(c, f)
@@ -72,7 +71,6 @@
#define UINT_TO_CHAN(i) ((GLchan) ((i) >> 16)) #define UINT_TO_CHAN(i) ((GLchan) ((i) >> 16))
#define CHAN_TO_FLOAT(c) ((GLfloat) ((c) * (1.0 / CHAN_MAXF) + 0.5F)) #define CHAN_TO_FLOAT(c) ((GLfloat) ((c) * (1.0 / CHAN_MAXF) + 0.5F))
#define FLOAT_TO_CHAN(f) ((GLchan) IROUND((f) * CHAN_MAXF))
#define CLAMPED_FLOAT_TO_CHAN(c, f) \ #define CLAMPED_FLOAT_TO_CHAN(c, f) \
c = ((GLchan) IROUND((f) * CHAN_MAXF)) c = ((GLchan) IROUND((f) * CHAN_MAXF))
@@ -95,9 +93,8 @@
#define UINT_TO_CHAN(i) ((GLfloat) ((i) * (1.0F / 4294967295.0F))) #define UINT_TO_CHAN(i) ((GLfloat) ((i) * (1.0F / 4294967295.0F)))
#define CHAN_TO_FLOAT(c) (c) #define CHAN_TO_FLOAT(c) (c)
#define FLOAT_TO_CHAN(f) (f)
#define CLAMPED_FLOAT_COLOR_TO_CHAN(c, f) c = (f) #define CLAMPED_FLOAT_TO_CHAN(c, f) c = (f)
#define UNCLAMPED_FLOAT_TO_CHAN(c, f) c = (f) #define UNCLAMPED_FLOAT_TO_CHAN(c, f) c = (f)
#define COPY_CHAN4(DST, SRC) COPY_4V(DST, SRC) #define COPY_CHAN4(DST, SRC) COPY_4V(DST, SRC)
@@ -115,7 +112,7 @@
/* /*
* Convert 3 channels at once. * Convert 3 channels at once.
*/ */
#define FLOAT_RGB_TO_CHAN_RGB(dst, f) \ #define UNCLAMPED_FLOAT_TO_RGB_CHAN(dst, f) \
do { \ do { \
UNCLAMPED_FLOAT_TO_CHAN(dst[0], f[0]); \ UNCLAMPED_FLOAT_TO_CHAN(dst[0], f[0]); \
UNCLAMPED_FLOAT_TO_CHAN(dst[1], f[1]); \ UNCLAMPED_FLOAT_TO_CHAN(dst[1], f[1]); \
@@ -123,4 +120,16 @@ do { \
} while (0) } while (0)
/*
* Convert 4 channels at once.
*/
#define UNCLAMPED_FLOAT_TO_RGBA_CHAN(dst, f) \
do { \
UNCLAMPED_FLOAT_TO_CHAN(dst[0], f[0]); \
UNCLAMPED_FLOAT_TO_CHAN(dst[1], f[1]); \
UNCLAMPED_FLOAT_TO_CHAN(dst[2], f[2]); \
UNCLAMPED_FLOAT_TO_CHAN(dst[3], f[3]); \
} while (0)
#endif /* COLORMAC_H */ #endif /* COLORMAC_H */

View File

@@ -1,4 +1,4 @@
/* $Id: image.c,v 1.51 2001/01/02 22:02:51 brianp Exp $ */ /* $Id: image.c,v 1.52 2001/01/03 15:59:30 brianp Exp $ */
/* /*
* Mesa 3-D graphics library * Mesa 3-D graphics library
@@ -2721,7 +2721,7 @@ _mesa_unpack_chan_color_span( GLcontext *ctx,
GLchan *dst = dest; GLchan *dst = dest;
GLuint i; GLuint i;
for (i = 0; i < n; i++) { for (i = 0; i < n; i++) {
dst[dstRedIndex] = FLOAT_TO_CHAN(rgba[i][RCOMP]); CLAMPED_FLOAT_TO_CHAN(dst[dstRedIndex], rgba[i][RCOMP]);
dst += dstComponents; dst += dstComponents;
} }
} }
@@ -2730,7 +2730,7 @@ _mesa_unpack_chan_color_span( GLcontext *ctx,
GLchan *dst = dest; GLchan *dst = dest;
GLuint i; GLuint i;
for (i = 0; i < n; i++) { for (i = 0; i < n; i++) {
dst[dstGreenIndex] = FLOAT_TO_CHAN(rgba[i][GCOMP]); CLAMPED_FLOAT_TO_CHAN(dst[dstGreenIndex], rgba[i][GCOMP]);
dst += dstComponents; dst += dstComponents;
} }
} }
@@ -2739,7 +2739,7 @@ _mesa_unpack_chan_color_span( GLcontext *ctx,
GLchan *dst = dest; GLchan *dst = dest;
GLuint i; GLuint i;
for (i = 0; i < n; i++) { for (i = 0; i < n; i++) {
dst[dstBlueIndex] = FLOAT_TO_CHAN(rgba[i][BCOMP]); CLAMPED_FLOAT_TO_CHAN(dst[dstBlueIndex], rgba[i][BCOMP]);
dst += dstComponents; dst += dstComponents;
} }
} }
@@ -2748,7 +2748,7 @@ _mesa_unpack_chan_color_span( GLcontext *ctx,
GLchan *dst = dest; GLchan *dst = dest;
GLuint i; GLuint i;
for (i = 0; i < n; i++) { for (i = 0; i < n; i++) {
dst[dstAlphaIndex] = FLOAT_TO_CHAN(rgba[i][ACOMP]); CLAMPED_FLOAT_TO_CHAN(dst[dstAlphaIndex], rgba[i][ACOMP]);
dst += dstComponents; dst += dstComponents;
} }
} }
@@ -2760,7 +2760,7 @@ _mesa_unpack_chan_color_span( GLcontext *ctx,
assert(dstComponents == 1); assert(dstComponents == 1);
for (i = 0; i < n; i++) { for (i = 0; i < n; i++) {
/* Intensity comes from red channel */ /* Intensity comes from red channel */
dst[i] = FLOAT_TO_CHAN(rgba[i][RCOMP]); CLAMPED_FLOAT_TO_CHAN(dst[i], rgba[i][RCOMP]);
} }
} }
@@ -2770,7 +2770,7 @@ _mesa_unpack_chan_color_span( GLcontext *ctx,
assert(dstLuminanceIndex == 0); assert(dstLuminanceIndex == 0);
for (i = 0; i < n; i++) { for (i = 0; i < n; i++) {
/* Luminance comes from red channel */ /* Luminance comes from red channel */
dst[0] = FLOAT_TO_CHAN(rgba[i][RCOMP]); CLAMPED_FLOAT_TO_CHAN(dst[0], rgba[i][RCOMP]);
dst += dstComponents; dst += dstComponents;
} }
} }

View File

@@ -1,4 +1,4 @@
/* $Id: pixel.c,v 1.22 2000/12/26 05:09:29 keithw Exp $ */ /* $Id: pixel.c,v 1.23 2001/01/03 15:59:30 brianp Exp $ */
/* /*
* Mesa 3-D graphics library * Mesa 3-D graphics library
@@ -1126,10 +1126,10 @@ _mesa_map_ci_to_rgba_chan( const GLcontext *ctx, GLuint n,
const GLfloat *aMap = ctx->Pixel.MapItoA; const GLfloat *aMap = ctx->Pixel.MapItoA;
GLuint i; GLuint i;
for (i=0;i<n;i++) { for (i=0;i<n;i++) {
rgba[i][RCOMP] = FLOAT_TO_CHAN(rMap[index[i] & rmask]); CLAMPED_FLOAT_TO_CHAN(rgba[i][RCOMP], rMap[index[i] & rmask]);
rgba[i][GCOMP] = FLOAT_TO_CHAN(gMap[index[i] & gmask]); CLAMPED_FLOAT_TO_CHAN(rgba[i][GCOMP], gMap[index[i] & gmask]);
rgba[i][BCOMP] = FLOAT_TO_CHAN(bMap[index[i] & bmask]); CLAMPED_FLOAT_TO_CHAN(rgba[i][BCOMP], bMap[index[i] & bmask]);
rgba[i][ACOMP] = FLOAT_TO_CHAN(aMap[index[i] & amask]); CLAMPED_FLOAT_TO_CHAN(rgba[i][ACOMP], aMap[index[i] & amask]);
} }
#endif #endif
} }
@@ -1194,10 +1194,10 @@ _mesa_map_ci8_to_rgba( const GLcontext *ctx, GLuint n, const GLubyte index[],
const GLfloat *aMap = ctx->Pixel.MapItoA; const GLfloat *aMap = ctx->Pixel.MapItoA;
GLuint i; GLuint i;
for (i=0;i<n;i++) { for (i=0;i<n;i++) {
rgba[i][RCOMP] = FLOAT_TO_CHAN(rMap[index[i] & rmask]); CLAMPED_FLOAT_TO_CHAN(rgba[i][RCOMP], rMap[index[i] & rmask]);
rgba[i][GCOMP] = FLOAT_TO_CHAN(gMap[index[i] & gmask]); CLAMPED_FLOAT_TO_CHAN(rgba[i][GCOMP], gMap[index[i] & gmask]);
rgba[i][BCOMP] = FLOAT_TO_CHAN(bMap[index[i] & bmask]); CLAMPED_FLOAT_TO_CHAN(rgba[i][BCOMP], bMap[index[i] & bmask]);
rgba[i][ACOMP] = FLOAT_TO_CHAN(aMap[index[i] & amask]); CLAMPED_FLOAT_TO_CHAN(rgba[i][ACOMP], aMap[index[i] & amask]);
} }
#endif #endif
} }

View File

@@ -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 * Mesa 3-D graphics library
@@ -605,11 +605,12 @@ draw_depth_pixels( GLcontext *ctx, GLint x, GLint y,
/* Colors or indexes */ /* Colors or indexes */
if (ctx->Visual.RGBAflag) { 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 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++) { for (i = 0; i < drawWidth; i++) {
rgba[i][RCOMP] = r; rgba[i][RCOMP] = r;
rgba[i][GCOMP] = g; rgba[i][GCOMP] = g;

View File

@@ -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 * Mesa 3-D graphics library
@@ -49,10 +49,12 @@ _mesa_fog_rgba_pixels( const GLcontext *ctx,
const GLfixed fog[], const GLfixed fog[],
GLchan rgba[][4] ) 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; 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 #if CHAN_TYPE == GL_FLOAT
for (i = 0; i < n; i++) { for (i = 0; i < n; i++) {

View File

@@ -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 * Mesa 3-D graphics library
@@ -1841,8 +1841,8 @@ _mesa_texture_combine(const GLcontext *ctx,
break; break;
case GL_CONSTANT_EXT: case GL_CONSTANT_EXT:
{ {
GLchan (*c)[4] = ccolor[j]; GLchan alpha, (*c)[4] = ccolor[j];
GLchan alpha = FLOAT_TO_CHAN(textureUnit->EnvColor[3]); UNCLAMPED_FLOAT_TO_CHAN(alpha, textureUnit->EnvColor[3]);
for (i = 0; i < n; i++) for (i = 0; i < n; i++)
c[i][ACOMP] = alpha; c[i][ACOMP] = alpha;
argA[j] = ccolor[j]; argA[j] = ccolor[j];
@@ -1865,9 +1865,10 @@ _mesa_texture_combine(const GLcontext *ctx,
case GL_CONSTANT_EXT: case GL_CONSTANT_EXT:
{ {
GLchan (*c)[4] = ccolor[j]; GLchan (*c)[4] = ccolor[j];
const GLchan red = FLOAT_TO_CHAN(textureUnit->EnvColor[0]); GLchan red, green, blue;
const GLchan green = FLOAT_TO_CHAN(textureUnit->EnvColor[1]); UNCLAMPED_FLOAT_TO_CHAN(red, textureUnit->EnvColor[0]);
const GLchan blue = FLOAT_TO_CHAN(textureUnit->EnvColor[2]); UNCLAMPED_FLOAT_TO_CHAN(green, textureUnit->EnvColor[1]);
UNCLAMPED_FLOAT_TO_CHAN(blue, textureUnit->EnvColor[2]);
for (i = 0; i < n; i++) { for (i = 0; i < n; i++) {
c[i][RCOMP] = red; c[i][RCOMP] = red;
c[i][GCOMP] = green; c[i][GCOMP] = green;

View File

@@ -1,4 +1,4 @@
/* $Id: t_imm_eval.c,v 1.2 2000/12/27 22:30:29 keithw Exp $ */ /* $Id: t_imm_eval.c,v 1.3 2001/01/03 15:59:30 brianp Exp $ */
/* /*
* Mesa 3-D graphics library * Mesa 3-D graphics library
@@ -154,12 +154,13 @@ static void eval1_color( GLvector4ub *dest,
GLubyte (*to)[4] = dest->data; GLubyte (*to)[4] = dest->data;
GLuint i; GLuint i;
for (i = 0 ; !(flags[i] & VERT_END_VB) ; i++) for (i = 0 ; !(flags[i] & VERT_END_VB) ; i++) {
if (flags[i] & (VERT_EVAL_C1|VERT_EVAL_P1)) { if (flags[i] & (VERT_EVAL_C1|VERT_EVAL_P1)) {
GLfloat u = (coord[i][0] - u1) * du; GLfloat u = (coord[i][0] - u1) * du;
GLfloat fcolor[4]; GLfloat fcolor[4];
_math_horner_bezier_curve(map->Points, fcolor, u, 4, map->Order); _math_horner_bezier_curve(map->Points, fcolor, u, 4, map->Order);
FLOAT_RGBA_TO_CHAN_RGBA(to[i], fcolor); UNCLAMPED_FLOAT_TO_RGBA_CHAN(to[i], fcolor);
}
} }
} }
@@ -287,16 +288,16 @@ static void eval2_color( GLvector4ub *dest,
GLubyte (*to)[4] = dest->data; GLubyte (*to)[4] = dest->data;
GLuint i; GLuint i;
for (i = 0 ; !(flags[i] & VERT_END_VB) ; i++) for (i = 0 ; !(flags[i] & VERT_END_VB) ; i++) {
if (flags[i] & (VERT_EVAL_C2|VERT_EVAL_P2)) { if (flags[i] & (VERT_EVAL_C2|VERT_EVAL_P2)) {
GLfloat u = (coord[i][0] - u1) * du; GLfloat u = (coord[i][0] - u1) * du;
GLfloat v = (coord[i][1] - v1) * dv; GLfloat v = (coord[i][1] - v1) * dv;
GLfloat fcolor[4]; GLfloat fcolor[4];
_math_horner_bezier_surf(map->Points, fcolor, u, v, 4, _math_horner_bezier_surf(map->Points, fcolor, u, v, 4,
map->Uorder, map->Vorder); map->Uorder, map->Vorder);
FLOAT_RGBA_TO_CHAN_RGBA(to[i], fcolor); UNCLAMPED_FLOAT_TO_RGBA_CHAN(to[i], fcolor);
}
} }
} }

View File

@@ -1,4 +1,4 @@
/* $Id: t_vb_lighttmp.h,v 1.1 2000/12/26 05:09:33 keithw Exp $ */ /* $Id: t_vb_lighttmp.h,v 1.2 2001/01/03 15:59:30 brianp Exp $ */
/* /*
* Mesa 3-D graphics library * Mesa 3-D graphics library
@@ -269,13 +269,13 @@ static void TAG(light_rgba_spec)( GLcontext *ctx,
} }
} /*loop over lights*/ } /*loop over lights*/
FLOAT_RGB_TO_CHAN_RGB( Fcolor[j], sum[0] ); UNCLAMPED_FLOAT_TO_RGB_CHAN( Fcolor[j], sum[0] );
FLOAT_RGB_TO_CHAN_RGB( Fspec[j], spec[0] ); UNCLAMPED_FLOAT_TO_RGB_CHAN( Fspec[j], spec[0] );
Fcolor[j][3] = sumA[0]; Fcolor[j][3] = sumA[0];
if (IDX & LIGHT_TWOSIDE) { if (IDX & LIGHT_TWOSIDE) {
FLOAT_RGB_TO_CHAN_RGB( Bcolor[j], sum[1] ); UNCLAMPED_FLOAT_TO_RGB_CHAN( Bcolor[j], sum[1] );
FLOAT_RGB_TO_CHAN_RGB( Bspec[j], spec[1] ); UNCLAMPED_FLOAT_TO_RGB_CHAN( Bspec[j], spec[1] );
Bcolor[j][3] = sumA[1]; Bcolor[j][3] = sumA[1];
} }
} }
@@ -475,11 +475,11 @@ static void TAG(light_rgba)( GLcontext *ctx,
ACC_SCALE_SCALAR_3V( sum[side], attenuation, contrib ); ACC_SCALE_SCALAR_3V( sum[side], attenuation, contrib );
} }
FLOAT_RGB_TO_CHAN_RGB( Fcolor[j], sum[0] ); UNCLAMPED_FLOAT_TO_RGB_CHAN( Fcolor[j], sum[0] );
Fcolor[j][3] = sumA[0]; Fcolor[j][3] = sumA[0];
if (IDX & LIGHT_TWOSIDE) { if (IDX & LIGHT_TWOSIDE) {
FLOAT_RGB_TO_CHAN_RGB( Bcolor[j], sum[1] ); UNCLAMPED_FLOAT_TO_RGB_CHAN( Bcolor[j], sum[1] );
Bcolor[j][3] = sumA[1]; Bcolor[j][3] = sumA[1];
} }
} }
@@ -556,12 +556,12 @@ static void TAG(light_fast_rgba_single)( GLcontext *ctx,
{ {
COPY_3V(base[0], light->_MatAmbient[0]); COPY_3V(base[0], light->_MatAmbient[0]);
ACC_3V(base[0], ctx->Light._BaseColor[0] ); ACC_3V(base[0], ctx->Light._BaseColor[0] );
FLOAT_RGB_TO_CHAN_RGB( baseubyte[0], base[0] ); UNCLAMPED_FLOAT_TO_RGB_CHAN( baseubyte[0], base[0] );
if (IDX & LIGHT_TWOSIDE) { if (IDX & LIGHT_TWOSIDE) {
COPY_3V(base[1], light->_MatAmbient[1]); COPY_3V(base[1], light->_MatAmbient[1]);
ACC_3V(base[1], ctx->Light._BaseColor[1]); ACC_3V(base[1], ctx->Light._BaseColor[1]);
FLOAT_RGB_TO_CHAN_RGB( baseubyte[1], base[1]); UNCLAMPED_FLOAT_TO_RGB_CHAN( baseubyte[1], base[1]);
} }
} }
@@ -582,7 +582,7 @@ static void TAG(light_fast_rgba_single)( GLcontext *ctx,
GET_SHINE_TAB_ENTRY( ctx->_ShineTable[1], n_dot_h, spec ); GET_SHINE_TAB_ENTRY( ctx->_ShineTable[1], n_dot_h, spec );
ACC_SCALE_SCALAR_3V(sum, spec, light->_MatSpecular[1]); ACC_SCALE_SCALAR_3V(sum, spec, light->_MatSpecular[1]);
} }
FLOAT_RGB_TO_CHAN_RGB(Bcolor[j], sum ); UNCLAMPED_FLOAT_TO_RGB_CHAN(Bcolor[j], sum );
} }
} else { } else {
GLfloat n_dot_h = DOT3(normal, light->_h_inf_norm); GLfloat n_dot_h = DOT3(normal, light->_h_inf_norm);
@@ -595,7 +595,7 @@ static void TAG(light_fast_rgba_single)( GLcontext *ctx,
ACC_SCALE_SCALAR_3V(sum, spec, light->_MatSpecular[0]); ACC_SCALE_SCALAR_3V(sum, spec, light->_MatSpecular[0]);
} }
FLOAT_RGB_TO_CHAN_RGB(Fcolor[j], sum ); UNCLAMPED_FLOAT_TO_RGB_CHAN(Fcolor[j], sum );
} }
j++; j++;
@@ -709,11 +709,11 @@ static void TAG(light_fast_rgba)( GLcontext *ctx,
} }
} }
FLOAT_RGB_TO_CHAN_RGB( Fcolor[j], sum[0] ); UNCLAMPED_FLOAT_TO_RGB_CHAN( Fcolor[j], sum[0] );
Fcolor[j][3] = sumA[0]; Fcolor[j][3] = sumA[0];
if (IDX & LIGHT_TWOSIDE) { if (IDX & LIGHT_TWOSIDE) {
FLOAT_RGB_TO_CHAN_RGB( Bcolor[j], sum[1] ); UNCLAMPED_FLOAT_TO_RGB_CHAN( Bcolor[j], sum[1] );
Bcolor[j][3] = sumA[1]; Bcolor[j][3] = sumA[1];
} }

View File

@@ -1,4 +1,4 @@
/* $Id: t_vb_render.c,v 1.4 2000/12/28 22:11:06 keithw Exp $ */ /* $Id: t_vb_render.c,v 1.5 2001/01/03 15:59:31 brianp Exp $ */
/* /*
* Mesa 3-D graphics library * Mesa 3-D graphics library
@@ -125,7 +125,7 @@ do { \
GLfloat fa = CHAN_TO_FLOAT(a[i]); \ GLfloat fa = CHAN_TO_FLOAT(a[i]); \
GLfloat fb = CHAN_TO_FLOAT(b[i]); \ GLfloat fb = CHAN_TO_FLOAT(b[i]); \
GLfloat fo = LINTERP(t, fa, fb); \ GLfloat fo = LINTERP(t, fa, fb); \
FLOAT_COLOR_TO_CHAN(out[i], fo); \ CLAMPED_FLOAT_TO_CHAN(out[i], fo); \
} \ } \
} }