summaryrefslogtreecommitdiffstats
path: root/src/mesa/swrast/s_drawpix.c
diff options
context:
space:
mode:
authorBrian Paul <[email protected]>2001-02-17 18:41:01 +0000
committerBrian Paul <[email protected]>2001-02-17 18:41:01 +0000
commite75d2424e53d6023f4414e40694cd467e5392b96 (patch)
treead354e0042460ae53e689229498872625e07d412 /src/mesa/swrast/s_drawpix.c
parent8f9a594ac8116ed5cab7f8eca14c17ec3e250dad (diff)
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.
Diffstat (limited to 'src/mesa/swrast/s_drawpix.c')
-rw-r--r--src/mesa/swrast/s_drawpix.c16
1 files changed, 13 insertions, 3 deletions
diff --git a/src/mesa/swrast/s_drawpix.c b/src/mesa/swrast/s_drawpix.c
index 757f1ab0717..24339f61bbc 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,