aboutsummaryrefslogtreecommitdiff
path: root/mesalib/src/mesa/main/fog.c
diff options
context:
space:
mode:
authormarha <marha@users.sourceforge.net>2011-03-20 16:32:44 +0000
committermarha <marha@users.sourceforge.net>2011-03-20 16:32:44 +0000
commiteca5dee9e7a8dea1edba4d10b60444ac0e884139 (patch)
tree67c0e6552d06cb59b33ef79ece38d6581b2c8976 /mesalib/src/mesa/main/fog.c
parentd7f1bd4112420f1d4b41c5409074eca6b34bf507 (diff)
downloadvcxsrv-eca5dee9e7a8dea1edba4d10b60444ac0e884139.tar.gz
vcxsrv-eca5dee9e7a8dea1edba4d10b60444ac0e884139.tar.bz2
vcxsrv-eca5dee9e7a8dea1edba4d10b60444ac0e884139.zip
xserver libX11 libxcb pixman mesa git update 20 Mar 2011
Diffstat (limited to 'mesalib/src/mesa/main/fog.c')
-rw-r--r--mesalib/src/mesa/main/fog.c21
1 files changed, 13 insertions, 8 deletions
diff --git a/mesalib/src/mesa/main/fog.c b/mesalib/src/mesa/main/fog.c
index b4356c198..70603576c 100644
--- a/mesalib/src/mesa/main/fog.c
+++ b/mesalib/src/mesa/main/fog.c
@@ -79,12 +79,17 @@ _mesa_Fogiv(GLenum pname, const GLint *params )
}
-#define UPDATE_FOG_SCALE(ctx) do {\
- if (ctx->Fog.End == ctx->Fog.Start)\
- ctx->Fog._Scale = 1.0f;\
- else\
- ctx->Fog._Scale = 1.0f / (ctx->Fog.End - ctx->Fog.Start);\
- } while(0)
+/**
+ * Update the gl_fog_attrib::_Scale field.
+ */
+static void
+update_fog_scale(struct gl_context *ctx)
+{
+ if (ctx->Fog.End == ctx->Fog.Start)
+ ctx->Fog._Scale = 1.0f;
+ else
+ ctx->Fog._Scale = 1.0f / (ctx->Fog.End - ctx->Fog.Start);
+}
void GLAPIENTRY
@@ -126,14 +131,14 @@ _mesa_Fogfv( GLenum pname, const GLfloat *params )
return;
FLUSH_VERTICES(ctx, _NEW_FOG);
ctx->Fog.Start = *params;
- UPDATE_FOG_SCALE(ctx);
+ update_fog_scale(ctx);
break;
case GL_FOG_END:
if (ctx->Fog.End == *params)
return;
FLUSH_VERTICES(ctx, _NEW_FOG);
ctx->Fog.End = *params;
- UPDATE_FOG_SCALE(ctx);
+ update_fog_scale(ctx);
break;
case GL_FOG_INDEX:
if (ctx->Fog.Index == *params)