From e75d2424e53d6023f4414e40694cd467e5392b96 Mon Sep 17 00:00:00 2001 From: Brian Paul Date: Sat, 17 Feb 2001 18:41:01 +0000 Subject: Changed FetchTexel() function pointer arguments. Implemented glGetTexImage(format=GL_COLOR_INDEX). Changed _mesa_unpack_depth_span() args. Minor changes/clean-ups in mtypes.h. Histogram counter component sizes were wrong. --- src/mesa/swrast/s_drawpix.c | 16 +++++++++++++--- 1 file changed, 13 insertions(+), 3 deletions(-) (limited to 'src/mesa/swrast/s_drawpix.c') diff --git a/src/mesa/swrast/s_drawpix.c b/src/mesa/swrast/s_drawpix.c index 757f1ab071..24339f61bb 100644 --- a/src/mesa/swrast/s_drawpix.c +++ b/src/mesa/swrast/s_drawpix.c @@ -1,4 +1,4 @@ -/* $Id: s_drawpix.c,v 1.8 2001/01/23 23:39:37 brianp Exp $ */ +/* $Id: s_drawpix.c,v 1.9 2001/02/17 18:41:01 brianp Exp $ */ /* * Mesa 3-D graphics library @@ -653,11 +653,21 @@ draw_depth_pixels( GLcontext *ctx, GLint x, GLint y, /* General case */ GLint row; for (row = 0; row < height; row++, y++) { + GLfloat fspan[MAX_WIDTH]; GLdepth zspan[MAX_WIDTH]; const GLvoid *src = _mesa_image_address(&ctx->Unpack, pixels, width, height, GL_DEPTH_COMPONENT, type, 0, row, 0); - _mesa_unpack_depth_span( ctx, drawWidth, zspan, type, src, - &ctx->Unpack, ctx->_ImageTransferState ); + _mesa_unpack_depth_span( ctx, drawWidth, fspan, type, src, + &ctx->Unpack ); + /* clamp depth values to [0,1] and convert from floats to integers */ + { + const GLfloat zs = ctx->DepthMaxF; + GLuint i; + for (i = 0; i < drawWidth; i++) { + zspan[i] = (GLdepth) (fspan[i] * zs); + } + } + if (ctx->Visual.rgbMode) { if (zoom) { gl_write_zoomed_rgba_span(ctx, width, x, y, zspan, 0, -- cgit v1.2.3