added null pointer check in tnl_copy_to_current()
[mesa.git] / src / mesa / tnl / t_vb_fog.c
index d0e87cdbd8a96030fa96d4d17dacb24126073a9a..8968dfb4dfb1672fa67753d47e989ba53d15c8fa 100644 (file)
@@ -1,10 +1,9 @@
-/* $Id: t_vb_fog.c,v 1.16 2002/01/06 03:54:12 brianp Exp $ */
 
 /*
  * Mesa 3-D graphics library
- * Version:  4.1
+ * Version:  5.1
  *
- * Copyright (C) 1999-2002  Brian Paul   All Rights Reserved.
+ * Copyright (C) 1999-2003  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"),
@@ -24,7 +23,7 @@
  * CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
  *
  * Authors:
- *    Keith Whitwell <keithw@valinux.com>
+ *    Keith Whitwell <keith@tungstengraphics.com>
  */
 
 
@@ -32,8 +31,7 @@
 #include "colormac.h"
 #include "context.h"
 #include "macros.h"
-#include "mem.h"
-#include "mmath.h"
+#include "imports.h"
 #include "mtypes.h"
 
 #include "math/m_xform.h"
@@ -105,14 +103,14 @@ static void make_win_fog_coords( GLcontext *ctx, GLvector4f *out,
       else
          d = 1.0F / (ctx->Fog.End - ctx->Fog.Start);
       for ( i = 0 ; i < n ; i++, STRIDE_F(v, stride)) {
-         GLfloat f = (end - ABSF(*v)) * d;
+         GLfloat f = (end - FABSF(*v)) * d;
         data[i][0] = CLAMP(f, 0.0F, 1.0F);
       }
       break;
    case GL_EXP:
       d = ctx->Fog.Density;
       for ( i = 0 ; i < n ; i++, STRIDE_F(v,stride))
-         NEG_EXP( data[i][0], d * ABSF(*v) );
+         NEG_EXP( data[i][0], d * FABSF(*v) );
       break;
    case GL_EXP2:
       d = ctx->Fog.Density*ctx->Fog.Density;
@@ -196,9 +194,9 @@ static void check_fog_stage( GLcontext *ctx, struct gl_pipeline_stage *stage )
    stage->active = ctx->Fog.Enabled && !ctx->VertexProgram.Enabled;
 
    if (ctx->Fog.FogCoordinateSource == GL_FRAGMENT_DEPTH_EXT)
-      stage->inputs = VERT_EYE;
+      stage->inputs = VERT_BIT_EYE;
    else
-      stage->inputs = VERT_FOG_BIT;
+      stage->inputs = VERT_BIT_FOG;
 }
 
 
@@ -245,7 +243,7 @@ const struct gl_pipeline_stage _tnl_fog_coordinate_stage =
    _NEW_FOG,                   /* run_state */
    GL_FALSE,                   /* active? */
    0,                          /* inputs */
-   VERT_FOG_BIT,               /* outputs */
+   VERT_BIT_FOG,               /* outputs */
    0,                          /* changed_inputs */
    NULL,                       /* private_data */
    free_fog_data,              /* dtr */