aboutsummaryrefslogtreecommitdiff
path: root/engines/tsage/ringworld2
diff options
context:
space:
mode:
authorStrangerke2014-02-09 00:42:35 +0100
committerStrangerke2014-02-09 00:42:35 +0100
commitb75da52cabd70ad89456e75e160e5b91ea3ac1e7 (patch)
treeab84368347a399172ee306a219ae621a9cd5a2f3 /engines/tsage/ringworld2
parent0e6c4de8c644784c7404efb759a3274ccadcb20d (diff)
downloadscummvm-rg350-b75da52cabd70ad89456e75e160e5b91ea3ac1e7.tar.gz
scummvm-rg350-b75da52cabd70ad89456e75e160e5b91ea3ac1e7.tar.bz2
scummvm-rg350-b75da52cabd70ad89456e75e160e5b91ea3ac1e7.zip
TSAGE: R2R - Reduce the scope of some variables
Diffstat (limited to 'engines/tsage/ringworld2')
-rw-r--r--engines/tsage/ringworld2/ringworld2_logic.cpp4
-rw-r--r--engines/tsage/ringworld2/ringworld2_scenes1.cpp6
-rw-r--r--engines/tsage/ringworld2/ringworld2_scenes2.cpp4
-rw-r--r--engines/tsage/ringworld2/ringworld2_scenes3.cpp3
4 files changed, 8 insertions, 9 deletions
diff --git a/engines/tsage/ringworld2/ringworld2_logic.cpp b/engines/tsage/ringworld2/ringworld2_logic.cpp
index b97f63bbd3..e81fce681c 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 1e6a5c2132..9475501bca 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 f928f3635c..ad9dbf5a98 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 f2bb68480d..8b235f3575 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: