[Scummvm-cvs-logs] scummvm master -> 0b79af9a5db5a805234fa790b72c69c49b47570e

Strangerke Strangerke at scummvm.org
Fri Oct 10 07:24:28 CEST 2014


This automated email contains information about 1 new commit which have been
pushed to the 'scummvm' repo located at https://github.com/scummvm/scummvm .

Summary:
0b79af9a5d MADS: Reduce the scope of a couple of variables in MSurface


Commit: 0b79af9a5db5a805234fa790b72c69c49b47570e
    https://github.com/scummvm/scummvm/commit/0b79af9a5db5a805234fa790b72c69c49b47570e
Author: Strangerke (strangerke at scummvm.org)
Date: 2014-10-10T07:22:31+02:00

Commit Message:
MADS: Reduce the scope of a couple of variables in MSurface

Changed paths:
    engines/mads/msurface.cpp



diff --git a/engines/mads/msurface.cpp b/engines/mads/msurface.cpp
index 349f4a5..0cb4530 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);






More information about the Scummvm-git-logs mailing list