diff options
author | Brian Paul <brian.paul@tungstengraphics.com> | 2001-06-26 21:15:35 +0000 |
---|---|---|
committer | Brian Paul <brian.paul@tungstengraphics.com> | 2001-06-26 21:15:35 +0000 |
commit | acc722d4b890da7ed0ede24751e2bcaf28cc1468 (patch) | |
tree | 38472ec2d8479c98189f2ce0f4e365ece59ea14e /src/mesa/swrast/s_bitmap.c | |
parent | 33170eeb185f5fe766374a749464497cdfab6931 (diff) |
More raster fog coord fixes.
New truncate vs. floor comments in drawpixels.c
Added current raster secondary color state, not used yet.
Diffstat (limited to 'src/mesa/swrast/s_bitmap.c')
-rw-r--r-- | src/mesa/swrast/s_bitmap.c | 20 |
1 files changed, 9 insertions, 11 deletions
diff --git a/src/mesa/swrast/s_bitmap.c b/src/mesa/swrast/s_bitmap.c index 17387ba0af..5f12993314 100644 --- a/src/mesa/swrast/s_bitmap.c +++ b/src/mesa/swrast/s_bitmap.c @@ -1,4 +1,4 @@ -/* $Id: s_bitmap.c,v 1.11 2001/06/18 23:55:18 brianp Exp $ */ +/* $Id: s_bitmap.c,v 1.12 2001/06/26 21:15:36 brianp Exp $ */ /* * Mesa 3-D graphics library @@ -49,7 +49,7 @@ _swrast_Bitmap( GLcontext *ctx, GLint px, GLint py, struct pixel_buffer *PB = swrast->PB; GLint row, col; GLdepth fragZ; - GLfloat fogCoord; + GLfloat fog; ASSERT(ctx->RenderMode == GL_RENDER); ASSERT(bitmap); @@ -75,15 +75,13 @@ _swrast_Bitmap( GLcontext *ctx, GLint px, GLint py, fragZ = (GLdepth) ( ctx->Current.RasterPos[2] * ctx->DepthMaxF); if (ctx->Fog.Enabled) { - if (ctx->Fog.FogCoordinateSource == GL_FOG_COORDINATE_EXT) { - fogCoord = ctx->Current.FogCoord; - } - else { - fogCoord = _mesa_z_to_fogfactor(ctx, ctx->Current.RasterDistance); - } + if (ctx->Fog.FogCoordinateSource == GL_FOG_COORDINATE_EXT) + fog = _mesa_z_to_fogfactor(ctx, ctx->Current.FogCoord); + else + fog = _mesa_z_to_fogfactor(ctx, ctx->Current.RasterDistance); } else { - fogCoord = 0.0; + fog = 0.0; } for (row=0; row<height; row++) { @@ -95,7 +93,7 @@ _swrast_Bitmap( GLcontext *ctx, GLint px, GLint py, GLubyte mask = 1U << (unpack->SkipPixels & 0x7); for (col=0; col<width; col++) { if (*src & mask) { - PB_WRITE_PIXEL( PB, px+col, py+row, fragZ, fogCoord ); + PB_WRITE_PIXEL( PB, px+col, py+row, fragZ, fog ); } if (mask == 128U) { src++; @@ -117,7 +115,7 @@ _swrast_Bitmap( GLcontext *ctx, GLint px, GLint py, GLubyte mask = 128U >> (unpack->SkipPixels & 0x7); for (col=0; col<width; col++) { if (*src & mask) { - PB_WRITE_PIXEL( PB, px+col, py+row, fragZ, fogCoord ); + PB_WRITE_PIXEL( PB, px+col, py+row, fragZ, fog ); } if (mask == 1U) { src++; |