summaryrefslogtreecommitdiffstats
path: root/src/mesa/main
diff options
context:
space:
mode:
authorKeith Whitwell <[email protected]>2001-02-16 18:14:41 +0000
committerKeith Whitwell <[email protected]>2001-02-16 18:14:41 +0000
commit46b0988c673b28e072fd0cbf477632a9ab6f9f18 (patch)
tree3463116da957c6f13dcb0b415ca8476640503fc7 /src/mesa/main
parent2448fc7deeaa870d879de17158f243f239c05b15 (diff)
Allow swrast to cope (fairly) cleanly with GL_SEPERATE_SPECULAR when
texturing is not enabled, and without requiring the two colors be added externally. As a part of this, collapsed the decomposition of quads into triangles inside swrast to be hardwired into _swrast_Quad; removed s_quads.[ch]. Removed checks on texture state from t_vb_light.c, which was previously required by swrast. Moved the t_dd_ templates to a new directory.
Diffstat (limited to 'src/mesa/main')
-rw-r--r--src/mesa/main/Makefile.X113
-rw-r--r--src/mesa/main/enable.c19
-rw-r--r--src/mesa/main/light.c11
3 files changed, 27 insertions, 6 deletions
diff --git a/src/mesa/main/Makefile.X11 b/src/mesa/main/Makefile.X11
index eed597bb36e..fdab3399ce3 100644
--- a/src/mesa/main/Makefile.X11
+++ b/src/mesa/main/Makefile.X11
@@ -1,4 +1,4 @@
-# $Id: Makefile.X11,v 1.44 2001/02/16 00:35:34 keithw Exp $
+# $Id: Makefile.X11,v 1.45 2001/02/16 18:14:41 keithw Exp $
# Mesa 3-D graphics library
# Version: 3.5
@@ -143,7 +143,6 @@ CORE_SOURCES = \
swrast/s_pb.c \
swrast/s_pixeltex.c \
swrast/s_points.c \
- swrast/s_quads.c \
swrast/s_readpix.c \
swrast/s_scissor.c \
swrast/s_span.c \
diff --git a/src/mesa/main/enable.c b/src/mesa/main/enable.c
index 37ada84a7df..f1870415f30 100644
--- a/src/mesa/main/enable.c
+++ b/src/mesa/main/enable.c
@@ -1,4 +1,4 @@
-/* $Id: enable.c,v 1.41 2001/02/13 23:51:34 brianp Exp $ */
+/* $Id: enable.c,v 1.42 2001/02/16 18:14:41 keithw Exp $ */
/*
* Mesa 3-D graphics library
@@ -273,6 +273,14 @@ void _mesa_set_enable( GLcontext *ctx, GLenum cap, GLboolean state )
FLUSH_VERTICES(ctx, _NEW_LIGHT);
ctx->Light.Enabled = state;
ctx->_Enabled ^= ENABLE_LIGHT;
+
+ if ((ctx->Light.Enabled &&
+ ctx->Light.Model.ColorControl==GL_SEPARATE_SPECULAR_COLOR)
+ || ctx->Fog.ColorSumEnabled)
+ ctx->_TriangleCaps |= DD_SEPERATE_SPECULAR;
+ else
+ ctx->_TriangleCaps &= ~DD_SEPERATE_SPECULAR;
+
break;
case GL_LINE_SMOOTH:
if (ctx->Line.SmoothFlag == state)
@@ -724,7 +732,14 @@ void _mesa_set_enable( GLcontext *ctx, GLenum cap, GLboolean state )
return;
FLUSH_VERTICES(ctx, _NEW_FOG);
ctx->Fog.ColorSumEnabled = state;
- ctx->_TriangleCaps ^= DD_SEPERATE_SPECULAR;
+
+ if ((ctx->Light.Enabled &&
+ ctx->Light.Model.ColorControl==GL_SEPARATE_SPECULAR_COLOR)
+ || ctx->Fog.ColorSumEnabled)
+ ctx->_TriangleCaps |= DD_SEPERATE_SPECULAR;
+ else
+ ctx->_TriangleCaps &= ~DD_SEPERATE_SPECULAR;
+
break;
/* GL_MESA_sprite_point */
diff --git a/src/mesa/main/light.c b/src/mesa/main/light.c
index 155792af52b..052c04618bc 100644
--- a/src/mesa/main/light.c
+++ b/src/mesa/main/light.c
@@ -1,4 +1,4 @@
-/* $Id: light.c,v 1.37 2001/02/15 01:33:52 keithw Exp $ */
+/* $Id: light.c,v 1.38 2001/02/16 18:14:41 keithw Exp $ */
/*
* Mesa 3-D graphics library
@@ -421,7 +421,14 @@ _mesa_LightModelfv( GLenum pname, const GLfloat *params )
return;
FLUSH_VERTICES(ctx, _NEW_LIGHT);
ctx->Light.Model.ColorControl = newenum;
- ctx->_TriangleCaps ^= DD_SEPERATE_SPECULAR;
+
+ if ((ctx->Light.Enabled &&
+ ctx->Light.Model.ColorControl==GL_SEPARATE_SPECULAR_COLOR)
+ || ctx->Fog.ColorSumEnabled)
+ ctx->_TriangleCaps |= DD_SEPERATE_SPECULAR;
+ else
+ ctx->_TriangleCaps &= ~DD_SEPERATE_SPECULAR;
+
break;
default:
gl_error( ctx, GL_INVALID_ENUM, "glLightModel" );