summaryrefslogtreecommitdiffstats
path: root/src/mesa/tnl
diff options
context:
space:
mode:
authorBrian Paul <[email protected]>2001-01-02 22:02:51 +0000
committerBrian Paul <[email protected]>2001-01-02 22:02:51 +0000
commit3041d05bbcccfddba01a1eeaba01e5da0e1e99af (patch)
treee25361e01fdf7be6d75713235c7e130246be67f1 /src/mesa/tnl
parent8446d1bab15ef82b35b8980a0a56072ace6feb04 (diff)
Removed fixed.h (GLfixed now in mtypes.h, fixed-pt macros in mmath.h)
Clean-up of color conversion macros. New mmath.h macros (IROUND, IFLOOR, ICEIL, FRAC) used in various places.
Diffstat (limited to 'src/mesa/tnl')
-rw-r--r--src/mesa/tnl/t_imm_api.c40
-rw-r--r--src/mesa/tnl/t_imm_elt.c4
2 files changed, 22 insertions, 22 deletions
diff --git a/src/mesa/tnl/t_imm_api.c b/src/mesa/tnl/t_imm_api.c
index 6224bff3cba..528f1016612 100644
--- a/src/mesa/tnl/t_imm_api.c
+++ b/src/mesa/tnl/t_imm_api.c
@@ -347,9 +347,9 @@ _tnl_Color3f( GLfloat red, GLfloat green, GLfloat blue )
#if CHAN_BITS == 8
GLubyte col[4];
GET_IMMEDIATE;
- FLOAT_COLOR_TO_UBYTE_COLOR(col[0], red);
- FLOAT_COLOR_TO_UBYTE_COLOR(col[1], green);
- FLOAT_COLOR_TO_UBYTE_COLOR(col[2], blue);
+ UNCLAMPED_FLOAT_TO_UBYTE(col[0], red);
+ UNCLAMPED_FLOAT_TO_UBYTE(col[1], green);
+ UNCLAMPED_FLOAT_TO_UBYTE(col[2], blue);
col[3] = CHAN_MAX;
COLORV( IM, col );
#else
@@ -388,10 +388,10 @@ _tnl_Color4f( GLfloat red, GLfloat green, GLfloat blue, GLfloat alpha )
#if CHAN_BITS == 8
GLubyte col[4];
GET_IMMEDIATE;
- FLOAT_COLOR_TO_UBYTE_COLOR(col[0], red);
- FLOAT_COLOR_TO_UBYTE_COLOR(col[1], green);
- FLOAT_COLOR_TO_UBYTE_COLOR(col[2], blue);
- FLOAT_COLOR_TO_UBYTE_COLOR(col[3], alpha);
+ UNCLAMPED_FLOAT_TO_UBYTE(col[0], red);
+ UNCLAMPED_FLOAT_TO_UBYTE(col[1], green);
+ UNCLAMPED_FLOAT_TO_UBYTE(col[2], blue);
+ UNCLAMPED_FLOAT_TO_UBYTE(col[3], alpha);
COLORV( IM, col );
#else
GET_IMMEDIATE;
@@ -426,9 +426,9 @@ _tnl_Color3fv( const GLfloat *v )
#if CHAN_BITS == 8
GLubyte col[4];
GET_IMMEDIATE;
- FLOAT_COLOR_TO_UBYTE_COLOR(col[0], v[0]);
- FLOAT_COLOR_TO_UBYTE_COLOR(col[1], v[1]);
- FLOAT_COLOR_TO_UBYTE_COLOR(col[2], v[2]);
+ UNCLAMPED_FLOAT_TO_UBYTE(col[0], v[0]);
+ UNCLAMPED_FLOAT_TO_UBYTE(col[1], v[1]);
+ UNCLAMPED_FLOAT_TO_UBYTE(col[2], v[2]);
col[3] = CHAN_MAX;
COLORV( IM, col );
#else
@@ -466,10 +466,10 @@ _tnl_Color4fv( const GLfloat *v )
#if CHAN_BITS == 8
GLubyte col[4];
GET_IMMEDIATE;
- FLOAT_COLOR_TO_UBYTE_COLOR(col[0], v[0]);
- FLOAT_COLOR_TO_UBYTE_COLOR(col[1], v[1]);
- FLOAT_COLOR_TO_UBYTE_COLOR(col[2], v[2]);
- FLOAT_COLOR_TO_UBYTE_COLOR(col[3], v[3]);
+ UNCLAMPED_FLOAT_TO_UBYTE(col[0], v[0]);
+ UNCLAMPED_FLOAT_TO_UBYTE(col[1], v[1]);
+ UNCLAMPED_FLOAT_TO_UBYTE(col[2], v[2]);
+ UNCLAMPED_FLOAT_TO_UBYTE(col[3], v[3]);
COLORV( IM, col );
#else
GET_IMMEDIATE;
@@ -529,9 +529,9 @@ _tnl_SecondaryColor3fEXT( GLfloat red, GLfloat green, GLfloat blue )
#if CHAN_BITS == 8
GLubyte col[3];
GET_IMMEDIATE;
- FLOAT_COLOR_TO_UBYTE_COLOR(col[0], red);
- FLOAT_COLOR_TO_UBYTE_COLOR(col[1], green);
- FLOAT_COLOR_TO_UBYTE_COLOR(col[2], blue);
+ UNCLAMPED_FLOAT_TO_UBYTE(col[0], red);
+ UNCLAMPED_FLOAT_TO_UBYTE(col[1], green);
+ UNCLAMPED_FLOAT_TO_UBYTE(col[2], blue);
SECONDARY_COLORV( IM, col );
#else
GET_IMMEDIATE;
@@ -568,9 +568,9 @@ _tnl_SecondaryColor3fvEXT( const GLfloat *v )
#if CHAN_BITS == 8
GLubyte col[3];
GET_IMMEDIATE;
- FLOAT_COLOR_TO_UBYTE_COLOR(col[0], v[0]);
- FLOAT_COLOR_TO_UBYTE_COLOR(col[1], v[1]);
- FLOAT_COLOR_TO_UBYTE_COLOR(col[2], v[2]);
+ UNCLAMPED_FLOAT_TO_UBYTE(col[0], v[0]);
+ UNCLAMPED_FLOAT_TO_UBYTE(col[1], v[1]);
+ UNCLAMPED_FLOAT_TO_UBYTE(col[2], v[2]);
SECONDARY_COLORV( IM, col );
#else
GET_IMMEDIATE;
diff --git a/src/mesa/tnl/t_imm_elt.c b/src/mesa/tnl/t_imm_elt.c
index 67fbdbe907c..ec79c7e52be 100644
--- a/src/mesa/tnl/t_imm_elt.c
+++ b/src/mesa/tnl/t_imm_elt.c
@@ -1,4 +1,4 @@
-/* $Id: t_imm_elt.c,v 1.1 2000/12/26 05:09:32 keithw Exp $ */
+/* $Id: t_imm_elt.c,v 1.2 2001/01/02 22:02:53 brianp Exp $ */
/*
* Mesa 3-D graphics library
@@ -388,7 +388,7 @@ static trans_elt_4f_func _tnl_trans_elt_4f_tab[5][MAX_TYPES];
#define SRC_IDX TYPE_IDX(GL_DOUBLE)
#define TRX_3F(f,n) PTR_ELT(f,n)
#define TRX_4F(f,n) PTR_ELT(f,n)
-#define TRX_UB(ub,f,n) FLOAT_COLOR_TO_CHAN(ub, PTR_ELT(f,n))
+#define TRX_UB(ub,f,n) UNCLAMPED_FLOAT_TO_CHAN(ub, PTR_ELT(f,n))
#define TRX_UI(f,n) (GLuint) (GLint) PTR_ELT(f,n)
#define TRX_1F(f,n) PTR_ELT(f,n)