init secondary color to (0,0,0,1). remove some redundant initializations.
[mesa.git] / src / mesa / main / light.c
index 5d47313568190c96503e9f447a512458ba571d28..94060592bbc21cc281d063a57dfef150c957681c 100644 (file)
@@ -34,7 +34,7 @@
 #include "math/m_matrix.h"
 
 
-void
+void GLAPIENTRY
 _mesa_ShadeModel( GLenum mode )
 {
    GET_CURRENT_CONTEXT(ctx);
@@ -59,14 +59,14 @@ _mesa_ShadeModel( GLenum mode )
 }
 
 
-void
+void GLAPIENTRY
 _mesa_Lightf( GLenum light, GLenum pname, GLfloat param )
 {
    _mesa_Lightfv( light, pname, &param );
 }
 
 
-void
+void GLAPIENTRY
 _mesa_Lightfv( GLenum light, GLenum pname, const GLfloat *params )
 {
    GET_CURRENT_CONTEXT(ctx);
@@ -192,14 +192,14 @@ _mesa_Lightfv( GLenum light, GLenum pname, const GLfloat *params )
 }
 
 
-void
+void GLAPIENTRY
 _mesa_Lighti( GLenum light, GLenum pname, GLint param )
 {
    _mesa_Lightiv( light, pname, &param );
 }
 
 
-void
+void GLAPIENTRY
 _mesa_Lightiv( GLenum light, GLenum pname, const GLint *params )
 {
    GLfloat fparam[4];
@@ -241,7 +241,7 @@ _mesa_Lightiv( GLenum light, GLenum pname, const GLint *params )
 
 
 
-void
+void GLAPIENTRY
 _mesa_GetLightfv( GLenum light, GLenum pname, GLfloat *params )
 {
    GET_CURRENT_CONTEXT(ctx);
@@ -291,7 +291,7 @@ _mesa_GetLightfv( GLenum light, GLenum pname, GLfloat *params )
 }
 
 
-void
+void GLAPIENTRY
 _mesa_GetLightiv( GLenum light, GLenum pname, GLint *params )
 {
    GET_CURRENT_CONTEXT(ctx);
@@ -361,7 +361,7 @@ _mesa_GetLightiv( GLenum light, GLenum pname, GLint *params )
 /**********************************************************************/
 
 
-void
+void GLAPIENTRY
 _mesa_LightModelfv( GLenum pname, const GLfloat *params )
 {
    GLenum newenum;
@@ -409,14 +409,6 @@ _mesa_LightModelfv( GLenum pname, const GLfloat *params )
            return;
         FLUSH_VERTICES(ctx, _NEW_LIGHT);
         ctx->Light.Model.ColorControl = newenum;
-
-        if ((ctx->Light.Enabled &&
-             ctx->Light.Model.ColorControl==GL_SEPARATE_SPECULAR_COLOR)
-            || ctx->Fog.ColorSumEnabled)
-           ctx->_TriangleCaps |= DD_SEPARATE_SPECULAR;
-        else
-           ctx->_TriangleCaps &= ~DD_SEPARATE_SPECULAR;
-
          break;
       default:
          _mesa_error( ctx, GL_INVALID_ENUM, "glLightModel(pname=0x%x)", pname );
@@ -428,7 +420,7 @@ _mesa_LightModelfv( GLenum pname, const GLfloat *params )
 }
 
 
-void
+void GLAPIENTRY
 _mesa_LightModeliv( GLenum pname, const GLint *params )
 {
    GLfloat fparam[4];
@@ -453,14 +445,14 @@ _mesa_LightModeliv( GLenum pname, const GLint *params )
 }
 
 
-void
+void GLAPIENTRY
 _mesa_LightModeli( GLenum pname, GLint param )
 {
    _mesa_LightModeliv( pname, &param );
 }
 
 
-void
+void GLAPIENTRY
 _mesa_LightModelf( GLenum pname, GLfloat param )
 {
    _mesa_LightModelfv( pname, &param );
@@ -649,7 +641,7 @@ _mesa_update_color_material( GLcontext *ctx, const GLfloat color[4] )
 }
 
 
-void
+void GLAPIENTRY
 _mesa_ColorMaterial( GLenum face, GLenum mode )
 {
    GET_CURRENT_CONTEXT(ctx);
@@ -687,7 +679,7 @@ _mesa_ColorMaterial( GLenum face, GLenum mode )
 }
 
 
-void
+void GLAPIENTRY
 _mesa_GetMaterialfv( GLenum face, GLenum pname, GLfloat *params )
 {
    GET_CURRENT_CONTEXT(ctx);
@@ -733,7 +725,7 @@ _mesa_GetMaterialfv( GLenum face, GLenum pname, GLfloat *params )
 }
 
 
-void
+void GLAPIENTRY
 _mesa_GetMaterialiv( GLenum face, GLenum pname, GLint *params )
 {
    GET_CURRENT_CONTEXT(ctx);
@@ -1180,7 +1172,7 @@ _mesa_update_tnl_spaces( GLcontext *ctx, GLuint new_state )
 void
 _mesa_allow_light_in_model( GLcontext *ctx, GLboolean flag )
 {
-   ctx->_ForceEyeCoords = flag;
+   ctx->_ForceEyeCoords = !flag;
    ctx->NewState |= _NEW_POINT;        /* one of the bits from
                                 * _MESA_NEW_NEED_EYE_COORDS.
                                 */