aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorStrangerke2016-03-25 07:33:22 +0100
committerEugene Sandulenko2016-05-10 09:54:21 +0200
commitecc3e2a786629d06fbcf17e4d74605215efdc1ef (patch)
tree1bcb1ebc284fb447aed6317dc3ba60b9a47a91b5
parentbec37164f840d47bd16b5c094d35f4345eb1d38c (diff)
downloadscummvm-rg350-ecc3e2a786629d06fbcf17e4d74605215efdc1ef.tar.gz
scummvm-rg350-ecc3e2a786629d06fbcf17e4d74605215efdc1ef.tar.bz2
scummvm-rg350-ecc3e2a786629d06fbcf17e4d74605215efdc1ef.zip
GNAP: Change the type of some variables to boolean
-rw-r--r--engines/gnap/gnap.cpp2
-rw-r--r--engines/gnap/gnap.h10
-rw-r--r--engines/gnap/scenes/scene47.cpp44
-rw-r--r--engines/gnap/scenes/scene48.cpp26
-rw-r--r--engines/gnap/scenes/scene52.cpp12
-rw-r--r--engines/gnap/scenes/scene54.cpp42
6 files changed, 69 insertions, 67 deletions
diff --git a/engines/gnap/gnap.cpp b/engines/gnap/gnap.cpp
index e0d2f188ba..1a3bcf4f44 100644
--- a/engines/gnap/gnap.cpp
+++ b/engines/gnap/gnap.cpp
@@ -2377,7 +2377,7 @@ void GnapEngine::cutscene_run() {
clearKeyStatus1(Common::KEYCODE_ESCAPE);
clearKeyStatus1(Common::KEYCODE_SPACE);
clearKeyStatus1(29);
- if (_s99_canSkip[itemIndex] & 1)
+ if (_s99_canSkip[itemIndex])
skip = true;
else
_sceneDone = true;
diff --git a/engines/gnap/gnap.h b/engines/gnap/gnap.h
index e13158c245..5eaa25d5b5 100644
--- a/engines/gnap/gnap.h
+++ b/engines/gnap/gnap.h
@@ -912,7 +912,8 @@ public:
void scene48_initCutscene();
// Scene 49
- int _s49_scoreBarPos, _s49_scoreLevel, _s49_scoreBarFlash;
+ int _s49_scoreBarPos, _s49_scoreLevel;
+ bool _s49_scoreBarFlash;
int _s49_obstacleIndex;
Scene49Obstacle _s49_obstacles[5];
int _s49_truckSequenceId, _s49_truckId, _s49_truckLaneNum;
@@ -1009,8 +1010,9 @@ public:
int _s52_shieldSpriteIds[3];
int _s52_shieldPosX[3];
int _s52_shipPosX;
- int _s52_shipCannonFired, _s52_shipCannonPosX, _s52_shipCannonPosY;
- int _s52_shipCannonFiring;
+ int _s52_shipCannonPosX, _s52_shipCannonPosY;
+ bool _s52_shipCannonFiring;
+ bool _s52_shipCannonFired;
int _s52_shipCannonWidth, _s52_shipCannonHeight;
int _s52_shipCannonTopY;
int _s52_shipMidX, _s52_shipMidY;
@@ -1093,7 +1095,7 @@ public:
int _s99_resourceIdArr[16];
int _s99_sequenceCountArr[16];
int _s99_sequenceIdArr[50];
- byte _s99_canSkip[16];
+ bool _s99_canSkip[16];
int cutscene_init();
void cutscene_run();
};
diff --git a/engines/gnap/scenes/scene47.cpp b/engines/gnap/scenes/scene47.cpp
index bb5f53286f..d692e1d83d 100644
--- a/engines/gnap/scenes/scene47.cpp
+++ b/engines/gnap/scenes/scene47.cpp
@@ -42,11 +42,11 @@ void GnapEngine::scene47_initCutscene1() {
_s99_sequenceCountArr[2] = 1;
_s99_sequenceCountArr[3] = 1;
_s99_sequenceCountArr[4] = 1;
- _s99_canSkip[0] = 0;
- _s99_canSkip[1] = 0;
- _s99_canSkip[2] = 0;
- _s99_canSkip[3] = 0;
- _s99_canSkip[4] = 0;
+ _s99_canSkip[0] = false;
+ _s99_canSkip[1] = false;
+ _s99_canSkip[2] = false;
+ _s99_canSkip[3] = false;
+ _s99_canSkip[4] = false;
_s99_itemsCount = 5;
}
@@ -64,10 +64,10 @@ void GnapEngine::scene47_initCutscene2() {
_s99_sequenceCountArr[1] = 1;
_s99_sequenceCountArr[2] = 1;
_s99_sequenceCountArr[3] = 1;
- _s99_canSkip[0] = 0;
- _s99_canSkip[1] = 0;
- _s99_canSkip[2] = 0;
- _s99_canSkip[3] = 0;
+ _s99_canSkip[0] = false;
+ _s99_canSkip[1] = false;
+ _s99_canSkip[2] = false;
+ _s99_canSkip[3] = false;
_s99_itemsCount = 4;
}
@@ -78,8 +78,8 @@ void GnapEngine::scene47_initCutscene3() {
_s99_resourceIdArr[1] = 0x143;
_s99_sequenceCountArr[0] = 1;
_s99_sequenceCountArr[1] = 1;
- _s99_canSkip[0] = 0;
- _s99_canSkip[1] = 0;
+ _s99_canSkip[0] = false;
+ _s99_canSkip[1] = false;
_s99_itemsCount = 2;
}
@@ -93,9 +93,9 @@ void GnapEngine::scene47_initCutscene4() {
_s99_sequenceCountArr[0] = 1;
_s99_sequenceCountArr[1] = 1;
_s99_sequenceCountArr[2] = 1;
- _s99_canSkip[0] = 0;
- _s99_canSkip[1] = 0;
- _s99_canSkip[2] = 0;
+ _s99_canSkip[0] = false;
+ _s99_canSkip[1] = false;
+ _s99_canSkip[2] = false;
_s99_itemsCount = 3;
}
@@ -108,8 +108,8 @@ void GnapEngine::scene47_initCutscene5() {
_s99_resourceIdArr[1] = 0x207;
_s99_sequenceCountArr[0] = 3;
_s99_sequenceCountArr[1] = 1;
- _s99_canSkip[0] = 0;
- _s99_canSkip[1] = 0;
+ _s99_canSkip[0] = false;
+ _s99_canSkip[1] = false;
_s99_itemsCount = 2;
}
@@ -118,7 +118,7 @@ void GnapEngine::scene47_initCutscene6() {
_s99_sequenceIdArr[1] = 0x31F;
_s99_resourceIdArr[0] = 0x2FA;
_s99_sequenceCountArr[0] = 2;
- _s99_canSkip[0] = 0;
+ _s99_canSkip[0] = false;
_s99_itemsCount = 1;
}
@@ -160,11 +160,11 @@ void GnapEngine::scene47_initCutscene7() {
_s99_sequenceCountArr[2] = v2 - v3;
_s99_sequenceCountArr[3] = 1;
_s99_sequenceCountArr[4] = 1;
- _s99_canSkip[0] = 0;
- _s99_canSkip[1] = 0;
- _s99_canSkip[2] = 0;
- _s99_canSkip[3] = 0;
- _s99_canSkip[4] = 0;
+ _s99_canSkip[0] = false;
+ _s99_canSkip[1] = false;
+ _s99_canSkip[2] = false;
+ _s99_canSkip[3] = false;
+ _s99_canSkip[4] = false;
_s99_itemsCount = 5;
}
diff --git a/engines/gnap/scenes/scene48.cpp b/engines/gnap/scenes/scene48.cpp
index 3ea0f323d8..a614ca4549 100644
--- a/engines/gnap/scenes/scene48.cpp
+++ b/engines/gnap/scenes/scene48.cpp
@@ -66,19 +66,19 @@ void GnapEngine::scene48_initCutscene() {
_s99_sequenceCountArr[10] = 1;
_s99_sequenceCountArr[11] = 1;
_s99_sequenceCountArr[12] = 1;
- _s99_canSkip[0] = 0;
- _s99_canSkip[1] = 0;
- _s99_canSkip[2] = 0;
- _s99_canSkip[3] = 0;
- _s99_canSkip[4] = 0;
- _s99_canSkip[5] = 0;
- _s99_canSkip[6] = 0;
- _s99_canSkip[7] = 0;
- _s99_canSkip[8] = 0;
- _s99_canSkip[9] = 0;
- _s99_canSkip[10] = 0;
- _s99_canSkip[11] = 0;
- _s99_canSkip[12] = 0;
+ _s99_canSkip[0] = false;
+ _s99_canSkip[1] = false;
+ _s99_canSkip[2] = false;
+ _s99_canSkip[3] = false;
+ _s99_canSkip[4] = false;
+ _s99_canSkip[5] = false;
+ _s99_canSkip[6] = false;
+ _s99_canSkip[7] = false;
+ _s99_canSkip[8] = false;
+ _s99_canSkip[9] = false;
+ _s99_canSkip[10] = false;
+ _s99_canSkip[11] = false;
+ _s99_canSkip[12] = false;
_s99_itemsCount = 13;
}
diff --git a/engines/gnap/scenes/scene52.cpp b/engines/gnap/scenes/scene52.cpp
index 369668555d..0b00b4299a 100644
--- a/engines/gnap/scenes/scene52.cpp
+++ b/engines/gnap/scenes/scene52.cpp
@@ -144,11 +144,11 @@ void GnapEngine::scene52_update() {
}
void GnapEngine::scene52_initShipCannon(int bottomY) {
- _s52_shipCannonFired = 0;
+ _s52_shipCannonFired = false;
_s52_shipCannonWidth = MAX(_gameSys->getSpriteWidthById(14), _gameSys->getSpriteWidthById(16));
_s52_shipCannonHeight = MAX(_gameSys->getSpriteHeightById(14), _gameSys->getSpriteHeightById(16));
_s52_shipCannonTopY = bottomY - _s52_shipCannonHeight;
- _s52_shipCannonFiring = 0;
+ _s52_shipCannonFiring = false;
}
void GnapEngine::scene52_initAlienCannons() {
@@ -177,9 +177,9 @@ void GnapEngine::scene52_fireShipCannon(int posX) {
_gameSys->setAnimation(0, 0, cannonNum + 8);
_gameSys->removeSequence(0x23, cannonNum + 256, true);
} else {
- _s52_shipCannonFired = 1;
+ _s52_shipCannonFired = true;
_s52_shipCannonPosY -= 13;
- _s52_shipCannonFiring = 1;
+ _s52_shipCannonFiring = true;
}
_timers[1] = 5;
}
@@ -227,7 +227,7 @@ void GnapEngine::scene52_updateShipCannon() {
if (scene52_updateHitAlien()) {
_gameSys->setAnimation(0, 0, 8);
_gameSys->removeSequence(35, 256, true);
- _s52_shipCannonFired = 0;
+ _s52_shipCannonFired = false;
scene52_drawScore(_s52_gameScore);
} else {
_gameSys->setAnimation(35, 256, 8);
@@ -237,7 +237,7 @@ void GnapEngine::scene52_updateShipCannon() {
} else {
_gameSys->setAnimation(0, 0, 8);
_gameSys->removeSequence(35, 256, true);
- _s52_shipCannonFired = 0;
+ _s52_shipCannonFired = false;
}
}
}
diff --git a/engines/gnap/scenes/scene54.cpp b/engines/gnap/scenes/scene54.cpp
index 6feb445490..387b17c28c 100644
--- a/engines/gnap/scenes/scene54.cpp
+++ b/engines/gnap/scenes/scene54.cpp
@@ -46,11 +46,11 @@ void GnapEngine::scene54_initCutscene1() {
_s99_sequenceCountArr[2] = 1;
_s99_sequenceCountArr[3] = 2;
_s99_sequenceCountArr[4] = 1;
- _s99_canSkip[0] = 0;
- _s99_canSkip[1] = 0;
- _s99_canSkip[2] = 0;
- _s99_canSkip[3] = 0;
- _s99_canSkip[4] = 0;
+ _s99_canSkip[0] = false;
+ _s99_canSkip[1] = false;
+ _s99_canSkip[2] = false;
+ _s99_canSkip[3] = false;
+ _s99_canSkip[4] = false;
_s99_itemsCount = 5;
}
@@ -105,22 +105,22 @@ void GnapEngine::scene54_initCutscene2() {
_s99_sequenceCountArr[13] = 1;
_s99_sequenceCountArr[14] = 1;
_s99_sequenceCountArr[15] = 1;
- _s99_canSkip[0] = 0;
- _s99_canSkip[1] = 0;
- _s99_canSkip[2] = 0;
- _s99_canSkip[3] = 0;
- _s99_canSkip[4] = 0;
- _s99_canSkip[5] = 0;
- _s99_canSkip[6] = 0;
- _s99_canSkip[7] = 0;
- _s99_canSkip[8] = 0;
- _s99_canSkip[9] = 0;
- _s99_canSkip[10] = 0;
- _s99_canSkip[11] = 0;
- _s99_canSkip[12] = 0;
- _s99_canSkip[13] = 1;
- _s99_canSkip[14] = 1;
- _s99_canSkip[15] = 0;
+ _s99_canSkip[0] = false;
+ _s99_canSkip[1] = false;
+ _s99_canSkip[2] = false;
+ _s99_canSkip[3] = false;
+ _s99_canSkip[4] = false;
+ _s99_canSkip[5] = false;
+ _s99_canSkip[6] = false;
+ _s99_canSkip[7] = false;
+ _s99_canSkip[8] = false;
+ _s99_canSkip[9] = false;
+ _s99_canSkip[10] = false;
+ _s99_canSkip[11] = false;
+ _s99_canSkip[12] = false;
+ _s99_canSkip[13] = true;
+ _s99_canSkip[14] = true;
+ _s99_canSkip[15] = false;
_s99_itemsCount = 16;
}