Merge remote-tracking branch 'mesa-public/master' into vulkan
[mesa.git] / src / mesa / tnl / t_vb_light.c
index 1338948536d3edbd8c1207f90ac7b61b3a772047..029265a4f83885ef29910596761366e3fa436772 100644 (file)
@@ -1,6 +1,5 @@
 /*
  * Mesa 3-D graphics library
- * Version:  6.5
  *
  * Copyright (C) 1999-2006  Brian Paul   All Rights Reserved.
  *
  */
 
 
-
+#include "c99_math.h"
 #include "main/glheader.h"
-#include "main/colormac.h"
 #include "main/light.h"
 #include "main/macros.h"
 #include "main/imports.h"
-#include "main/simple_list.h"
+#include "util/simple_list.h"
 #include "main/mtypes.h"
 
 #include "math/m_translate.h"
@@ -124,7 +122,7 @@ validate_shine_table( struct gl_context *ctx, GLuint side, GLfloat shininess )
    struct tnl_shine_tab *list = tnl->_ShineTabList;
    struct tnl_shine_tab *s;
 
-   ASSERT(side < 2);
+   assert(side < 2);
 
    foreach(s, list)
       if ( s->shininess == shininess )
@@ -139,23 +137,23 @@ validate_shine_table( struct gl_context *ctx, GLuint side, GLfloat shininess )
            break;
 
       m = s->tab;
-      m[0] = 0.0;
-      if (shininess == 0.0) {
+      m[0] = 0.0F;
+      if (shininess == 0.0F) {
         for (j = 1 ; j <= SHINE_TABLE_SIZE ; j++)
-           m[j] = 1.0;
+           m[j] = 1.0F;
       }
       else {
         for (j = 1 ; j < SHINE_TABLE_SIZE ; j++) {
-            GLdouble t, x = j / (GLfloat) (SHINE_TABLE_SIZE - 1);
-            if (x < 0.005) /* underflow check */
-               x = 0.005;
-            t = pow(x, shininess);
-           if (t > 1e-20)
-              m[j] = (GLfloat) t;
+            GLfloat t, x = j / (GLfloat) (SHINE_TABLE_SIZE - 1);
+            if (x < 0.005F) /* underflow check */
+               x = 0.005F;
+            t = powf(x, shininess);
+           if (t > 1e-20F)
+              m[j] = t;
            else
-              m[j] = 0.0;
+              m[j] = 0.0F;
         }
-        m[SHINE_TABLE_SIZE] = 1.0;
+        m[SHINE_TABLE_SIZE] = 1.0F;
       }
 
       s->shininess = shininess;