summaryrefslogtreecommitdiffstats
path: root/src/mesa/drivers
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/drivers
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/drivers')
-rw-r--r--src/mesa/drivers/glide/fxdd.c8
-rw-r--r--src/mesa/drivers/glide/fxdrv.h10
-rw-r--r--src/mesa/drivers/osmesa/osmesa.c3
-rw-r--r--src/mesa/drivers/x11/xm_line.c3
-rw-r--r--src/mesa/drivers/x11/xm_tri.c3
5 files changed, 24 insertions, 3 deletions
diff --git a/src/mesa/drivers/glide/fxdd.c b/src/mesa/drivers/glide/fxdd.c
index 0f1ace3ee0d..306e0be3b96 100644
--- a/src/mesa/drivers/glide/fxdd.c
+++ b/src/mesa/drivers/glide/fxdd.c
@@ -63,6 +63,9 @@
#include "tnl/t_pipeline.h"
+
+float gl_ubyte_to_float_255_color_tab[256];
+
/* These lookup table are used to extract RGB values in [0,255] from
* 16-bit pixel values.
*/
@@ -667,8 +670,13 @@ static const struct gl_pipeline_stage *fx_pipeline[] = {
int fxDDInitFxMesaContext( fxMesaContext fxMesa )
{
+ int i;
static int firsttime = 1;
+ for (i = 0 ; i < 256 ; i++) {
+ gl_ubyte_to_float_255_color_tab[i] = (float) i;
+ }
+
if (firsttime) {
fxDDSetupInit();
fxDDTrifuncInit();
diff --git a/src/mesa/drivers/glide/fxdrv.h b/src/mesa/drivers/glide/fxdrv.h
index 2f62133221f..3e3147e3632 100644
--- a/src/mesa/drivers/glide/fxdrv.h
+++ b/src/mesa/drivers/glide/fxdrv.h
@@ -87,6 +87,16 @@
#define T1COORD GR_VERTEX_TOW_TMU1_OFFSET
+extern float gl_ubyte_to_float_255_color_tab[256];
+#define UBYTE_COLOR_TO_FLOAT_255_COLOR(c) gl_ubyte_to_float_255_color_tab[c]
+#define UBYTE_COLOR_TO_FLOAT_255_COLOR2(f,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).
*/
typedef union {
diff --git a/src/mesa/drivers/osmesa/osmesa.c b/src/mesa/drivers/osmesa/osmesa.c
index 1349ceecb5a..6148100e222 100644
--- a/src/mesa/drivers/osmesa/osmesa.c
+++ b/src/mesa/drivers/osmesa/osmesa.c
@@ -1,4 +1,4 @@
-/* $Id: osmesa.c,v 1.35 2000/12/26 05:09:30 keithw Exp $ */
+/* $Id: osmesa.c,v 1.36 2001/01/02 22:02:52 brianp Exp $ */
/*
* Mesa 3-D graphics library
@@ -45,6 +45,7 @@
#include "macros.h"
#include "mem.h"
#include "matrix.h"
+#include "mmath.h"
#include "mtypes.h"
#include "extensions.h"
#include "swrast/swrast.h"
diff --git a/src/mesa/drivers/x11/xm_line.c b/src/mesa/drivers/x11/xm_line.c
index a759d376bb4..c76de401c88 100644
--- a/src/mesa/drivers/x11/xm_line.c
+++ b/src/mesa/drivers/x11/xm_line.c
@@ -1,4 +1,4 @@
-/* $Id: xm_line.c,v 1.13 2000/12/13 16:24:40 brianp Exp $ */
+/* $Id: xm_line.c,v 1.14 2001/01/02 22:02:52 brianp Exp $ */
/*
* Mesa 3-D graphics library
@@ -35,6 +35,7 @@
#include "glxheader.h"
#include "depth.h"
#include "macros.h"
+#include "mmath.h"
#include "mtypes.h"
#include "xmesaP.h"
diff --git a/src/mesa/drivers/x11/xm_tri.c b/src/mesa/drivers/x11/xm_tri.c
index 09f1f7ce1c1..dbd252c50c6 100644
--- a/src/mesa/drivers/x11/xm_tri.c
+++ b/src/mesa/drivers/x11/xm_tri.c
@@ -1,4 +1,4 @@
-/* $Id: xm_tri.c,v 1.14 2000/12/13 16:24:39 brianp Exp $ */
+/* $Id: xm_tri.c,v 1.15 2001/01/02 22:02:52 brianp Exp $ */
/*
* Mesa 3-D graphics library
@@ -35,6 +35,7 @@
#include "glxheader.h"
#include "depth.h"
#include "macros.h"
+#include "mmath.h"
#include "mtypes.h"
#include "xmesaP.h"