From 74e2dd38ed2d4be3454683c3b3f6959738ef235a Mon Sep 17 00:00:00 2001 From: Brian Paul Date: Fri, 15 Dec 2000 16:42:30 +0000 Subject: [PATCH] minor fog clean-ups (Klaus Niederkrueger) --- src/mesa/swrast/s_fog.c | 35 +++++++++++++++++++---------------- 1 file changed, 19 insertions(+), 16 deletions(-) diff --git a/src/mesa/swrast/s_fog.c b/src/mesa/swrast/s_fog.c index 919d70e099d..747edee7794 100644 --- a/src/mesa/swrast/s_fog.c +++ b/src/mesa/swrast/s_fog.c @@ -1,4 +1,4 @@ -/* $Id: s_fog.c,v 1.4 2000/12/13 17:35:43 brianp Exp $ */ +/* $Id: s_fog.c,v 1.5 2000/12/15 16:42:30 brianp Exp $ */ /* * Mesa 3-D graphics library @@ -48,17 +48,17 @@ _mesa_fog_rgba_pixels( const GLcontext *ctx, const GLfixed fog[], GLchan rgba[][4] ) { - GLfixed rFog = ctx->Fog.Color[0] * CHAN_MAXF; - GLfixed gFog = ctx->Fog.Color[1] * CHAN_MAXF; - GLfixed bFog = ctx->Fog.Color[2] * CHAN_MAXF; + GLchan rFog = FLOAT_TO_CHAN(ctx->Fog.Color[0]); + GLchan gFog = FLOAT_TO_CHAN(ctx->Fog.Color[1]); + GLchan bFog = FLOAT_TO_CHAN(ctx->Fog.Color[2]); GLuint i; - for (i=0;i> FIXED_SHIFT; - rgba[i][1] = (f*rgba[i][1] + g*gFog) >> FIXED_SHIFT; - rgba[i][2] = (f*rgba[i][2] + g*bFog) >> FIXED_SHIFT; + rgba[i][0] = (f * rgba[i][0] + g * rFog) >> FIXED_SHIFT; + rgba[i][1] = (f * rgba[i][1] + g * gFog) >> FIXED_SHIFT; + rgba[i][2] = (f * rgba[i][2] + g * bFog) >> FIXED_SHIFT; } } @@ -136,14 +136,14 @@ _mesa_win_fog_coords_from_z( const GLcontext *ctx, case GL_LINEAR: { GLfloat fogEnd = ctx->Fog.End; - GLfloat fogScale = (GLfloat) FIXED_ONE / (ctx->Fog.End - - ctx->Fog.Start); + GLfloat fogScale = 1.0F / (ctx->Fog.End - ctx->Fog.Start); if (ortho) { for (i=0;iFog.Density * eyez )); } } @@ -171,7 +173,8 @@ _mesa_win_fog_coords_from_z( const GLcontext *ctx, for (i=0;iFog.Density * eyez )); } } -- 2.30.2