summaryrefslogtreecommitdiff
path: root/src/mesa/main
diff options
context:
space:
mode:
authorKeith Whitwell <keith@tungstengraphics.com>2001-02-06 04:06:34 +0000
committerKeith Whitwell <keith@tungstengraphics.com>2001-02-06 04:06:34 +0000
commitd1baa05439c7157eeca42ec191d5375821725bdd (patch)
treebfd3ff31b803f177d678ab3b6783b876c1938fec /src/mesa/main
parent8fd9f1748d12751683cf8039401a7f7f66ab73fa (diff)
Use a lookup table to compute exponents in tnl fogging code. Slightly
clean up the shine table lookup macro.
Diffstat (limited to 'src/mesa/main')
-rw-r--r--src/mesa/main/dd.h10
-rw-r--r--src/mesa/main/imports.c4
-rw-r--r--src/mesa/main/light.h11
3 files changed, 12 insertions, 13 deletions
diff --git a/src/mesa/main/dd.h b/src/mesa/main/dd.h
index 542f866ff6..417beed91d 100644
--- a/src/mesa/main/dd.h
+++ b/src/mesa/main/dd.h
@@ -1,4 +1,4 @@
-/* $Id: dd.h,v 1.49 2001/01/29 20:47:39 keithw Exp $ */
+/* $Id: dd.h,v 1.50 2001/02/06 04:06:34 keithw Exp $ */
/*
* Mesa 3-D graphics library
@@ -900,12 +900,13 @@ struct dd_function_table {
#define PRIM_UNKNOWN GL_POLYGON+3
GLuint CurrentExecPrimitive;
- /* Set by the driver-supplied t&l engine. Set to GL_POLYGON+1 when
- * outside begin/end.
+ /* Set by the driver-supplied t&l engine. Set to
+ * PRIM_OUTSIDE_BEGIN_END when outside begin/end.
*/
GLuint CurrentSavePrimitive;
- /* Current state of an inprogress compilation.
+ /* Current state of an in-progress compilation. May take on any of
+ * the additional values defined above.
*/
@@ -926,7 +927,6 @@ struct dd_function_table {
* if (flags & FLUSH_STORED_VERTICES) flushes any buffered vertices,
* if (flags & FLUSH_UPDATE_CURRENT) updates ctx->Current
* and ctx->Light.Material
- * returns GL_TRUE.
*
* Note that the default t&l engine never clears the
* FLUSH_UPDATE_CURRENT bit, even after performing the update.
diff --git a/src/mesa/main/imports.c b/src/mesa/main/imports.c
index 93fb906f35..e36f7a24b0 100644
--- a/src/mesa/main/imports.c
+++ b/src/mesa/main/imports.c
@@ -1,4 +1,4 @@
-/* $Id: imports.c,v 1.4 2001/01/08 04:09:41 keithw Exp $ */
+/* $Id: imports.c,v 1.5 2001/02/06 04:06:35 keithw Exp $ */
/*
* Mesa 3-D graphics library
@@ -158,7 +158,7 @@ _mesa_InitDefaultImports(__GLimports *imports, void *driverCtx, void *other)
imports->warning = _mesa_warning;
imports->fatal = _mesa_fatal;
imports->getenv = _mesa_getenv;
-/* imports->atoi = _mesa_atoi; */
+ imports->atoi = _mesa_atoi;
imports->sprintf = _mesa_sprintf;
imports->fopen = _mesa_fopen;
imports->fclose = _mesa_fclose;
diff --git a/src/mesa/main/light.h b/src/mesa/main/light.h
index f737abf4e4..b39aa002d8 100644
--- a/src/mesa/main/light.h
+++ b/src/mesa/main/light.h
@@ -1,4 +1,4 @@
-/* $Id: light.h,v 1.8 2000/12/26 05:09:29 keithw Exp $ */
+/* $Id: light.h,v 1.9 2001/02/06 04:06:35 keithw Exp $ */
/*
* Mesa 3-D graphics library
@@ -82,13 +82,12 @@ _mesa_GetMaterialiv( GLenum face, GLenum pname, GLint *params );
#define GET_SHINE_TAB_ENTRY( table, dp, result ) \
do { \
struct gl_shine_tab *_tab = table; \
- if (dp>1.0) \
+ float f = (dp * (SHINE_TABLE_SIZE-1)); \
+ int k = (int) f; \
+ if (k > SHINE_TABLE_SIZE-2) \
result = pow( dp, _tab->shininess ); \
- else { \
- float f = (dp * (SHINE_TABLE_SIZE-1)); \
- int k = (int) f; \
+ else \
result = _tab->tab[k] + (f-k)*(_tab->tab[k+1]-_tab->tab[k]); \
- } \
} while (0)