summaryrefslogtreecommitdiffstats
path: root/src
diff options
context:
space:
mode:
authorBrian Paul <[email protected]>2001-05-11 18:58:32 +0000
committerBrian Paul <[email protected]>2001-05-11 18:58:32 +0000
commitd29e9dfe93cc4ff22cbffba400741f726b953c66 (patch)
tree1dc91ff5f56e0b2ad716761277f78d9b04291399 /src
parentc6083e1dc47057b64179079715c5eac8f6010467 (diff)
fixed scissor clear problem (Michael Saunders)
Diffstat (limited to 'src')
-rw-r--r--src/mesa/swrast/s_alphabuf.c15
1 files changed, 11 insertions, 4 deletions
diff --git a/src/mesa/swrast/s_alphabuf.c b/src/mesa/swrast/s_alphabuf.c
index 9d88c609209..8c324a4588a 100644
--- a/src/mesa/swrast/s_alphabuf.c
+++ b/src/mesa/swrast/s_alphabuf.c
@@ -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
@@ -164,6 +164,7 @@ _mesa_clear_alpha_buffers( GLcontext *ctx )
GLint j;
GLint rowLen = ctx->DrawBuffer->_Xmax - ctx->DrawBuffer->_Xmin + 1;
GLint rows = ctx->DrawBuffer->_Ymax - ctx->DrawBuffer->_Ymin + 1;
+ GLint width = ctx->DrawBuffer->Width;
GLchan *aptr = buffer
+ ctx->DrawBuffer->_Ymin * ctx->DrawBuffer->Width
+ ctx->DrawBuffer->_Xmin;
@@ -175,13 +176,19 @@ _mesa_clear_alpha_buffers( GLcontext *ctx )
#else
#error unexpected CHAN_BITS value
#endif
- aptr += rowLen;
+ aptr += width;
}
}
else {
/* clear whole buffer */
- GLuint bytes = ctx->DrawBuffer->Width * ctx->DrawBuffer->Height;
- MEMSET( buffer, aclear, bytes );
+ GLuint pixels = ctx->DrawBuffer->Width * ctx->DrawBuffer->Height;
+#if CHAN_BITS == 8
+ MEMSET(buffer, aclear, pixels);
+#elif CHAN_BITS == 16
+ MEMSET16(buffer, aclear, pixels);
+#else
+#error unexpected CHAN_BITS value
+#endif
}
}
}