diff options
author | Strangerke | 2011-11-09 08:53:41 +0100 |
---|---|---|
committer | Strangerke | 2011-11-09 08:53:41 +0100 |
commit | 9b8b8410940db0645e2d04317262044396e667c4 (patch) | |
tree | 1900c41e5c7049ad3c79ad435a207ab095243ba3 | |
parent | e67ab21b5f79b35896c55b10cf39bda990e9142d (diff) | |
download | scummvm-rg350-9b8b8410940db0645e2d04317262044396e667c4.tar.gz scummvm-rg350-9b8b8410940db0645e2d04317262044396e667c4.tar.bz2 scummvm-rg350-9b8b8410940db0645e2d04317262044396e667c4.zip |
TSAGE: BF - Cleanup: Rename a couple of global variables, remove a useless global
Savegame version wasn't incremented as the current one is too recent
-rw-r--r-- | engines/tsage/blue_force/blueforce_scenes0.cpp | 22 | ||||
-rw-r--r-- | engines/tsage/blue_force/blueforce_scenes3.cpp | 2 | ||||
-rw-r--r-- | engines/tsage/globals.cpp | 14 | ||||
-rw-r--r-- | engines/tsage/globals.h | 5 |
4 files changed, 22 insertions, 21 deletions
diff --git a/engines/tsage/blue_force/blueforce_scenes0.cpp b/engines/tsage/blue_force/blueforce_scenes0.cpp index e50fcfcfad..682e273716 100644 --- a/engines/tsage/blue_force/blueforce_scenes0.cpp +++ b/engines/tsage/blue_force/blueforce_scenes0.cpp @@ -530,7 +530,7 @@ bool Scene60::Ignition::startAction(CursorType action, Event &event) { bool Scene60::Ignition::check1() { if (BF_GLOBALS._bookmark >= bStoppedFrankie) { - BF_GLOBALS._v5098C |= 1; + BF_GLOBALS._subFlagBitArr1 |= 1; return false; } else { if ((BF_GLOBALS._bookmark == bBookedGreen) && BF_GLOBALS.getFlag(fArrivedAtGangStop)) { @@ -557,13 +557,13 @@ bool Scene60::Ignition::check1() { } else if (BF_GLOBALS._bookmark < bStartOfGame) { // Should never reach here } else if (BF_GLOBALS._bookmark < bCalledToDomesticViolence) { - if ((BF_GLOBALS._v5098C >> 1) & 1) + if ((BF_GLOBALS._subFlagBitArr1 >> 1) & 1) BF_GLOBALS.setFlag(fLateToMarina); else - BF_GLOBALS._v5098C |= 2; + BF_GLOBALS._subFlagBitArr1 |= 2; } else { - int v = (((BF_GLOBALS._v5098C >> 2) & 15) + 1) & 15; - BF_GLOBALS._v5098C = (BF_GLOBALS._v5098C & 0xC3) | (v << 2); + int v = (((BF_GLOBALS._subFlagBitArr1 >> 2) & 15) + 1) & 15; + BF_GLOBALS._subFlagBitArr1 = (BF_GLOBALS._subFlagBitArr1 & 0xC3) | (v << 2); if ((v != 1) && (v != 2)) { BF_GLOBALS._deathReason = 19; @@ -573,17 +573,17 @@ bool Scene60::Ignition::check1() { } } - BF_GLOBALS._v5098C |= 1; + BF_GLOBALS._subFlagBitArr1 |= 1; return false; } bool Scene60::Ignition::check2() { switch (BF_GLOBALS._bookmark) { case bInspectionDone: - if (BF_GLOBALS._v5098D & 1) { + if (BF_GLOBALS._subFlagBitArr2 & 1) { BF_GLOBALS.setFlag(fLateToDrunkStop); } else { - BF_GLOBALS._v5098D |= 1; + BF_GLOBALS._subFlagBitArr2 |= 1; } break; case bCalledToDrunkStop: @@ -593,7 +593,7 @@ bool Scene60::Ignition::check2() { break; } - BF_GLOBALS._v5098C |= 0x80; + BF_GLOBALS._subFlagBitArr1 |= 0x80; return false; } @@ -1076,7 +1076,7 @@ void Scene60::postInit(SceneObjectList *OwnerList) { switch (BF_GLOBALS._dayNumber) { case 1: - if (BF_GLOBALS.getFlag(onDuty) && (BF_GLOBALS._v5098C & 1) && + if (BF_GLOBALS.getFlag(onDuty) && (BF_GLOBALS._subFlagBitArr1 & 1) && (BF_GLOBALS._bookmark < bStartOfGame) && (BF_GLOBALS._sceneManager._previousScene != 342)) { setAction(&_action2); if (BF_GLOBALS._sceneManager._previousScene == 342) @@ -1084,7 +1084,7 @@ void Scene60::postInit(SceneObjectList *OwnerList) { } break; case 2: - if (BF_GLOBALS.getFlag(onDuty) && ((BF_GLOBALS._v5098C >> 7) & 1) && + if (BF_GLOBALS.getFlag(onDuty) && ((BF_GLOBALS._subFlagBitArr1 >> 7) & 1) && (BF_GLOBALS._sceneManager._previousScene != 550) && (BF_GLOBALS._bookmark < bInspectionDone)) { setAction(&_action3); diff --git a/engines/tsage/blue_force/blueforce_scenes3.cpp b/engines/tsage/blue_force/blueforce_scenes3.cpp index db9425436b..1dea7f7687 100644 --- a/engines/tsage/blue_force/blueforce_scenes3.cpp +++ b/engines/tsage/blue_force/blueforce_scenes3.cpp @@ -556,7 +556,7 @@ void Scene300::dispatch() { if ((BF_GLOBALS._player._position.y < 59) && (BF_GLOBALS._player._position.x > 137) && (_sceneMode != 6308) && (_sceneMode != 7308)) { - BF_GLOBALS._v4CEA4 = 3; + // The original was setting a useless global variable (removed) _sceneMode = 6308; BF_GLOBALS._player.disableControl(); ADD_MOVER(BF_GLOBALS._player, BF_GLOBALS._player._position.x + 20, diff --git a/engines/tsage/globals.cpp b/engines/tsage/globals.cpp index dfdc3e00c7..c2c9a4f96e 100644 --- a/engines/tsage/globals.cpp +++ b/engines/tsage/globals.cpp @@ -229,7 +229,10 @@ void BlueForceGlobals::synchronize(Serializer &s) { TsAGE2Globals::synchronize(s); s.syncAsSint16LE(_dayNumber); - s.syncAsSint16LE(_v4CEA4); + if (s.getVersion() < 9) { + int tmpVar; + s.syncAsSint16LE(tmpVar); + } s.syncAsSint16LE(_v4CEAA); s.syncAsSint16LE(_marinaWomanCtr); s.syncAsSint16LE(_v4CEB0); @@ -257,8 +260,8 @@ void BlueForceGlobals::synchronize(Serializer &s) { s.syncAsSint16LE(_v501FC); s.syncAsSint16LE(_v5020C); s.syncAsSint16LE(_v50696); - s.syncAsSint16LE(_v5098C); - s.syncAsSint16LE(_v5098D); + s.syncAsSint16LE(_subFlagBitArr1); + s.syncAsSint16LE(_subFlagBitArr2); s.syncAsSint16LE(_v50CC2); s.syncAsSint16LE(_v50CC4); s.syncAsSint16LE(_v50CC6); @@ -287,7 +290,6 @@ void BlueForceGlobals::reset() { _interfaceY = UI_INTERFACE_Y; _dayNumber = 0; - _v4CEA4 = 0; _v4CEAA = 0; _marinaWomanCtr = 0; _v4CEB0 = 0; @@ -329,8 +331,8 @@ void BlueForceGlobals::reset() { _v501FC = 0; _v5020C = 0; _v50696 = 0; - _v5098C = 0; - _v5098D = 0; + _subFlagBitArr1 = 0; + _subFlagBitArr2 = 0; _v50CC2 = 0; _v50CC4 = 0; _v50CC6 = 0; diff --git a/engines/tsage/globals.h b/engines/tsage/globals.h index 3280d70361..3d3ccb9abf 100644 --- a/engines/tsage/globals.h +++ b/engines/tsage/globals.h @@ -187,7 +187,6 @@ public: ASoundExt _sound1, _sound3; StripProxy _stripProxy; int _dayNumber; - int _v4CEA4; int _v4CEAA; int _marinaWomanCtr; int _v4CEB0; @@ -214,8 +213,8 @@ public: int _v501FC; int _v5020C; int _v50696; - uint8 _v5098C; - uint8 _v5098D; + uint8 _subFlagBitArr1; + uint8 _subFlagBitArr2; int _v50CC2; int _v50CC4; int _v50CC6; |