fix GL_BACK color material bug
[mesa.git] / src / mesa / main / light.c
index 5f0ed480f1a2a678350bca22c8d52fe598e41118..f7278c2c31aeb654b337ccff06e7bfdb970b70e2 100644 (file)
@@ -1,10 +1,10 @@
-/* $Id: light.c,v 1.10 1999/11/22 18:58:53 brianp Exp $ */
+/* $Id: light.c,v 1.13 2000/06/19 14:35:17 keithw Exp $ */
 
 /*
  * Mesa 3-D graphics library
  * Version:  3.3
  * 
- * Copyright (C) 1999  Brian Paul   All Rights Reserved.
+ * Copyright (C) 1999-2000  Brian Paul   All Rights Reserved.
  * 
  * Permission is hereby granted, free of charge, to any person obtaining a
  * copy of this software and associated documentation files (the "Software"),
 #endif
 
 
+/* XXX this is a bit of a hack needed for compilation within XFree86 */
+#ifndef FLT_MIN
+#define FLT_MIN 1e-37
+#endif
+
 
 void
 _mesa_ShadeModel( GLenum mode )
@@ -688,7 +693,7 @@ void gl_update_color_material( GLcontext *ctx,
       SUB_3V( tmp, color, mat->Ambient );
       ACC_SCALE_3V( ctx->Light.BaseColor[1], ctx->Light.Model.Ambient, tmp);
       foreach (light, list) {
-        ACC_SCALE_3V( ctx->Light.BaseColor[0], light->Ambient, tmp );
+        ACC_SCALE_3V( ctx->Light.BaseColor[1], light->Ambient, tmp );
       }
       COPY_4FV( mat->Ambient, color );
    }
@@ -1160,8 +1165,8 @@ void gl_compute_shine_table( GLcontext *ctx, GLuint i, GLfloat shininess )
 
 
 
-
-void gl_reinit_light_attrib( GLcontext *ctx, struct gl_light_attrib *l )
+#if 0
+static void gl_reinit_light_attrib( GLcontext *ctx, struct gl_light_attrib *l )
 {
    GLuint i;
 
@@ -1181,7 +1186,7 @@ void gl_reinit_light_attrib( GLcontext *ctx, struct gl_light_attrib *l )
         insert_at_tail( &l->EnabledList, &l->Light[i] );
    }
 }
-
+#endif
 
 
 /*