summaryrefslogtreecommitdiffstats
path: root/src/mesa/main/image.c
diff options
context:
space:
mode:
authorBrian <[email protected]>2007-08-02 09:08:29 -0600
committerBrian <[email protected]>2007-08-02 09:08:29 -0600
commit2c3cb693ccb760b7b1b7bb9f37491d1499c97938 (patch)
tree697550de35cdf1327710608b32ddf9d601ecf77e /src/mesa/main/image.c
parente2556b7487cb383e285f6b21c5513edd8c5d37e6 (diff)
fix stencil value masking bug 11805, and fix sizeof() bug
Diffstat (limited to 'src/mesa/main/image.c')
-rw-r--r--src/mesa/main/image.c9
1 files changed, 3 insertions, 6 deletions
diff --git a/src/mesa/main/image.c b/src/mesa/main/image.c
index 8fccd44f211..9760e5f8d24 100644
--- a/src/mesa/main/image.c
+++ b/src/mesa/main/image.c
@@ -3733,7 +3733,7 @@ _mesa_pack_stencil_span( const GLcontext *ctx, GLuint n,
switch (dstType) {
case GL_UNSIGNED_BYTE:
- if (sizeof(GLstencil) == 8) {
+ if (sizeof(GLstencil) == 1) {
_mesa_memcpy( dest, source, n );
}
else {
@@ -3745,14 +3745,11 @@ _mesa_pack_stencil_span( const GLcontext *ctx, GLuint n,
}
break;
case GL_BYTE:
- if (sizeof(GLstencil) == 8) {
- _mesa_memcpy( dest, source, n );
- }
- else {
+ {
GLbyte *dst = (GLbyte *) dest;
GLuint i;
for (i=0;i<n;i++) {
- dst[i] = (GLbyte) source[i];
+ dst[i] = (GLbyte) (source[i] & 0x7f);
}
}
break;