[Scummvm-cvs-logs] scummvm master -> b75da52cabd70ad89456e75e160e5b91ea3ac1e7

Strangerke Strangerke at scummvm.org
Sun Feb 9 00:44:00 CET 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:
b75da52cab TSAGE: R2R - Reduce the scope of some variables


Commit: b75da52cabd70ad89456e75e160e5b91ea3ac1e7
    https://github.com/scummvm/scummvm/commit/b75da52cabd70ad89456e75e160e5b91ea3ac1e7
Author: Strangerke (strangerke at scummvm.org)
Date: 2014-02-08T15:42:35-08:00

Commit Message:
TSAGE: R2R - Reduce the scope of some variables

Changed paths:
    engines/tsage/ringworld2/ringworld2_logic.cpp
    engines/tsage/ringworld2/ringworld2_scenes1.cpp
    engines/tsage/ringworld2/ringworld2_scenes2.cpp
    engines/tsage/ringworld2/ringworld2_scenes3.cpp



diff --git a/engines/tsage/ringworld2/ringworld2_logic.cpp b/engines/tsage/ringworld2/ringworld2_logic.cpp
index b97f63b..e81fce6 100644
--- a/engines/tsage/ringworld2/ringworld2_logic.cpp
+++ b/engines/tsage/ringworld2/ringworld2_logic.cpp
@@ -561,14 +561,14 @@ void SceneExt::saveCharacter(int characterIndex) {
 void SceneExt::scalePalette(int RFactor, int GFactor, int BFactor) {
 	byte *tmpPal = R2_GLOBALS._scenePalette._palette;
 	byte newR, newG, newB;
-	int tmp, varC, varD = 0;
+	int tmp, varD = 0;
 
 	for (int i = 0; i < 256; i++) {
 		newR = (RFactor * tmpPal[(3 * i)]) / 100;
 		newG = (GFactor * tmpPal[(3 * i) + 1]) / 100;
 		newB = (BFactor * tmpPal[(3 * i) + 2]) / 100;
 
-		varC = 769;
+		int varC = 769;
 		for (int j = 255; j >= 0; j--) {
 			tmp = abs(tmpPal[(3 * j)] - newR);
 			if (tmp >= varC)
diff --git a/engines/tsage/ringworld2/ringworld2_scenes1.cpp b/engines/tsage/ringworld2/ringworld2_scenes1.cpp
index 1e6a5c2..9475501 100644
--- a/engines/tsage/ringworld2/ringworld2_scenes1.cpp
+++ b/engines/tsage/ringworld2/ringworld2_scenes1.cpp
@@ -3913,8 +3913,6 @@ void Scene1337::Action10::signal() {
 void Scene1337::Action11::signal() {
 	Scene1337 *scene = (Scene1337 *)R2_GLOBALS._sceneManager._scene;
 
-	bool noAction = true;
-
 	switch (_actionIndex++) {
 	case 0: {
 		scene->_actionCard2->_card.postInit();
@@ -3944,6 +3942,8 @@ void Scene1337::Action11::signal() {
 		scene->_aSound1.play(57);
 
 		bool found = false;
+		bool noAction = true;
+
 		int i = -1;
 
 		switch (scene->_actionIdx2) {
@@ -5411,10 +5411,10 @@ void Scene1337::showOptionsDialog() {
 }
 
 void Scene1337::handleClick(int arg1, Common::Point pt) {
-	bool found = false;
 	int curReg = R2_GLOBALS._sceneRegions.indexOf(g_globals->_events._mousePos);
 
 	if (arg1 == 3) {
+		bool found = false;
 		int i;
 		for (i = 0; i <= 7; i++) {
 			if ( _gameBoardSide[2]._outpostStation[i].isIn(pt)
diff --git a/engines/tsage/ringworld2/ringworld2_scenes2.cpp b/engines/tsage/ringworld2/ringworld2_scenes2.cpp
index f928f36..ad9dbf5 100644
--- a/engines/tsage/ringworld2/ringworld2_scenes2.cpp
+++ b/engines/tsage/ringworld2/ringworld2_scenes2.cpp
@@ -4872,10 +4872,10 @@ void Scene2900::Map::drawBlock(const byte *data, int xp, int yp,
 void Scene2900::Map::moveArea(Rect &r, int xAmt, int yAmt) {
 	Rect tempRect = r;
 	tempRect.translate(xAmt, yAmt);
-	int xpSrc, xpDest, width;
-	int ypSrc, ypDest, height;
 
 	if (tempRect.intersects(r)) {
+		int xpSrc, xpDest, width;
+		int ypSrc, ypDest, height;
 		if (xAmt >= 0) {
 			xpSrc = tempRect.left;
 			width = tempRect.width() - xAmt;
diff --git a/engines/tsage/ringworld2/ringworld2_scenes3.cpp b/engines/tsage/ringworld2/ringworld2_scenes3.cpp
index f2bb684..8b235f3 100644
--- a/engines/tsage/ringworld2/ringworld2_scenes3.cpp
+++ b/engines/tsage/ringworld2/ringworld2_scenes3.cpp
@@ -3896,7 +3896,6 @@ void Scene3500::dispatch() {
 	int16 mazePosY = 0;
 	int deltaX = 0;
 	int deltaY = 0;
-	int tmpCellId = 0;
 	int cellId = 0;
 
 	if ((_mazeChangeAmount == 0) && !_postFixupFl) {
@@ -3912,7 +3911,7 @@ void Scene3500::dispatch() {
 		mazePosY = _mazeUI.cellFromY(_mazePosition.y + 46) - 46;
 		deltaX = abs(mazePosX - newMazeX);
 		deltaY = abs(mazePosY - newMazeY);
-		tmpCellId = 0;
+		int tmpCellId = 0;
 
 		switch (_mazeDirection) {
 		case MAZEDIR_NORTH:






More information about the Scummvm-git-logs mailing list