diff options
author | Brian Paul <[email protected]> | 2002-02-02 21:40:33 +0000 |
---|---|---|
committer | Brian Paul <[email protected]> | 2002-02-02 21:40:33 +0000 |
commit | b37a084357dd08573b86d6d8c5ba43d65bdc1bd7 (patch) | |
tree | e9b71cecbc7500a5c6144c79cda6ac2a7a7e3558 /src/mesa/swrast/s_fog.c | |
parent | 733a4b602bbbfda83ee03b7ae4f3737bbe659034 (diff) |
Converted line drawing over to new span code, pb no longer used.
Big clean-up of line drawing code.
Removed many obsolete span processing functions.
Diffstat (limited to 'src/mesa/swrast/s_fog.c')
-rw-r--r-- | src/mesa/swrast/s_fog.c | 99 |
1 files changed, 7 insertions, 92 deletions
diff --git a/src/mesa/swrast/s_fog.c b/src/mesa/swrast/s_fog.c index 2c3b7878b72..caaefcb688f 100644 --- a/src/mesa/swrast/s_fog.c +++ b/src/mesa/swrast/s_fog.c @@ -1,10 +1,10 @@ -/* $Id: s_fog.c,v 1.20 2002/01/28 03:42:28 brianp Exp $ */ +/* $Id: s_fog.c,v 1.21 2002/02/02 21:40:33 brianp Exp $ */ /* * Mesa 3-D graphics library - * Version: 3.5 + * Version: 4.1 * - * Copyright (C) 1999-2001 Brian Paul All Rights Reserved. + * Copyright (C) 1999-2002 Brian Paul All Rights Reserved. * * Permission is hereby granted, free of charge, to any person obtaining a * copy of this software and associated documentation files (the "Software"), @@ -33,7 +33,6 @@ #include "s_context.h" #include "s_fog.h" -#include "s_pb.h" @@ -135,34 +134,6 @@ _mesa_fog_rgba_pixels_with_array( const GLcontext *ctx, struct sw_span *span, } } -/** - * Apply fog to an array of RGBA pixels. - * Input: n - number of pixels - * fog - array of fog factors in [0,1] - * red, green, blue, alpha - pixel colors - * Output: red, green, blue, alpha - fogged pixel colors - */ -void -_old_fog_rgba_pixels( const GLcontext *ctx, - GLuint n, - const GLfloat fog[], - GLchan rgba[][4] ) -{ - GLuint i; - GLchan rFog, gFog, bFog; - - UNCLAMPED_FLOAT_TO_CHAN(rFog, ctx->Fog.Color[RCOMP]); - UNCLAMPED_FLOAT_TO_CHAN(gFog, ctx->Fog.Color[GCOMP]); - UNCLAMPED_FLOAT_TO_CHAN(bFog, ctx->Fog.Color[BCOMP]); - - for (i = 0; i < n; i++) { - const GLfloat f = fog[i]; - const GLfloat g = 1.0F - f; - rgba[i][RCOMP] = (GLchan) (f * rgba[i][RCOMP] + g * rFog); - rgba[i][GCOMP] = (GLchan) (f * rgba[i][GCOMP] + g * gFog); - rgba[i][BCOMP] = (GLchan) (f * rgba[i][BCOMP] + g * bFog); - } -} /** @@ -217,26 +188,6 @@ _mesa_fog_ci_pixels_with_array( const GLcontext *ctx, struct sw_span *span, } } -/** - * Apply fog to an array of color index pixels. - * Input: n - number of pixels - * fog - array of fog factors in [0,1] - * index - pixel color indexes - * Output: index - fogged pixel color indexes - */ -void -_old_fog_ci_pixels( const GLcontext *ctx, - GLuint n, const GLfloat fog[], GLuint index[] ) -{ - GLuint idx = (GLuint) ctx->Fog.Index; - GLuint i; - - for (i = 0; i < n; i++) { - const GLfloat f = CLAMP(fog[i], 0.0F, 1.0F); - index[i] = (GLuint) ((GLfloat) index[i] + (1.0F - f) * idx); - } -} - /** @@ -391,11 +342,11 @@ void _mesa_depth_fog_rgba_pixels(const GLcontext *ctx, struct sw_span *span, GLchan rgba[][4]) { - GLfloat fogFact[PB_SIZE]; + GLfloat fogFact[MAX_WIDTH]; ASSERT(ctx->Fog.Enabled); ASSERT(span->arrayMask & SPAN_Z); - ASSERT(span->end <= PB_SIZE); + ASSERT(span->end <= MAX_WIDTH); compute_fog_factors_from_z(ctx, span->end, span->zArray, fogFact ); _mesa_fog_rgba_pixels_with_array( ctx, span, fogFact, rgba ); @@ -403,24 +354,6 @@ _mesa_depth_fog_rgba_pixels(const GLcontext *ctx, struct sw_span *span, /** - * Apply fog to an array of RGBA pixels. - * Input: n - number of pixels - * z - array of integer depth values - * red, green, blue, alpha - pixel colors - * Output: red, green, blue, alpha - fogged pixel colors - */ -void -_old_depth_fog_rgba_pixels( const GLcontext *ctx, - GLuint n, const GLdepth z[], GLchan rgba[][4] ) -{ - GLfloat fogFact[PB_SIZE]; - ASSERT(n <= PB_SIZE); - compute_fog_factors_from_z( ctx, n, z, fogFact ); - _old_fog_rgba_pixels( ctx, n, fogFact, rgba ); -} - - -/** * Apply fog to a span of color index pixels. * Input: ctx - * span - where span->zArray has to be filled. @@ -431,30 +364,12 @@ void _mesa_depth_fog_ci_pixels( const GLcontext *ctx, struct sw_span *span, GLuint index[] ) { - GLfloat fogFact[PB_SIZE]; + GLfloat fogFact[MAX_WIDTH]; ASSERT(ctx->Fog.Enabled); ASSERT(span->arrayMask & SPAN_Z); - ASSERT(span->end <= PB_SIZE); + ASSERT(span->end <= MAX_WIDTH); compute_fog_factors_from_z(ctx, span->end, span->zArray, fogFact ); _mesa_fog_ci_pixels_with_array( ctx, span, fogFact, index ); } - - -/** - * Apply fog to an array of color index pixels. - * Input: n - number of pixels - * z - array of integer depth values - * index - pixel color indexes - * Output: index - fogged pixel color indexes - */ -void -_old_depth_fog_ci_pixels( const GLcontext *ctx, - GLuint n, const GLdepth z[], GLuint index[] ) -{ - GLfloat fogFact[PB_SIZE]; - ASSERT(n <= PB_SIZE); - compute_fog_factors_from_z( ctx, n, z, fogFact ); - _old_fog_ci_pixels( ctx, n, fogFact, index ); -} |