aboutsummaryrefslogtreecommitdiffstats
path: root/src/mesa/tnl
diff options
context:
space:
mode:
Diffstat (limited to 'src/mesa/tnl')
-rw-r--r--src/mesa/tnl/t_imm_eval.c13
-rw-r--r--src/mesa/tnl/t_vb_lighttmp.h26
-rw-r--r--src/mesa/tnl/t_vb_render.c8
3 files changed, 24 insertions, 23 deletions
diff --git a/src/mesa/tnl/t_imm_eval.c b/src/mesa/tnl/t_imm_eval.c
index 419f449f033..235baa38b8b 100644
--- a/src/mesa/tnl/t_imm_eval.c
+++ b/src/mesa/tnl/t_imm_eval.c
@@ -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
@@ -154,13 +154,14 @@ static void eval1_color( GLvector4ub *dest,
GLubyte (*to)[4] = dest->data;
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)) {
GLfloat u = (coord[i][0] - u1) * du;
GLfloat fcolor[4];
_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;
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)) {
GLfloat u = (coord[i][0] - u1) * du;
GLfloat v = (coord[i][1] - v1) * dv;
GLfloat fcolor[4];
_math_horner_bezier_surf(map->Points, fcolor, u, v, 4,
map->Uorder, map->Vorder);
- FLOAT_RGBA_TO_CHAN_RGBA(to[i], fcolor);
+ UNCLAMPED_FLOAT_TO_RGBA_CHAN(to[i], fcolor);
}
-
+ }
}
diff --git a/src/mesa/tnl/t_vb_lighttmp.h b/src/mesa/tnl/t_vb_lighttmp.h
index f2bcde67148..656fffff1ad 100644
--- a/src/mesa/tnl/t_vb_lighttmp.h
+++ b/src/mesa/tnl/t_vb_lighttmp.h
@@ -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
@@ -269,13 +269,13 @@ static void TAG(light_rgba_spec)( GLcontext *ctx,
}
} /*loop over lights*/
- FLOAT_RGB_TO_CHAN_RGB( Fcolor[j], sum[0] );
- FLOAT_RGB_TO_CHAN_RGB( Fspec[j], spec[0] );
+ UNCLAMPED_FLOAT_TO_RGB_CHAN( Fcolor[j], sum[0] );
+ UNCLAMPED_FLOAT_TO_RGB_CHAN( Fspec[j], spec[0] );
Fcolor[j][3] = sumA[0];
if (IDX & LIGHT_TWOSIDE) {
- FLOAT_RGB_TO_CHAN_RGB( Bcolor[j], sum[1] );
- FLOAT_RGB_TO_CHAN_RGB( Bspec[j], spec[1] );
+ UNCLAMPED_FLOAT_TO_RGB_CHAN( Bcolor[j], sum[1] );
+ UNCLAMPED_FLOAT_TO_RGB_CHAN( Bspec[j], spec[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 );
}
- FLOAT_RGB_TO_CHAN_RGB( Fcolor[j], sum[0] );
+ UNCLAMPED_FLOAT_TO_RGB_CHAN( Fcolor[j], sum[0] );
Fcolor[j][3] = sumA[0];
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];
}
}
@@ -556,12 +556,12 @@ static void TAG(light_fast_rgba_single)( GLcontext *ctx,
{
COPY_3V(base[0], light->_MatAmbient[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) {
COPY_3V(base[1], light->_MatAmbient[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 );
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 {
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]);
}
- FLOAT_RGB_TO_CHAN_RGB(Fcolor[j], sum );
+ UNCLAMPED_FLOAT_TO_RGB_CHAN(Fcolor[j], sum );
}
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];
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];
}
diff --git a/src/mesa/tnl/t_vb_render.c b/src/mesa/tnl/t_vb_render.c
index 1d0a1aaf152..b3fef235019 100644
--- a/src/mesa/tnl/t_vb_render.c
+++ b/src/mesa/tnl/t_vb_render.c
@@ -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
@@ -119,19 +119,19 @@ do { \
#if 1
-#define LINTERP_RGBA(nr, t, out, a, b) { \
+#define LINTERP_RGBA(nr, t, out, a, b) { \
int i; \
for (i = 0; i < nr; i++) { \
GLfloat fa = CHAN_TO_FLOAT(a[i]); \
GLfloat fb = CHAN_TO_FLOAT(b[i]); \
GLfloat fo = LINTERP(t, fa, fb); \
- FLOAT_COLOR_TO_CHAN(out[i], fo); \
+ CLAMPED_FLOAT_TO_CHAN(out[i], fo); \
} \
}
#else
-#define LINTERP_RGBA(nr, t, out, a, b) { \
+#define LINTERP_RGBA(nr, t, out, a, b) { \
int n; \
const GLuint ti = FloatToInt(t*256.0F); \
const GLubyte *Ib = (const GLubyte *)&a[0]; \