summaryrefslogtreecommitdiff
path: root/gfx.c
diff options
context:
space:
mode:
authortron <tron@openttd.org>2005-07-11 15:47:20 +0000
committertron <tron@openttd.org>2005-07-11 15:47:20 +0000
commit9c3188741fca38175425b27acf561f73a89a1200 (patch)
treeeb2cccd7a85a01b6f03889684087fa8a0bba3e58 /gfx.c
parentf479013b14bcff07a6750bf32e365d8ba6830999 (diff)
downloadopenttd-9c3188741fca38175425b27acf561f73a89a1200.tar.xz
(svn r2546) Don't calculate a value which never gets used and simplify some calculations
Diffstat (limited to 'gfx.c')
-rw-r--r--gfx.c13
1 files changed, 4 insertions, 9 deletions
diff --git a/gfx.c b/gfx.c
index 2d4e57d24..bbd9d1efe 100644
--- a/gfx.c
+++ b/gfx.c
@@ -1351,30 +1351,25 @@ static void GfxMainBlitter(const Sprite* sprite, int x, int y, int mode)
bp.dst += bp.pitch * (y >> dpi->zoom);
}
- if ( (y = y + bp.height - dpi->height) > 0) {
- bp.height -= y;
+ if (bp.height > dpi->height - y) {
+ bp.height = dpi->height - y;
if (bp.height <= 0) return;
}
- start_x = 0;
-
x &= zoom_mask;
if ( (x -= dpi->left) < 0) {
bp.width += x;
if (bp.width <= 0) return;
- start_x -= x;
bp.sprite -= x;
x = 0;
}
bp.dst += x >> dpi->zoom;
- if ( (x = x + bp.width - dpi->width) > 0) {
- bp.width -= x;
+ if (bp.width > dpi->width - x) {
+ bp.width = dpi->width - x;
if (bp.width <= 0) return;
- start_x += x;
}
- bp.start_x = start_x;
zf_uncomp[dpi->zoom](&bp);
}