-/* $Id: s_drawpix.c,v 1.47 2003/03/25 02:23:45 brianp Exp $ */
-
/*
* Mesa 3-D graphics library
* Version: 5.1
_swrast_span_default_z(ctx, &span);
if (ctx->Fog.Enabled)
_swrast_span_default_fog(ctx, &span);
- if (ctx->Texture._EnabledUnits)
+ if (ctx->Texture._EnabledCoordUnits)
_swrast_span_default_texcoords(ctx, &span);
if ((SWRAST_CONTEXT(ctx)->_RasterMask & ~CLIP_BIT) == 0
- && ctx->Texture._EnabledUnits == 0
+ && ctx->Texture._EnabledCoordUnits == 0
&& unpack->Alignment == 1
&& !unpack->SwapBytes
&& !unpack->LsbFirst) {
GLint skipPixels = unpack->SkipPixels;
GLint skipRows = unpack->SkipRows;
GLint rowLength;
- GLdepth zSpan[MAX_WIDTH]; /* only used when zooming */
GLint zoomY0 = 0;
if (unpack->RowLength > 0)
return GL_TRUE;
}
else {
- /* setup array of fragment Z value to pass to zoom function */
- GLdepth z = (GLdepth) (ctx->Current.RasterPos[2] * ctx->DepthMaxF);
- GLint i;
if (drawWidth > MAX_WIDTH)
return GL_FALSE; /* fall back to general case path */
- for (i=0; i<drawWidth; i++)
- zSpan[i] = z;
/* save Y value of first row */
zoomY0 = IROUND(ctx->Current.RasterPos[1]);
GLenum type, const GLvoid *pixels )
{
const GLboolean bias_or_scale = ctx->Pixel.DepthBias!=0.0 || ctx->Pixel.DepthScale!=1.0;
- const GLboolean zoom = ctx->Pixel.ZoomX!=1.0 || ctx->Pixel.ZoomY!=1.0;
+ const GLboolean zoom = ctx->Pixel.ZoomX != 1.0 || ctx->Pixel.ZoomY != 1.0;
const GLint desty = y;
struct sw_span span;
if (ctx->Fog.Enabled)
_swrast_span_default_fog(ctx, &span);
- if (ctx->Texture._EnabledUnits)
+ if (ctx->Texture._EnabledCoordUnits)
_swrast_span_default_texcoords(ctx, &span);
if (type == GL_UNSIGNED_SHORT && ctx->Visual.depthBits == 16
span.array->z[i] = (GLdepth) (floatSpan[i] * zs + 0.5F);
}
}
- if (ctx->Visual.rgbMode) {
- if (zoom) {
- _swrast_write_zoomed_rgba_span(ctx, &span,
- (const GLchan (*)[4]) span.array->rgba,
- desty, skipPixels);
- }
- else
- _swrast_write_rgba_span(ctx, &span);
+ if (zoom) {
+ _swrast_write_zoomed_depth_span(ctx, &span, desty, skipPixels);
+ }
+ else if (ctx->Visual.rgbMode) {
+ _swrast_write_rgba_span(ctx, &span);
}
else {
- if (zoom)
- _swrast_write_zoomed_index_span(ctx, &span, desty, 0);
- else
- _swrast_write_index_span(ctx, &span);
+ _swrast_write_index_span(ctx, &span);
}
}
skipPixels += spanEnd;
_swrast_span_default_z(ctx, &span);
if (ctx->Fog.Enabled)
_swrast_span_default_fog(ctx, &span);
- if (ctx->Texture._EnabledUnits)
+ if (ctx->Texture._EnabledCoordUnits)
_swrast_span_default_texcoords(ctx, &span);
if (SWRAST_CONTEXT(ctx)->_RasterMask == 0 && !zoom && x >= 0 && y >= 0