(svn r499) Merge r498 to trunk:
authortron
Mon, 01 Nov 2004 15:08:40 +0000
changeset 332 745ec2bbdd5e
parent 331 4236de1f9a43
child 333 6dee54ed9701
(svn r499) Merge r498 to trunk:
Disabled buttons flicker no more
This solves bug report 991101
gfx.c
--- a/gfx.c	Tue Oct 26 20:56:51 2004 +0000
+++ b/gfx.c	Mon Nov 01 15:08:40 2004 +0000
@@ -115,6 +115,8 @@
 void GfxFillRect(int left, int top, int right, int bottom, int color) {
 	DrawPixelInfo *dpi = _cur_dpi;
 	byte *dst,*ctab;
+	const int otop = top;
+	const int oleft = left;
 
 	if (dpi->zoom != 0)
 		return;
@@ -159,15 +161,13 @@
 			} while (--bottom);
 		}
 	} else {
-		byte bo = 0;
+		byte bo = (oleft - left + dpi->left + otop - top + dpi->top) & 1;
 		do {
 			int i;
-			byte b = (bo^=1);
-			for(i=0; i!=right;i++)
-				if ((b^=1) != 0)
-					dst[i] = (byte)color;
+			for (i = (bo ^= 1); i < right; i += 2)
+				dst[i] = (byte)color;
 			dst += dpi->pitch;
-		} while (--bottom);
+		} while (--bottom > 0);
 	}
 }