-/* $Id: s_copypix.c,v 1.18 2001/05/16 20:27:12 brianp Exp $ */
+/* $Id: s_copypix.c,v 1.19 2001/05/30 15:22:05 brianp Exp $ */
/*
* Mesa 3-D graphics library
{
SWcontext *swrast = SWRAST_CONTEXT(ctx);
GLdepth zspan[MAX_WIDTH];
+ GLfloat fogSpan[MAX_WIDTH];
GLboolean quick_draw;
GLint row;
GLboolean changeBuffer;
if (ctx->Depth.Test || ctx->Fog.Enabled) {
/* fill in array of z values */
- GLdepth z = (GLdepth)
- (ctx->Current.RasterPos[2] * ctx->DepthMax);
+ GLdepth z = (GLdepth) (ctx->Current.RasterPos[2] * ctx->DepthMax);
+ GLfloat fog = (ctx->Fog.FogCoordinateSource == GL_FOG_COORDINATE_EXT) ?
+ ctx->Current.RasterFogCoord : ctx->Current.RasterDistance;
GLint i;
for (i = 0; i < width; i++) {
zspan[i] = z;
+ fogSpan[i] = fog;
}
}
(const GLchan (*)[4])rgba, NULL );
}
else if (zoom) {
- _mesa_write_zoomed_rgba_span( ctx, width, destx, dy, zspan, 0,
+ _mesa_write_zoomed_rgba_span( ctx, width, destx, dy, zspan, fogSpan,
(const GLchan (*)[4])rgba, desty);
}
else {
- _mesa_write_rgba_span( ctx, width, destx, dy, zspan, 0, rgba,
+ _mesa_write_rgba_span( ctx, width, destx, dy, zspan, fogSpan, rgba,
NULL, GL_BITMAP );
}
}
{
SWcontext *swrast = SWRAST_CONTEXT(ctx);
GLdepth zspan[MAX_WIDTH];
+ GLfloat fogSpan[MAX_WIDTH];
GLchan rgba[MAX_WIDTH][4];
GLchan *tmpImage,*p;
GLboolean quick_draw;
if (ctx->Depth.Test || ctx->Fog.Enabled) {
/* fill in array of z values */
GLdepth z = (GLdepth) (ctx->Current.RasterPos[2] * ctx->DepthMax);
+ GLfloat fog = (ctx->Fog.FogCoordinateSource == GL_FOG_COORDINATE_EXT) ?
+ ctx->Current.RasterFogCoord : ctx->Current.RasterDistance;
for (i=0;i<width;i++) {
zspan[i] = z;
+ fogSpan[i] = fog;
}
}
(const GLchan (*)[4])rgba, NULL );
}
else if (zoom) {
- _mesa_write_zoomed_rgba_span( ctx, width, destx, dy, zspan, 0,
+ _mesa_write_zoomed_rgba_span( ctx, width, destx, dy, zspan, fogSpan,
(const GLchan (*)[4])rgba, desty);
}
else {
- _mesa_write_rgba_span( ctx, width, destx, dy, zspan, 0, rgba,
+ _mesa_write_rgba_span( ctx, width, destx, dy, zspan, fogSpan, rgba,
NULL, GL_BITMAP );
}
}
{
SWcontext *swrast = SWRAST_CONTEXT(ctx);
GLdepth zspan[MAX_WIDTH];
+ GLfloat fogSpan[MAX_WIDTH];
GLuint *tmpImage,*p;
GLint sy, dy, stepy;
GLint i, j;
if (ctx->Depth.Test || ctx->Fog.Enabled) {
/* fill in array of z values */
GLdepth z = (GLdepth) (ctx->Current.RasterPos[2] * ctx->DepthMax);
+ GLfloat fog = (ctx->Fog.FogCoordinateSource == GL_FOG_COORDINATE_EXT) ?
+ ctx->Current.RasterFogCoord : ctx->Current.RasterDistance;
for (i=0;i<width;i++) {
zspan[i] = z;
+ fogSpan[i] = fog;
}
}
}
if (zoom) {
- _mesa_write_zoomed_index_span(ctx, width, destx, dy, zspan, 0,
+ _mesa_write_zoomed_index_span(ctx, width, destx, dy, zspan, fogSpan,
indexes, desty );
}
else {
- _mesa_write_index_span(ctx, width, destx, dy, zspan, 0, indexes,
+ _mesa_write_index_span(ctx, width, destx, dy, zspan, fogSpan, indexes,
NULL, GL_BITMAP);
}
}
{
GLfloat depth[MAX_WIDTH];
GLdepth zspan[MAX_WIDTH];
+ GLfloat fogSpan[MAX_WIDTH];
GLfloat *p, *tmpImage;
GLuint indexes[MAX_WIDTH];
GLint sy, dy, stepy;
}
}
+ if (ctx->Fog.Enabled) {
+ GLfloat fog = (ctx->Fog.FogCoordinateSource == GL_FOG_COORDINATE_EXT) ?
+ ctx->Current.RasterFogCoord : ctx->Current.RasterDistance;
+ for (i = 0; i < width; i++) {
+ fogSpan[i] = fog;
+ }
+ }
+
if (overlapping) {
GLint ssy = sy;
tmpImage = (GLfloat *) MALLOC(width * height * sizeof(GLfloat));
if (ctx->Visual.rgbMode) {
if (zoom) {
- _mesa_write_zoomed_rgba_span( ctx, width, destx, dy, zspan, 0,
- (const GLchan (*)[4])rgba, desty );
+ _mesa_write_zoomed_rgba_span( ctx, width, destx, dy, zspan,
+ fogSpan, (const GLchan (*)[4])rgba, desty );
}
else {
- _mesa_write_rgba_span( ctx, width, destx, dy, zspan, 0,
+ _mesa_write_rgba_span( ctx, width, destx, dy, zspan, fogSpan,
rgba, NULL, GL_BITMAP);
}
}
else {
if (zoom) {
_mesa_write_zoomed_index_span( ctx, width, destx, dy,
- zspan, 0, indexes, desty );
+ zspan, fogSpan, indexes, desty );
}
else {
_mesa_write_index_span( ctx, width, destx, dy,
- zspan, 0, indexes, NULL, GL_BITMAP );
+ zspan, fogSpan, indexes, NULL, GL_BITMAP );
}
}
}
-/* $Id: s_drawpix.c,v 1.19 2001/05/16 20:27:12 brianp Exp $ */
+/* $Id: s_drawpix.c,v 1.20 2001/05/30 15:22:05 brianp Exp $ */
/*
* Mesa 3-D graphics library
const GLint desty = y;
GLint row, drawWidth;
GLdepth zspan[MAX_WIDTH];
+ GLfloat fogSpan[MAX_WIDTH];
drawWidth = (width > MAX_WIDTH) ? MAX_WIDTH : width;
/* Fragment depth values */
if (ctx->Depth.Test || ctx->Fog.Enabled) {
GLdepth zval = (GLdepth) (ctx->Current.RasterPos[2] * ctx->DepthMaxF);
+ GLfloat fog = (ctx->Fog.FogCoordinateSource == GL_FOG_COORDINATE_EXT) ?
+ ctx->Current.RasterFogCoord : ctx->Current.RasterDistance;
GLint i;
for (i = 0; i < drawWidth; i++) {
zspan[i] = zval;
+ fogSpan[i] = fog;
}
}
type, source, &ctx->Unpack,
ctx->_ImageTransferState);
if (zoom) {
- _mesa_write_zoomed_index_span(ctx, drawWidth, x, y, zspan, 0,
+ _mesa_write_zoomed_index_span(ctx, drawWidth, x, y, zspan, fogSpan,
indexes, desty);
}
else {
- _mesa_write_index_span(ctx, drawWidth, x, y, zspan, 0, indexes,
+ _mesa_write_index_span(ctx, drawWidth, x, y, zspan, fogSpan, indexes,
NULL, GL_BITMAP);
}
}
const GLboolean zoom = ctx->Pixel.ZoomX!=1.0 || ctx->Pixel.ZoomY!=1.0;
const GLint desty = y;
GLdepth zspan[MAX_WIDTH];
+ GLfloat fogSpan[MAX_WIDTH];
GLboolean quickDraw;
GLfloat *convImage = NULL;
GLuint transferOps = ctx->_ImageTransferState;
if (ctx->Depth.Test || ctx->Fog.Enabled) {
/* fill in array of z values */
GLdepth z = (GLdepth) (ctx->Current.RasterPos[2] * ctx->DepthMaxF);
+ GLfloat fog = (ctx->Fog.FogCoordinateSource == GL_FOG_COORDINATE_EXT) ?
+ ctx->Current.RasterFogCoord : ctx->Current.RasterDistance;
GLint i;
for (i=0;i<width;i++) {
zspan[i] = z;
+ fogSpan[i] = fog;
}
}
(CONST GLchan (*)[4]) rgba, NULL);
}
else if (zoom) {
- _mesa_write_zoomed_rgba_span(ctx, width, x, y, zspan, 0,
+ _mesa_write_zoomed_rgba_span(ctx, width, x, y, zspan, fogSpan,
(CONST GLchan (*)[4]) rgba, desty);
}
else {
- _mesa_write_rgba_span(ctx, (GLuint) width, x, y, zspan, 0,
+ _mesa_write_rgba_span(ctx, (GLuint) width, x, y, zspan, fogSpan,
rgba, NULL, GL_BITMAP);
}
}