fixed scissor clear problem (Michael Saunders)

This commit is contained in:
Brian Paul
2001-05-11 18:58:32 +00:00
parent c6083e1dc4
commit d29e9dfe93

View File

@@ -1,4 +1,4 @@
/* $Id: s_alphabuf.c,v 1.6 2001/03/12 00:48:41 gareth Exp $ */ /* $Id: s_alphabuf.c,v 1.7 2001/05/11 18:58:32 brianp Exp $ */
/* /*
* Mesa 3-D graphics library * Mesa 3-D graphics library
@@ -164,6 +164,7 @@ _mesa_clear_alpha_buffers( GLcontext *ctx )
GLint j; GLint j;
GLint rowLen = ctx->DrawBuffer->_Xmax - ctx->DrawBuffer->_Xmin + 1; GLint rowLen = ctx->DrawBuffer->_Xmax - ctx->DrawBuffer->_Xmin + 1;
GLint rows = ctx->DrawBuffer->_Ymax - ctx->DrawBuffer->_Ymin + 1; GLint rows = ctx->DrawBuffer->_Ymax - ctx->DrawBuffer->_Ymin + 1;
GLint width = ctx->DrawBuffer->Width;
GLchan *aptr = buffer GLchan *aptr = buffer
+ ctx->DrawBuffer->_Ymin * ctx->DrawBuffer->Width + ctx->DrawBuffer->_Ymin * ctx->DrawBuffer->Width
+ ctx->DrawBuffer->_Xmin; + ctx->DrawBuffer->_Xmin;
@@ -175,13 +176,19 @@ _mesa_clear_alpha_buffers( GLcontext *ctx )
#else #else
#error unexpected CHAN_BITS value #error unexpected CHAN_BITS value
#endif #endif
aptr += rowLen; aptr += width;
} }
} }
else { else {
/* clear whole buffer */ /* clear whole buffer */
GLuint bytes = ctx->DrawBuffer->Width * ctx->DrawBuffer->Height; GLuint pixels = ctx->DrawBuffer->Width * ctx->DrawBuffer->Height;
MEMSET( buffer, aclear, bytes ); #if CHAN_BITS == 8
MEMSET(buffer, aclear, pixels);
#elif CHAN_BITS == 16
MEMSET16(buffer, aclear, pixels);
#else
#error unexpected CHAN_BITS value
#endif
} }
} }
} }