From 0b79af9a5db5a805234fa790b72c69c49b47570e Mon Sep 17 00:00:00 2001 From: Strangerke Date: Fri, 10 Oct 2014 07:22:31 +0200 Subject: MADS: Reduce the scope of a couple of variables in MSurface --- engines/mads/msurface.cpp | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) (limited to 'engines/mads/msurface.cpp') diff --git a/engines/mads/msurface.cpp b/engines/mads/msurface.cpp index 349f4a5f23..0cb4530a84 100644 --- a/engines/mads/msurface.cpp +++ b/engines/mads/msurface.cpp @@ -266,11 +266,11 @@ void MSurface::copyFrom(MSurface *src, const Common::Point &destPos, int depth, int highestDim = MAX(frameWidth, frameHeight); bool lineDist[MADS_SCREEN_WIDTH]; - int distIndex = 0; int distXCount = 0, distYCount = 0; if (scale != -1) { int distCtr = 0; + int distIndex = 0; do { distCtr += scale; if (distCtr < 100) { @@ -356,9 +356,10 @@ void MSurface::copyFrom(MSurface *src, const Common::Point &destPos, int depth, if (widthAmount > 0) spriteWidth -= widthAmount; - int spriteRight = spriteLeft + spriteWidth; if (spriteWidth <= 0) return; + + int spriteRight = spriteLeft + spriteWidth; if (flipped) { destX += distXCount - 1; spriteLeft = -(distXCount - spriteRight); -- cgit v1.2.3