Set ENABLE_LIGHT according to ctx->Light.Enabled whether or not
authorBrian Paul <brian.paul@tungstengraphics.com>
Mon, 27 Nov 2000 18:59:09 +0000 (18:59 +0000)
committerBrian Paul <brian.paul@tungstengraphics.com>
Mon, 27 Nov 2000 18:59:09 +0000 (18:59 +0000)
individual light sources are enabled.

src/mesa/main/attrib.c
src/mesa/main/enable.c

index b8106fad455e9f0aa5c76ba4954ae3114169d75b..c6475ca5afdc5bc496cfe01d46e0036eba913966 100644 (file)
@@ -1,4 +1,4 @@
-/* $Id: attrib.c,v 1.36 2000/11/22 07:32:16 joukj Exp $ */
+/* $Id: attrib.c,v 1.37 2000/11/27 18:59:09 brianp Exp $ */
 
 /*
  * Mesa 3-D graphics library
@@ -706,7 +706,7 @@ _mesa_PopAttrib(void)
             if (ctx->Driver.ShadeModel)
                (*ctx->Driver.ShadeModel)(ctx, ctx->Light.ShadeModel);
            ctx->_Enabled &= ~ENABLE_LIGHT;
-           if (ctx->Light.Enabled && !is_empty_list(&ctx->Light.EnabledList))
+           if (ctx->Light.Enabled)
               ctx->_Enabled |= ENABLE_LIGHT;
             break;
          case GL_LINE_BIT:
index d2ad97a0da8dea56d46ca48a3fb136e3d74253a8..2de320d38687cf24caec22824904ba0fe98d040a 100644 (file)
@@ -1,4 +1,4 @@
-/* $Id: enable.c,v 1.34 2000/11/24 10:25:05 keithw Exp $ */
+/* $Id: enable.c,v 1.35 2000/11/27 18:59:09 brianp Exp $ */
 
 /*
  * Mesa 3-D graphics library
@@ -181,18 +181,13 @@ void _mesa_set_enable( GLcontext *ctx, GLenum cap, GLboolean state )
       case GL_LIGHT7:
         if (ctx->Light.Light[cap-GL_LIGHT0].Enabled != state) {
            ctx->Light.Light[cap-GL_LIGHT0].Enabled = state;
-
            if (state) {
               insert_at_tail(&ctx->Light.EnabledList,
                              &ctx->Light.Light[cap-GL_LIGHT0]);
-              if (ctx->Light.Enabled)
-                 ctx->_Enabled |= ENABLE_LIGHT;
-           } else {
+           }
+            else {
               remove_from_list(&ctx->Light.Light[cap-GL_LIGHT0]);
-              if (is_empty_list(&ctx->Light.EnabledList))
-                 ctx->_Enabled &= ~ENABLE_LIGHT;
            }
-
            ctx->NewState |= _NEW_LIGHT;
         }
          break;