aboutsummaryrefslogtreecommitdiff
path: root/engines/mads/msurface.cpp
diff options
context:
space:
mode:
authorStrangerke2014-10-10 07:22:31 +0200
committerStrangerke2014-10-10 07:22:31 +0200
commit0b79af9a5db5a805234fa790b72c69c49b47570e (patch)
treed35ec3970f1e2c24c40217409db8fc9bd0727fa5 /engines/mads/msurface.cpp
parent2003a4a2b4f745b0b4ff3fe7e9ff17600b43eeab (diff)
downloadscummvm-rg350-0b79af9a5db5a805234fa790b72c69c49b47570e.tar.gz
scummvm-rg350-0b79af9a5db5a805234fa790b72c69c49b47570e.tar.bz2
scummvm-rg350-0b79af9a5db5a805234fa790b72c69c49b47570e.zip
MADS: Reduce the scope of a couple of variables in MSurface
Diffstat (limited to 'engines/mads/msurface.cpp')
-rw-r--r--engines/mads/msurface.cpp5
1 files changed, 3 insertions, 2 deletions
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);