summaryrefslogtreecommitdiffstats
path: root/src
diff options
context:
space:
mode:
authorBrian Paul <[email protected]>2011-03-19 14:17:41 -0600
committerBrian <brian@ubuntu10-32.(none)>2011-03-19 14:17:41 -0600
commitaafcbd2cf726e9f300d6a9cdfd62ee0fd64f85c9 (patch)
tree0081e2d2d8f53d3832fe63ad09596ad522eb0081 /src
parent9459cc593c7fc7f8e5e0a7e9e673c075d91ae057 (diff)
mesa: replace macro with function
Diffstat (limited to 'src')
-rw-r--r--src/mesa/main/fog.c21
1 files changed, 13 insertions, 8 deletions
diff --git a/src/mesa/main/fog.c b/src/mesa/main/fog.c
index fd64bd1fd89..439232248e6 100644
--- a/src/mesa/main/fog.c
+++ b/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)