mesa/core: Add definitions and translations for EXT_texture_sRGB_R8
[mesa.git] / src / mesa / swrast / s_fog.c
index 6b9e698f7bca89f8b03278d17935de708e1071dd..33da09b618db7c0a9cf1fc64e675c673d277edd5 100644 (file)
@@ -23,8 +23,9 @@
  */
 
 
+#include "c99_math.h"
+#include "main/errors.h"
 #include "main/glheader.h"
-#include "main/colormac.h"
 #include "main/macros.h"
 
 #include "s_context.h"
@@ -49,12 +50,12 @@ _swrast_z_to_fogfactor(struct gl_context *ctx, GLfloat z)
       return CLAMP(f, 0.0F, 1.0F);
    case GL_EXP:
       d = ctx->Fog.Density;
-      f = EXPF(-d * z);
+      f = expf(-d * z);
       f = CLAMP(f, 0.0F, 1.0F);
       return f;
    case GL_EXP2:
       d = ctx->Fog.Density;
-      f = EXPF(-(d * d * z * z));
+      f = expf(-(d * d * z * z));
       f = CLAMP(f, 0.0F, 1.0F);
       return f;
    default:
@@ -66,14 +67,14 @@ _swrast_z_to_fogfactor(struct gl_context *ctx, GLfloat z)
 
 #define LINEAR_FOG(f, coord)  f = (fogEnd - coord) * fogScale
 
-#define EXP_FOG(f, coord)  f = EXPF(density * coord)
+#define EXP_FOG(f, coord)  f = expf(density * coord)
 
 #define EXP2_FOG(f, coord)                             \
 do {                                                   \
    GLfloat tmp = negDensitySquared * coord * coord;    \
    if (tmp < FLT_MIN_10_EXP)                           \
       tmp = FLT_MIN_10_EXP;                            \
-   f = EXPF(tmp);                                      \
+   f = expf(tmp);                                      \
  } while(0)
 
 
@@ -91,7 +92,7 @@ if (span->arrayAttribs & VARYING_BIT_FOGC) {                                  \
    GLuint i;                                                                   \
    for (i = 0; i < span->end; i++) {                                           \
       const GLfloat fogCoord = span->array->attribs[VARYING_SLOT_FOGC][i][0];  \
-      const GLfloat c = FABSF(fogCoord);                                       \
+      const GLfloat c = fabsf(fogCoord);                                       \
       GLfloat f, oneMinusF;                                                    \
       FOG_FUNC(f, c);                                                          \
       f = CLAMP(f, 0.0F, 1.0F);                                                        \
@@ -108,7 +109,7 @@ else {                                                                              \
    GLfloat w = span->attrStart[VARYING_SLOT_POS][3];                           \
    GLuint i;                                                                   \
    for (i = 0; i < span->end; i++) {                                           \
-      const GLfloat c = FABSF(fogCoord) / w;                                   \
+      const GLfloat c = fabsf(fogCoord) / w;                                   \
       GLfloat f, oneMinusF;                                                    \
       FOG_FUNC(f, c);                                                          \
       f = CLAMP(f, 0.0F, 1.0F);                                                        \