[Scummvm-git-logs] scummvm master -> a703f0c959fca0516c5fe98a218295d627a418dd
Strangerke
noreply at scummvm.org
Sat Jan 25 07:58:52 UTC 2025
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:
a703f0c959 GOT: remove bomb_flag, more renaming in global vars
Commit: a703f0c959fca0516c5fe98a218295d627a418dd
https://github.com/scummvm/scummvm/commit/a703f0c959fca0516c5fe98a218295d627a418dd
Author: Strangerke (arnaud.boutonne at gmail.com)
Date: 2025-01-25T08:58:45+01:00
Commit Message:
GOT: remove bomb_flag, more renaming in global vars
Changed paths:
engines/got/game/back.cpp
engines/got/game/main.cpp
engines/got/game/move.cpp
engines/got/game/move_patterns.cpp
engines/got/game/object.cpp
engines/got/got.cpp
engines/got/vars.h
engines/got/views/game_content.cpp
diff --git a/engines/got/game/back.cpp b/engines/got/game/back.cpp
index a473ef24e72..be8f608951f 100644
--- a/engines/got/game/back.cpp
+++ b/engines/got/game/back.cpp
@@ -47,9 +47,8 @@ static const char *odinEndMessage;
void showLevel(const int newLevel) {
_G(boss_active) = false;
- if (!_G(shield_on))
+ if (!_G(shieldOn))
_G(actor[2])._active = false;
- _G(bomb_flag) = false;
_G(slipping) = false;
if (_G(scrn)._iconGrid[_G(thor)->_centerY][_G(thor)->_centerX] == 154)
diff --git a/engines/got/game/main.cpp b/engines/got/game/main.cpp
index 22f3a79caec..d6fe617e46d 100644
--- a/engines/got/game/main.cpp
+++ b/engines/got/game/main.cpp
@@ -52,11 +52,10 @@ void setupLoad() {
_G(thor)->_numMoves = 1;
_G(thor)->_vulnerableCountdown = 60;
_G(thor)->_show = 60;
- _G(apple_flag) = false;
- _G(bomb_flag) = false;
+ _G(appleFlag) = false;
_G(thunderSnakeCounter) = 0;
- _G(tornado_used) = false;
- _G(shield_on) = false;
+ _G(tornadoUsed) = false;
+ _G(shieldOn) = false;
_G(actor[1])._active = false;
_G(actor[2])._active = false;
_G(thor)->_moveCountdown = 6;
diff --git a/engines/got/game/move.cpp b/engines/got/game/move.cpp
index e2764b1ab33..323c48f5d90 100644
--- a/engines/got/game/move.cpp
+++ b/engines/got/game/move.cpp
@@ -168,7 +168,7 @@ void thorDamaged(Actor *actor) {
else if (_G(setup)._difficultyLevel == 2)
damage *= 2;
}
- if ((!_G(thor)->_vulnerableCountdown && !_G(shield_on)) || damage == 255) {
+ if ((!_G(thor)->_vulnerableCountdown && !_G(shieldOn)) || damage == 255) {
if (damage >= _G(thor)->_health) {
_G(thor)->_vulnerableCountdown = 40;
_G(thor)->_show = 0;
@@ -361,7 +361,7 @@ void moveActor(Actor *actor) {
if (i != actor->_dir)
actor->_dir = i;
- if (actor->_moveType == 0 && _G(current_level) != _G(new_level) && _G(shield_on)) {
+ if (actor->_moveType == 0 && _G(current_level) != _G(new_level) && _G(shieldOn)) {
_G(actor[2])._x = actor->_x - 2;
if (_G(actor[2])._x < 0)
_G(actor[2])._x = 0;
diff --git a/engines/got/game/move_patterns.cpp b/engines/got/game/move_patterns.cpp
index 9985b8e4741..9bba5fd0420 100644
--- a/engines/got/game/move_patterns.cpp
+++ b/engines/got/game/move_patterns.cpp
@@ -506,9 +506,9 @@ int checkMove2(const int x, const int y, Actor *actor) {
if (overlap(x1, y1, x2, y2, x3, y3, x4, y4)) {
if (actor->_moveType == 38) {
if (act->_funcNum == 4)
- _G(switch_flag) = 1;
+ _G(switchUsed) = 1;
else if (act->_funcNum == 7)
- _G(switch_flag) = 2;
+ _G(switchUsed) = 2;
}
return 0;
}
@@ -993,7 +993,7 @@ int specialMovementFour(Actor *actor) {
return 0;
actor->_shotCountdown = 30;
- _G(switch_flag) = 1;
+ _G(switchUsed) = 1;
return 0;
}
@@ -1052,7 +1052,7 @@ int specialMovementSeven(Actor *actor) {
actor->_shotCountdown = 30;
- _G(switch_flag) = 2;
+ _G(switchUsed) = 2;
return 0;
}
@@ -1147,7 +1147,7 @@ int movementTwo(Actor *actor) {
if (actor->_actorNum == 2) {
actor->_active = false;
actor->_dead = 2;
- _G(tornado_used) = false;
+ _G(tornadoUsed) = false;
}
}
nextFrame(actor);
diff --git a/engines/got/game/object.cpp b/engines/got/game/object.cpp
index 3070ea89ed3..f81f93c8ff9 100644
--- a/engines/got/game/object.cpp
+++ b/engines/got/game/object.cpp
@@ -124,8 +124,8 @@ void pickUpObject(int p) {
_G(thor)->_numMoves = 1;
_G(hammer)->_numMoves = 2;
_G(actor[2])._active = false;
- _G(shield_on) = false;
- _G(tornado_used) = false;
+ _G(shieldOn) = false;
+ _G(tornadoUsed) = false;
_G(thorInfo)._inventory |= 64;
_G(thorInfo)._selectedItem = 7;
_G(thorInfo)._object = _G(objectMap[p]) - 11;
@@ -139,8 +139,8 @@ void pickUpObject(int p) {
case 31:
case 32: {
_G(thunderSnakeCounter) = 0;
- _G(shield_on) = false;
- _G(tornado_used) = false;
+ _G(shieldOn) = false;
+ _G(tornadoUsed) = false;
_G(hammer)->_numMoves = 2;
_G(thor)->_numMoves = 1;
_G(actor[2])._active = false;
@@ -209,7 +209,7 @@ bool useApple(int flag) {
return false;
if (flag && _G(thorInfo)._magic > 0) {
- if (!_G(apple_flag)) {
+ if (!_G(appleFlag)) {
_G(magicCounter) = 0;
addMagic(-2);
addHealth(1);
@@ -221,11 +221,11 @@ bool useApple(int flag) {
if (!soundPlaying())
playSound(ANGEL, false);
}
- _G(apple_flag) = true;
+ _G(appleFlag) = true;
return true;
}
- _G(apple_flag) = false;
+ _G(appleFlag) = false;
if (flag)
notEnoughMagic();
@@ -278,7 +278,7 @@ bool useBoots(int flag) {
bool useShield(int flag) {
if (flag) {
if (_G(thorInfo)._magic) {
- if (!_G(shield_on)) {
+ if (!_G(shieldOn)) {
_G(magicCounter) = 0;
addMagic(-1);
setupMagicItem(1);
@@ -287,7 +287,7 @@ bool useShield(int flag) {
setupActor(&_G(actor[2]), 2, 0, _G(thor)->_x, _G(thor)->_y);
_G(actor[2])._moveCountdown = 1;
_G(actor[2])._speed = 1;
- _G(shield_on) = true;
+ _G(shieldOn) = true;
} else if (_G(magicCounter) > 8) {
_G(magicCounter) = 0;
addMagic(-1);
@@ -299,10 +299,10 @@ bool useShield(int flag) {
notEnoughMagic();
}
- if (_G(shield_on)) {
+ if (_G(shieldOn)) {
_G(actor[2])._dead = 2;
_G(actor[2])._active = false;
- _G(shield_on) = false;
+ _G(shieldOn) = false;
}
return false;
@@ -324,7 +324,7 @@ bool useLightning(int flag) {
bool useTornado(int flag) {
if (flag) {
if (_G(thorInfo)._magic > 10) {
- if (!_G(tornado_used) && !_G(actor[2])._dead && _G(magicCounter) > 20) {
+ if (!_G(tornadoUsed) && !_G(actor[2])._dead && _G(magicCounter) > 20) {
_G(magicCounter) = 0;
addMagic(-10);
setupMagicItem(0);
@@ -333,22 +333,22 @@ bool useTornado(int flag) {
setupActor(&_G(actor[2]), 2, 0, _G(thor)->_x, _G(thor)->_y);
_G(actor[2])._lastDir = _G(thor)->_dir;
_G(actor[2])._moveType = 16;
- _G(tornado_used) = true;
+ _G(tornadoUsed) = true;
playSound(WIND, false);
}
- } else if (!_G(tornado_used)) {
+ } else if (!_G(tornadoUsed)) {
notEnoughMagic();
return false;
}
if (_G(magicCounter) > 8) {
- if (_G(tornado_used)) {
+ if (_G(tornadoUsed)) {
_G(magicCounter) = 0;
addMagic(-1);
}
}
if (_G(thorInfo)._magic < 1) {
actorDestroyed(&_G(actor[2]));
- _G(tornado_used) = false;
+ _G(tornadoUsed) = false;
notEnoughMagic();
return false;
}
@@ -370,9 +370,9 @@ void useItem() {
int kf = _G(keyFlag[key_magic]);
- if (!kf && _G(tornado_used)) {
+ if (!kf && _G(tornadoUsed)) {
actorDestroyed(&_G(actor[2]));
- _G(tornado_used) = false;
+ _G(tornadoUsed) = false;
}
bool mf = _G(magic_inform);
diff --git a/engines/got/got.cpp b/engines/got/got.cpp
index 99c9fbcfaec..c13632dd879 100644
--- a/engines/got/got.cpp
+++ b/engines/got/got.cpp
@@ -216,15 +216,15 @@ void GotEngine::pauseEngineIntern(bool pause) {
if (_G(gameMode) == MODE_LIGHTNING)
_G(gameMode) = MODE_NORMAL;
- if (_G(tornado_used)) {
- _G(tornado_used) = false;
+ if (_G(tornadoUsed)) {
+ _G(tornadoUsed) = false;
actorDestroyed(&_G(actor[2]));
}
- if (_G(shield_on)) {
+ if (_G(shieldOn)) {
_G(actor[2])._dead = 2;
_G(actor[2])._active = false;
- _G(shield_on) = false;
+ _G(shieldOn) = false;
}
_G(thunderSnakeCounter) = 0;
diff --git a/engines/got/vars.h b/engines/got/vars.h
index b21f8d33ba3..31ed87be505 100644
--- a/engines/got/vars.h
+++ b/engines/got/vars.h
@@ -177,11 +177,10 @@ public:
int _rand1 = 0;
int _rand2 = 0;
int _thunderSnakeCounter = 0;
- bool _tornado_used = false;
- bool _shield_on = false;
- bool _apple_flag = false;
- bool _bomb_flag = false;
- int _switch_flag = 0;
+ bool _tornadoUsed = false;
+ bool _shieldOn = false;
+ bool _appleFlag = false;
+ int _switchUsed = 0;
byte _res_file[16] = {};
bool _music_flag = false, _sound_flag = false;
diff --git a/engines/got/views/game_content.cpp b/engines/got/views/game_content.cpp
index a376fe66a9f..582053caa16 100644
--- a/engines/got/views/game_content.cpp
+++ b/engines/got/views/game_content.cpp
@@ -329,20 +329,21 @@ void GameContent::checkThunderShake() {
}
void GameContent::checkSwitchFlag() {
- if (_G(switch_flag)) {
- switch (_G(switch_flag)) {
- case 1:
- switchIcons();
- break;
- case 2:
- rotateArrows();
- break;
- default:
- break;
- }
-
- _G(switch_flag) = 0;
+ if (!_G(switchUsed))
+ return;
+
+ switch (_G(switchUsed)) {
+ case 1:
+ switchIcons();
+ break;
+ case 2:
+ rotateArrows();
+ break;
+ default:
+ break;
}
+
+ _G(switchUsed) = 0;
}
void GameContent::checkForItem() {
@@ -464,7 +465,7 @@ void GameContent::checkForAreaChange() {
_G(thor)->_show = 0;
_G(thor)->_active = false;
_G(hammer)->_active = false;
- _G(tornado_used) = false;
+ _G(tornadoUsed) = false;
// Draws the old area without Thor, and then save a copy of it.
// This will be used to scroll old area off-screen as new area scrolls in
@@ -489,7 +490,7 @@ void GameContent::thorDies() {
// Set the state for showing death animation
_G(gameMode) = MODE_THOR_DIES;
_deathCtr = 0;
- _G(shield_on) = false;
+ _G(shieldOn) = false;
playSound(DEAD, true);
}
@@ -540,11 +541,10 @@ void GameContent::thorDead() {
_G(thor)->_numMoves = 1;
_G(thor)->_vulnerableCountdown = 60;
_G(thor)->_show = 60;
- _G(apple_flag) = false;
- _G(bomb_flag) = false;
+ _G(appleFlag) = false;
_G(thunderSnakeCounter) = 0;
- _G(tornado_used) = false;
- _G(shield_on) = false;
+ _G(tornadoUsed) = false;
+ _G(shieldOn) = false;
musicResume();
_G(actor[1])._active = false;
_G(actor[2])._active = false;
More information about the Scummvm-git-logs
mailing list