summaryrefslogtreecommitdiff
path: root/src/mesa/main/light.c
diff options
context:
space:
mode:
authorBrian <brian.paul@tungstengraphics.com>2007-09-27 10:24:17 -0600
committerBrian <brian.paul@tungstengraphics.com>2007-09-27 10:39:01 -0600
commited6d5ff6f8fdd34aaaa126119dbd8e1e321859d8 (patch)
treefc96d0a93505aa755e0b0889b6f0d3f7273ffb5d /src/mesa/main/light.c
parent4f9d29cd4e876cd202a7d3e81f6d91fc7f9625a2 (diff)
Restore old _TriangleCaps code to fix Blender problem (bug 12164)
Diffstat (limited to 'src/mesa/main/light.c')
-rw-r--r--src/mesa/main/light.c9
1 files changed, 9 insertions, 0 deletions
diff --git a/src/mesa/main/light.c b/src/mesa/main/light.c
index 6e057614ba..6dd334e16d 100644
--- a/src/mesa/main/light.c
+++ b/src/mesa/main/light.c
@@ -53,6 +53,11 @@ _mesa_ShadeModel( GLenum mode )
FLUSH_VERTICES(ctx, _NEW_LIGHT);
ctx->Light.ShadeModel = mode;
+ if (mode == GL_FLAT)
+ ctx->_TriangleCaps |= DD_FLATSHADE;
+ else
+ ctx->_TriangleCaps &= ~DD_FLATSHADE;
+
if (ctx->Driver.ShadeModel)
ctx->Driver.ShadeModel( ctx, mode );
}
@@ -441,6 +446,10 @@ _mesa_LightModelfv( GLenum pname, const GLfloat *params )
return;
FLUSH_VERTICES(ctx, _NEW_LIGHT);
ctx->Light.Model.TwoSide = newbool;
+ if (ctx->Light.Enabled && ctx->Light.Model.TwoSide)
+ ctx->_TriangleCaps |= DD_TRI_LIGHT_TWOSIDE;
+ else
+ ctx->_TriangleCaps &= ~DD_TRI_LIGHT_TWOSIDE;
break;
case GL_LIGHT_MODEL_COLOR_CONTROL:
if (params[0] == (GLfloat) GL_SINGLE_COLOR)