summaryrefslogtreecommitdiff
path: root/gfx.c
diff options
context:
space:
mode:
authortron <tron@openttd.org>2004-11-01 15:08:40 +0000
committertron <tron@openttd.org>2004-11-01 15:08:40 +0000
commit2eb00c0bd342bfa2373d21e06bf88dfcc7df35f5 (patch)
treec2c82b34a45cc242abbb6bca152d5465bce48e05 /gfx.c
parentf6690500bf8495ccb756b59fc0b08876fc6aa2d7 (diff)
downloadopenttd-2eb00c0bd342bfa2373d21e06bf88dfcc7df35f5.tar.xz
(svn r499) Merge r498 to trunk:
Disabled buttons flicker no more This solves bug report 991101
Diffstat (limited to 'gfx.c')
-rw-r--r--gfx.c12
1 files changed, 6 insertions, 6 deletions
diff --git a/gfx.c b/gfx.c
index 4a877328f..aa208b7fc 100644
--- a/gfx.c
+++ b/gfx.c
@@ -115,6 +115,8 @@ void GfxScroll(int left, int top, int width, int height, int xo, int yo) {
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 @@ void GfxFillRect(int left, int top, int right, int bottom, int color) {
} 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);
}
}