change mask[] test in put_mono_row_uint()
authorBrian Paul <brian.paul@tungstengraphics.com>
Tue, 20 Sep 2005 04:47:04 +0000 (04:47 +0000)
committerBrian Paul <brian.paul@tungstengraphics.com>
Tue, 20 Sep 2005 04:47:04 +0000 (04:47 +0000)
src/mesa/main/renderbuffer.c

index c6f1171..17fb645 100644 (file)
@@ -373,10 +373,18 @@ put_mono_row_uint(GLcontext *ctx, struct gl_renderbuffer *rb, GLuint count,
 {
    const GLuint val = *((const GLuint *) value);
    GLuint *dst = (GLuint *) rb->Data + y * rb->Width + x;
-   GLuint i;
    ASSERT(rb->DataType == GL_UNSIGNED_INT);
-   for (i = 0; i < count; i++) {
-      if (!mask || mask[i]) {
+   if (mask) {
+      GLuint i;
+      for (i = 0; i < count; i++) {
+         if (mask[i]) {
+            dst[i] = val;
+         }
+      }
+   }
+   else {
+      GLuint i;
+      for (i = 0; i < count; i++) {
          dst[i] = val;
       }
    }