(svn r2546) Don't calculate a value which never gets used and simplify some calculations

This commit is contained in:
tron 2005-07-11 15:47:20 +00:00
parent f479013b14
commit 9c3188741f
1 changed files with 4 additions and 9 deletions

13
gfx.c
View File

@ -1351,30 +1351,25 @@ static void GfxMainBlitter(const Sprite* sprite, int x, int y, int mode)
bp.dst += bp.pitch * (y >> dpi->zoom); bp.dst += bp.pitch * (y >> dpi->zoom);
} }
if ( (y = y + bp.height - dpi->height) > 0) { if (bp.height > dpi->height - y) {
bp.height -= y; bp.height = dpi->height - y;
if (bp.height <= 0) return; if (bp.height <= 0) return;
} }
start_x = 0;
x &= zoom_mask; x &= zoom_mask;
if ( (x -= dpi->left) < 0) { if ( (x -= dpi->left) < 0) {
bp.width += x; bp.width += x;
if (bp.width <= 0) return; if (bp.width <= 0) return;
start_x -= x;
bp.sprite -= x; bp.sprite -= x;
x = 0; x = 0;
} }
bp.dst += x >> dpi->zoom; bp.dst += x >> dpi->zoom;
if ( (x = x + bp.width - dpi->width) > 0) { if (bp.width > dpi->width - x) {
bp.width -= x; bp.width = dpi->width - x;
if (bp.width <= 0) return; if (bp.width <= 0) return;
start_x += x;
} }
bp.start_x = start_x;
zf_uncomp[dpi->zoom](&bp); zf_uncomp[dpi->zoom](&bp);
} }