summaryrefslogtreecommitdiffstats
path: root/src/mesa/swrast/s_copypix.c
diff options
context:
space:
mode:
authorBrian Paul <[email protected]>2001-06-26 21:15:35 +0000
committerBrian Paul <[email protected]>2001-06-26 21:15:35 +0000
commitacc722d4b890da7ed0ede24751e2bcaf28cc1468 (patch)
tree38472ec2d8479c98189f2ce0f4e365ece59ea14e /src/mesa/swrast/s_copypix.c
parent33170eeb185f5fe766374a749464497cdfab6931 (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_copypix.c')
-rw-r--r--src/mesa/swrast/s_copypix.c34
1 files changed, 13 insertions, 21 deletions
diff --git a/src/mesa/swrast/s_copypix.c b/src/mesa/swrast/s_copypix.c
index 3c7ee260d9e..ab8198945ce 100644
--- a/src/mesa/swrast/s_copypix.c
+++ b/src/mesa/swrast/s_copypix.c
@@ -1,4 +1,4 @@
-/* $Id: s_copypix.c,v 1.20 2001/06/18 23:55:18 brianp Exp $ */
+/* $Id: s_copypix.c,v 1.21 2001/06/26 21:15:36 brianp Exp $ */
/*
* Mesa 3-D graphics library
@@ -114,12 +114,10 @@ copy_conv_rgba_pixels(GLcontext *ctx, GLint srcx, GLint srcy,
GLfloat fog;
GLint i;
- if (ctx->Fog.FogCoordinateSource == GL_FOG_COORDINATE_EXT) {
- fog = ctx->Current.RasterFogCoord;
- }
- else {
+ if (ctx->Fog.FogCoordinateSource == GL_FOG_COORDINATE_EXT)
+ fog = _mesa_z_to_fogfactor(ctx, ctx->Current.RasterFogCoord);
+ else
fog = _mesa_z_to_fogfactor(ctx, ctx->Current.RasterDistance);
- }
for (i = 0; i < width; i++) {
zspan[i] = z;
@@ -354,12 +352,10 @@ copy_rgba_pixels(GLcontext *ctx, GLint srcx, GLint srcy,
GLdepth z = (GLdepth) (ctx->Current.RasterPos[2] * ctx->DepthMax);
GLfloat fog;
- if (ctx->Fog.FogCoordinateSource == GL_FOG_COORDINATE_EXT) {
- fog = ctx->Current.RasterFogCoord;
- }
- else {
+ if (ctx->Fog.FogCoordinateSource == GL_FOG_COORDINATE_EXT)
+ fog = _mesa_z_to_fogfactor(ctx, ctx->Current.RasterFogCoord);
+ else
fog = _mesa_z_to_fogfactor(ctx, ctx->Current.RasterDistance);
- }
for (i=0;i<width;i++) {
zspan[i] = z;
@@ -620,12 +616,10 @@ static void copy_ci_pixels( GLcontext *ctx,
GLdepth z = (GLdepth) (ctx->Current.RasterPos[2] * ctx->DepthMax);
GLfloat fog;
- if (ctx->Fog.FogCoordinateSource == GL_FOG_COORDINATE_EXT) {
- fog = ctx->Current.RasterFogCoord;
- }
- else {
+ if (ctx->Fog.FogCoordinateSource == GL_FOG_COORDINATE_EXT)
+ fog = _mesa_z_to_fogfactor(ctx, ctx->Current.RasterFogCoord);
+ else
fog = _mesa_z_to_fogfactor(ctx, ctx->Current.RasterDistance);
- }
for (i=0;i<width;i++) {
zspan[i] = z;
@@ -769,12 +763,10 @@ static void copy_depth_pixels( GLcontext *ctx, GLint srcx, GLint srcy,
if (ctx->Fog.Enabled) {
GLfloat fog;
- if (ctx->Fog.FogCoordinateSource == GL_FOG_COORDINATE_EXT) {
- fog = ctx->Current.RasterFogCoord;
- }
- else {
+ if (ctx->Fog.FogCoordinateSource == GL_FOG_COORDINATE_EXT)
+ fog = _mesa_z_to_fogfactor(ctx, ctx->Current.RasterFogCoord);
+ else
fog = _mesa_z_to_fogfactor(ctx, ctx->Current.RasterDistance);
- }
for (i = 0; i < width; i++) {
fogSpan[i] = fog;