mirror of https://github.com/OpenTTD/OpenTTD
(svn r499) Merge r498 to trunk:
Disabled buttons flicker no more This solves bug report 991101release/0.4.5
parent
f6690500bf
commit
2eb00c0bd3
12
gfx.c
12
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) {
|
void GfxFillRect(int left, int top, int right, int bottom, int color) {
|
||||||
DrawPixelInfo *dpi = _cur_dpi;
|
DrawPixelInfo *dpi = _cur_dpi;
|
||||||
byte *dst,*ctab;
|
byte *dst,*ctab;
|
||||||
|
const int otop = top;
|
||||||
|
const int oleft = left;
|
||||||
|
|
||||||
if (dpi->zoom != 0)
|
if (dpi->zoom != 0)
|
||||||
return;
|
return;
|
||||||
|
@ -159,15 +161,13 @@ void GfxFillRect(int left, int top, int right, int bottom, int color) {
|
||||||
} while (--bottom);
|
} while (--bottom);
|
||||||
}
|
}
|
||||||
} else {
|
} else {
|
||||||
byte bo = 0;
|
byte bo = (oleft - left + dpi->left + otop - top + dpi->top) & 1;
|
||||||
do {
|
do {
|
||||||
int i;
|
int i;
|
||||||
byte b = (bo^=1);
|
for (i = (bo ^= 1); i < right; i += 2)
|
||||||
for(i=0; i!=right;i++)
|
dst[i] = (byte)color;
|
||||||
if ((b^=1) != 0)
|
|
||||||
dst[i] = (byte)color;
|
|
||||||
dst += dpi->pitch;
|
dst += dpi->pitch;
|
||||||
} while (--bottom);
|
} while (--bottom > 0);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
Loading…
Reference in New Issue