[Scummvm-cvs-logs] scummvm master -> 767ce0ddc06ba1d499347f1bccc99d6892b87136

Strangerke Strangerke at scummvm.org
Mon Nov 23 00:34:19 CET 2015


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

Summary:
a12516ee18 MADS: Phantom: Reword scene101::handleAnimation0 for consistency, remove some useless variables in scene113
767ce0ddc0 MADS: Reduce the scope of a variable in panTransition


Commit: a12516ee1890e9057b7ca521b7f94aafd0205ce1
    https://github.com/scummvm/scummvm/commit/a12516ee1890e9057b7ca521b7f94aafd0205ce1
Author: Strangerke (strangerke at scummvm.org)
Date: 2015-11-23T00:28:15+01:00

Commit Message:
MADS: Phantom: Reword scene101::handleAnimation0 for consistency, remove some useless variables in scene113

Changed paths:
    engines/mads/phantom/phantom_scenes1.cpp



diff --git a/engines/mads/phantom/phantom_scenes1.cpp b/engines/mads/phantom/phantom_scenes1.cpp
index f42b3e6..53bf117 100644
--- a/engines/mads/phantom/phantom_scenes1.cpp
+++ b/engines/mads/phantom/phantom_scenes1.cpp
@@ -419,78 +419,77 @@ void Scene101::handleConversation1() {
 }
 
 void Scene101::handleAnimation0() {
-	int resetFrame;
-
-	if (_scene->getAnimFrame(_globals._animationIndexes[0]) != _callingFrame) {
-		_callingFrame = _scene->getAnimFrame(_globals._animationIndexes[0]);
-		resetFrame = -1;
-		switch (_callingFrame) {
-		case 1:
-		case 9:
-		case 12:
-			if (_callingStatus == 1) {
-				if (_callingFrame == 9) {
-					if (_startWalking0Fl) {
-						resetFrame = 13;
-						_callingStatus = 3;
-					} else
-						_callingStatus = 2;
-				} else
-					resetFrame = 1;
-			}
-
-			if (_callingStatus == 0) {
-				if (_startWalking0Fl) {
-					resetFrame = 60;
-					_callingStatus = 3;
-				} else
-					resetFrame = 0;
-			}
+	if (_scene->getAnimFrame(_globals._animationIndexes[0]) == _callingFrame)
+		return;
 
-			if (_callingStatus == 2) {
+	_callingFrame = _scene->getAnimFrame(_globals._animationIndexes[0]);
+	int resetFrame = -1;
+	switch (_callingFrame) {
+	case 1:
+	case 9:
+	case 12:
+		if (_callingStatus == 1) {
+			if (_callingFrame == 9) {
 				if (_startWalking0Fl) {
 					resetFrame = 13;
 					_callingStatus = 3;
-				} else {
-					++_talkCounter;
-
-					if (_talkCounter < 18) {
-						if (_vm->getRandomNumber(1, 2) == 1)
-							resetFrame = 7;
-						else
-							resetFrame = 10;
-					} else {
-						resetFrame = 54;
-						_callingStatus = 0;
-					}
-				}
-			}
-			break;
-
-		case 53:
-			_anim0Running = false;
-			_scene->freeAnimation(0);
-			break;
+				} else
+					_callingStatus = 2;
+			} else
+				resetFrame = 1;
+		}
 
-		case 59:
+		if (_callingStatus == 0) {
 			if (_startWalking0Fl) {
 				resetFrame = 60;
 				_callingStatus = 3;
-			} else {
+			} else
 				resetFrame = 0;
-				_callingStatus = 0;
-			}
-			break;
+		}
 
-		case 66:
-			resetFrame = 24;
-			break;
+		if (_callingStatus == 2) {
+			if (_startWalking0Fl) {
+				resetFrame = 13;
+				_callingStatus = 3;
+			} else {
+				++_talkCounter;
+
+				if (_talkCounter < 18) {
+					if (_vm->getRandomNumber(1, 2) == 1)
+						resetFrame = 7;
+					else
+						resetFrame = 10;
+				} else {
+					resetFrame = 54;
+					_callingStatus = 0;
+				}
+			}
 		}
+		break;
+
+	case 53:
+		_anim0Running = false;
+		_scene->freeAnimation(0);
+		break;
 
-		if (resetFrame >= 0) {
-			_scene->setAnimFrame(_globals._animationIndexes[0], resetFrame);
-			_callingFrame = resetFrame;
+	case 59:
+		if (_startWalking0Fl) {
+			resetFrame = 60;
+			_callingStatus = 3;
+		} else {
+			resetFrame = 0;
+			_callingStatus = 0;
 		}
+		break;
+
+	case 66:
+		resetFrame = 24;
+		break;
+	}
+
+	if (resetFrame >= 0) {
+		_scene->setAnimFrame(_globals._animationIndexes[0], resetFrame);
+		_callingFrame = resetFrame;
 	}
 }
 
@@ -8866,8 +8865,6 @@ void Scene113::handleDeadConversation() {
 }
 
 void Scene113::handleFlorentConversation() {
-	int random;
-
 	switch (_action._activeAction._verbId) {
 	case 3:
 	case 4:
@@ -8930,15 +8927,13 @@ void Scene113::handleFlorentConversation() {
 	case 66:
 		if ((_florentStatus != 3) &&
 			(_florentStatus != 2)) {
-				random = _vm->getRandomNumber(1,5);
-				if (random == 1)
+				if (_vm->getRandomNumber(1, 5) == 1)
 					_florentStatus = 0;
 		}
 
 		if ((_raoulAction != 3) && (_raoulAction != 5) && (_raoulAction != 4) && (!_raoulStandingFl)) {
 			_raoulAction = 1;
-			random = _vm->getRandomNumber(1, 2);
-			if (random == 1)
+			if (_vm->getRandomNumber(1, 2) == 1)
 				_raoulAction = 2;
 		}
 		break;
@@ -9006,8 +9001,6 @@ void Scene113::handleFlorentConversation() {
 }
 
 void Scene113::handleLoveConversation() {
-	int random;
-
 	switch (_action._activeAction._verbId) {
 	case 1:
 	case 2:
@@ -9073,10 +9066,8 @@ void Scene113::handleLoveConversation() {
 
 			if (_raoulAction != 3) {
 				_raoulAction = 1;
-				random = _vm->getRandomNumber(1, 2);
-				if (random == 1) {
+				if (_vm->getRandomNumber(1, 2) == 1)
 					_raoulAction = 2;
-				}
 			}
 		}
 		break;


Commit: 767ce0ddc06ba1d499347f1bccc99d6892b87136
    https://github.com/scummvm/scummvm/commit/767ce0ddc06ba1d499347f1bccc99d6892b87136
Author: Strangerke (strangerke at scummvm.org)
Date: 2015-11-23T00:28:17+01:00

Commit Message:
MADS: Reduce the scope of a variable in panTransition

Changed paths:
    engines/mads/screen.cpp



diff --git a/engines/mads/screen.cpp b/engines/mads/screen.cpp
index c9f5df8..90fbbe7 100644
--- a/engines/mads/screen.cpp
+++ b/engines/mads/screen.cpp
@@ -687,7 +687,6 @@ void ScreenSurface::panTransition(MSurface &newScreen, byte *palData, int entryS
 	int y1, y2;
 	int startX = 0;
 	int deltaX;
-	int xAt;
 	int loopStart;
 //	uint32 baseTicks, currentTicks;
 	byte paletteMap[256];
@@ -720,7 +719,7 @@ void ScreenSurface::panTransition(MSurface &newScreen, byte *palData, int entryS
 
 	loopStart = throughBlack == THROUGH_BLACK1 ? 0 : 1;
 	for (int loop = loopStart; loop < 2; ++loop) {
-		xAt = startX;
+		int xAt = startX;
 		for (int xCtr = 0; xCtr < size.x; ++xCtr, xAt += deltaX) {
 			if (!loop) {
 				fillRect(Common::Rect(xAt + destPos.x, y1 + destPos.y,






More information about the Scummvm-git-logs mailing list