From 551b65f13754e6760e5c272ff86f8873c9c13e5c Mon Sep 17 00:00:00 2001 From: Brian Paul Date: Sat, 21 Sep 2002 17:34:56 +0000 Subject: GL_MESA_pack_invert --- src/mesa/swrast/s_readpix.c | 11 +++++++++-- 1 file changed, 9 insertions(+), 2 deletions(-) (limited to 'src/mesa/swrast/s_readpix.c') diff --git a/src/mesa/swrast/s_readpix.c b/src/mesa/swrast/s_readpix.c index f925e79116..562d871846 100644 --- a/src/mesa/swrast/s_readpix.c +++ b/src/mesa/swrast/s_readpix.c @@ -1,4 +1,4 @@ -/* $Id: s_readpix.c,v 1.15 2002/07/09 01:22:52 brianp Exp $ */ +/* $Id: s_readpix.c,v 1.16 2002/09/21 17:34:56 brianp Exp $ */ /* * Mesa 3-D graphics library @@ -279,8 +279,15 @@ read_fast_rgba_pixels( GLcontext *ctx, if (0) { #endif GLchan *dest = (GLchan *) pixels - + (skipRows * rowLength + skipPixels) * 4; + + (skipRows * rowLength + skipPixels) * 4; GLint row; + + if (packing->Invert) { + /* start at top and go down */ + dest += (readHeight - 1) * rowLength * 4; + rowLength = -rowLength; + } + for (row=0; rowDriver.ReadRGBASpan)(ctx, readWidth, srcX, srcY, (GLchan (*)[4]) dest); -- cgit v1.2.3