Skip to content

Commit

Permalink
HOPKINS: More renaming in savegame structure
Browse files Browse the repository at this point in the history
  • Loading branch information
Strangerke committed Mar 1, 2013
1 parent d7ea7ca commit 167aa59
Show file tree
Hide file tree
Showing 4 changed files with 67 additions and 62 deletions.
36 changes: 18 additions & 18 deletions engines/hopkins/globals.h
Expand Up @@ -140,44 +140,44 @@ enum SauvegardeOffset {
, svGameWonFl = 135
, svCinemaCurtainCond1 = 166
, svCinemaCurtainCond2 = 167
, svField170 = 170
, svField171 = 171
, svField172 = 172
, svBankAttackAnimPlayedFl = 170
, svCopCall1PlayedFl = 171
, svCopCall2PlayedFl = 172
, svField173 = 173
, svUseless176 = 176
, svField177 = 177
, svField181 = 181
, svField176 = 176
, svPoolDogGoneFl = 177
, svCinemaDogGoneFl = 181
, svField183 = 183
, svField184 = 184
, svField186 = 186
, svField188 = 188
, svField200 = 200
, svField214 = 214
, svField220 = 220
, svField225 = 225
, svBombBoxOpenedFl = 220
, svBombDisarmedFl = 225
, svField228 = 228
, svField231 = 231
, svField253 = 253
, svField261 = 261
, svField270 = 270
, svField300 = 300
, svField311 = 311
, svField312 = 312
, svField318 = 318
, svUseless320 = 320
, svField330 = 330
, svBaseElevatorCond1 = 311
, svBaseFireFl = 312
, svSecondElevatorAvailableFl = 318
, svField320 = 320
, svEscapeLeftJailFl = 330
, svField333 = 333
, svUseless338 = 338
, svUseless339 = 339
, svUseless340 = 340
, svField338 = 338
, svField339 = 339
, svField340 = 340
, svField341 = 341
, svUseless352 = 352
, svField352 = 352
, svField353 = 353
, svField354 = 354
, svField355 = 355
, svField356 = 356
, svField357 = 357
, svUseless399 = 399
, svField399 = 399
, svField401 = 401
};

Expand Down
53 changes: 28 additions & 25 deletions engines/hopkins/hopkins.cpp
Expand Up @@ -183,7 +183,7 @@ bool HopkinsEngine::runWin95Demo() {
break;

case 3:
if (!_globals._saveData->_data[svField170]) {
if (!_globals._saveData->_data[svBankAttackAnimPlayedFl]) {
_soundManager.playSound(3);
if (getPlatform() == Common::kPlatformOS2 || getPlatform() == Common::kPlatformBeOS)
_graphicsManager.loadImage("fond");
Expand Down Expand Up @@ -214,7 +214,7 @@ bool HopkinsEngine::runWin95Demo() {
_soundManager.removeSample(3);
_soundManager.removeSample(4);
_graphicsManager.fadeOutLong();
_globals._saveData->_data[svField170] = 1;
_globals._saveData->_data[svBankAttackAnimPlayedFl] = 1;
}
_linesManager.setMaxLineIdx(5);
_globals._characterMaxPosY = 450;
Expand Down Expand Up @@ -246,7 +246,7 @@ bool HopkinsEngine::runWin95Demo() {
break;

case 7:
if (_globals._saveData->_data[svField220])
if (_globals._saveData->_data[svBombBoxOpenedFl])
_objectsManager.PERSONAGE("BOMBEB", "BOMBE", "BOMBE", "BOMBE", 2, true);
else
_objectsManager.PERSONAGE("BOMBEA", "BOMBE", "BOMBE", "BOMBE", 2, true);
Expand All @@ -261,7 +261,7 @@ bool HopkinsEngine::runWin95Demo() {
case 9:
_globals._characterMaxPosY = 440;
_linesManager.setMaxLineIdx(20);
if (_globals._saveData->_data[svField225])
if (_globals._saveData->_data[svBombDisarmedFl])
_objectsManager.PERSONAGE2("IM09", "IM09", "ANIM09", "IM09", 10, true);
else
bombExplosion();
Expand All @@ -280,7 +280,7 @@ bool HopkinsEngine::runWin95Demo() {
case 12:
_globals._characterMaxPosY = 450;
_linesManager.setMaxLineIdx(20);
if (_globals._saveData->_data[svField225]) {
if (_globals._saveData->_data[svBombDisarmedFl]) {
if (_globals._language == LANG_FR)
_graphicsManager.loadImage("ENDFR");
else
Expand All @@ -292,8 +292,8 @@ bool HopkinsEngine::runWin95Demo() {
while (_eventsManager.getMouseButton() != 1);
_graphicsManager.fadeOutLong();
restoreSystem();
}
bombExplosion();
} else
bombExplosion();
break;

case 13:
Expand Down Expand Up @@ -488,7 +488,7 @@ bool HopkinsEngine::runLinuxDemo() {
break;

case 3:
if (!_globals._saveData->_data[svField170]) {
if (!_globals._saveData->_data[svBankAttackAnimPlayedFl]) {
_soundManager.playSound(3);
if (getPlatform() == Common::kPlatformOS2 || getPlatform() == Common::kPlatformBeOS)
_graphicsManager.loadImage("fond");
Expand Down Expand Up @@ -521,7 +521,7 @@ bool HopkinsEngine::runLinuxDemo() {
_soundManager.removeSample(2);
_soundManager.removeSample(3);
_soundManager.removeSample(4);
_globals._saveData->_data[svField170] = 1;
_globals._saveData->_data[svBankAttackAnimPlayedFl] = 1;
}

_linesManager.setMaxLineIdx(5);
Expand Down Expand Up @@ -551,7 +551,7 @@ bool HopkinsEngine::runLinuxDemo() {
break;

case 7:
if (_globals._saveData->_data[svField220])
if (_globals._saveData->_data[svBombBoxOpenedFl])
_objectsManager.PERSONAGE("BOMBEB", "BOMBE", "BOMBE", "BOMBE", 2, true);
else
_objectsManager.PERSONAGE("BOMBEA", "BOMBE", "BOMBE", "BOMBE", 2, true);
Expand All @@ -567,10 +567,10 @@ bool HopkinsEngine::runLinuxDemo() {
_linesManager.setMaxLineIdx(20);
_globals._characterMaxPosY = 440;

if (!_globals._saveData->_data[svField225])
if (!_globals._saveData->_data[svBombDisarmedFl])
bombExplosion();

_objectsManager.PERSONAGE2("IM09", "IM09", "ANIM09", "IM09", 10, true);
else
_objectsManager.PERSONAGE2("IM09", "IM09", "ANIM09", "IM09", 10, true);
break;

case 10:
Expand All @@ -586,7 +586,7 @@ bool HopkinsEngine::runLinuxDemo() {
case 12:
_linesManager.setMaxLineIdx(20);
_globals._characterMaxPosY = 450;
if (_globals._saveData->_data[svField225])
if (_globals._saveData->_data[svBombDisarmedFl])
_objectsManager.PERSONAGE2("IM12", "IM12", "ANIM12", "IM12", 1, false);
else
bombExplosion();
Expand Down Expand Up @@ -819,6 +819,9 @@ bool HopkinsEngine::runFull() {
if (g_system->getEventManager()->shouldQuit())
return false;

_globals._exitId = 93;
_globals._saveData->_data[svEscapeLeftJailFl] = 0;

switch (_globals._exitId) {
case 1:
_linesManager.setMaxLineIdx(40);
Expand All @@ -827,7 +830,7 @@ bool HopkinsEngine::runFull() {
break;

case 3:
if (!_globals._saveData->_data[svField170]) {
if (!_globals._saveData->_data[svBankAttackAnimPlayedFl]) {
_soundManager.playSound(3);
if (getPlatform() == Common::kPlatformOS2 || getPlatform() == Common::kPlatformBeOS)
_graphicsManager.loadImage("fond");
Expand Down Expand Up @@ -866,7 +869,7 @@ bool HopkinsEngine::runFull() {
_soundManager.removeSample(4);
if (getPlatform() != Common::kPlatformLinux)
_graphicsManager.fadeOutLong();
_globals._saveData->_data[svField170] = 1;
_globals._saveData->_data[svBankAttackAnimPlayedFl] = 1;
}
_linesManager.setMaxLineIdx(5);
_globals._characterMaxPosY = 450;
Expand Down Expand Up @@ -895,7 +898,7 @@ bool HopkinsEngine::runFull() {
break;

case 7:
if (_globals._saveData->_data[svField220])
if (_globals._saveData->_data[svBombBoxOpenedFl])
_objectsManager.PERSONAGE("BOMBEB", "BOMBE", "BOMBE", "BOMBE", 2, true);
else
_objectsManager.PERSONAGE("BOMBEA", "BOMBE", "BOMBE", "BOMBE", 2, true);
Expand All @@ -910,7 +913,7 @@ bool HopkinsEngine::runFull() {
case 9:
_linesManager.setMaxLineIdx(20);
_globals._characterMaxPosY = 440;
if (_globals._saveData->_data[svField225])
if (_globals._saveData->_data[svBombDisarmedFl])
_objectsManager.PERSONAGE2("IM09", "IM09", "ANIM09", "IM09", 10, true);
else
bombExplosion();
Expand All @@ -929,7 +932,7 @@ bool HopkinsEngine::runFull() {
case 12:
_linesManager.setMaxLineIdx(20);
_globals._characterMaxPosY = 450;
if (_globals._saveData->_data[svField225])
if (_globals._saveData->_data[svBombDisarmedFl])
_objectsManager.PERSONAGE2("IM12", "IM12", "ANIM12", "IM12", 1, false);
else
bombExplosion();
Expand Down Expand Up @@ -1048,7 +1051,7 @@ bool HopkinsEngine::runFull() {
case 24:
_linesManager.setMaxLineIdx(5);
_globals._characterMaxPosY = 450;
if (_globals._saveData->_data[svField181] == 1)
if (_globals._saveData->_data[svCinemaDogGoneFl] == 1)
_objectsManager.PERSONAGE2("IM24", "IM24A", "ANIM24", "IM24", 1, true);
else
_objectsManager.PERSONAGE2("IM24", "IM24", "ANIM24", "IM24", 1, true);
Expand All @@ -1075,7 +1078,7 @@ bool HopkinsEngine::runFull() {
case 27:
_linesManager.setMaxLineIdx(15);
_globals._characterMaxPosY = 440;
if (_globals._saveData->_data[svField177] == 1)
if (_globals._saveData->_data[svPoolDogGoneFl] == 1)
_objectsManager.PERSONAGE2("IM27", "IM27A", "ANIM27", "IM27", 27, true);
else
_objectsManager.PERSONAGE2("IM27", "IM27", "ANIM27", "IM27", 27, true);
Expand Down Expand Up @@ -1206,7 +1209,7 @@ bool HopkinsEngine::runFull() {
break;

case 61:
if (_globals._saveData->_data[svField311] == 1 && !_globals._saveData->_data[svField312])
if (_globals._saveData->_data[svBaseElevatorCond1] == 1 && !_globals._saveData->_data[svBaseFireFl])
handleConflagration();
_objectsManager.PERSONAGE("IM61", "IM61", "ANIM61", "IM61", 21, false);
break;
Expand Down Expand Up @@ -1274,7 +1277,7 @@ bool HopkinsEngine::runFull() {
case 73:
_linesManager.setMaxLineIdx(15);
_globals._characterMaxPosY = 445;
if (_globals._saveData->_data[svField318] == 1)
if (_globals._saveData->_data[svSecondElevatorAvailableFl] == 1)
_objectsManager.PERSONAGE2("IM73", "IM73A", "ANIM73", "IM73", 21, true);
else
_objectsManager.PERSONAGE2("IM73", "IM73", "ANIM73", "IM73", 21, true);
Expand Down Expand Up @@ -1347,7 +1350,7 @@ bool HopkinsEngine::runFull() {
case 93:
_linesManager.setMaxLineIdx(5);
_globals._characterMaxPosY = 445;
if (_globals._saveData->_data[svField330]) {
if (_globals._saveData->_data[svEscapeLeftJailFl]) {
if (getPlatform() == Common::kPlatformLinux || getPlatform() == Common::kPlatformWindows)
_objectsManager.PERSONAGE2("IM93", "IM93C", "ANIM93", "IM93", 29, true);
else
Expand Down Expand Up @@ -1961,7 +1964,7 @@ void HopkinsEngine::handleConflagration() {

_graphicsManager.fadeOutLong();
_graphicsManager.endDisplayBob();
_globals._saveData->_data[svField312] = 1;
_globals._saveData->_data[svBaseFireFl] = 1;
_globals._disableInventFl = false;
}

Expand Down
16 changes: 9 additions & 7 deletions engines/hopkins/objects.cpp
Expand Up @@ -1777,15 +1777,17 @@ void ObjectsManager::handleCityMap() {
do {
int mouseButton = _vm->_eventsManager.getMouseButton();
if (mouseButton) {
if (_vm->_globals._saveData->_data[svField170] == 1 && !_vm->_globals._saveData->_data[svField171]) {
_vm->_globals._saveData->_data[svField171] = 1;
// First cop call : Go to the bank and free the hostages
if (_vm->_globals._saveData->_data[svBankAttackAnimPlayedFl] == 1 && !_vm->_globals._saveData->_data[svCopCall1PlayedFl]) {
_vm->_globals._saveData->_data[svCopCall1PlayedFl] = 1;
_vm->_globals._introSpeechOffFl = true;
_vm->_talkManager.startAnimatedCharacterDialogue("APPEL1.pe2");
_vm->_globals._introSpeechOffFl = false;
mouseButton = 0;
}
if (_vm->_globals._saveData->_data[svFreedHostageFl] == 1 && !_vm->_globals._saveData->_data[svField172]) {
_vm->_globals._saveData->_data[svField172] = 1;
// Second cop call: Helico has been found in the empty lot
if (_vm->_globals._saveData->_data[svFreedHostageFl] == 1 && !_vm->_globals._saveData->_data[svCopCall2PlayedFl]) {
_vm->_globals._saveData->_data[svCopCall2PlayedFl] = 1;
_vm->_globals._introSpeechOffFl = true;
_vm->_talkManager.startAnimatedCharacterDialogue("APPEL2.pe2");
_vm->_globals._introSpeechOffFl = false;
Expand Down Expand Up @@ -3228,7 +3230,7 @@ void ObjectsManager::SPECIAL_INI() {
_vm->_soundManager.mixVoice(383, 4, displayedTxtFl);
_vm->_globals._saveData->_data[svField270] = 1;
_vm->_globals._saveData->_data[svField300] = 1;
_vm->_globals._saveData->_data[svUseless320] = 1;
_vm->_globals._saveData->_data[svField320] = 1;
if (_vm->_soundManager._voiceOffFl) {
for (int i = 0; i <= 199; i++)
_vm->_eventsManager.VBL();
Expand Down Expand Up @@ -3281,14 +3283,14 @@ void ObjectsManager::SPECIAL_INI() {
_vm->_linesManager.ZONEP[21]._messageId = 30;
_vm->_linesManager.ZONEP[22]._messageId = 30;
_vm->_linesManager.ZONEP[23]._messageId = 30;
for (int i = 200; i <= 214; i++) {
for (int i = svField200; i <= svField214; i++) {
if (_vm->_globals._saveData->_data[i] != 2)
_vm->_globals._saveData->_data[i] = 0;
}
break;

case 73:
if (!_vm->_globals._saveData->_data[svField318]) {
if (!_vm->_globals._saveData->_data[svSecondElevatorAvailableFl]) {
_vm->_globals.resetHidingUseCount(0);
_vm->_globals.resetHidingUseCount(1);
}
Expand Down
24 changes: 12 additions & 12 deletions engines/hopkins/script.cpp
Expand Up @@ -955,7 +955,7 @@ int ScriptManager::handleOpcode(byte *dataP) {
case 58:
_vm->_globals._introSpeechOffFl = true;
_vm->_talkManager.startAnimatedCharacterDialogue("Gm1.PE2");
_vm->_globals._saveData->_data[svUseless176] = 1;
_vm->_globals._saveData->_data[svField176] = 1;
_vm->_globals._saveData->_data[svField270] = 2;
_vm->_globals._introSpeechOffFl = false;
break;
Expand Down Expand Up @@ -2069,11 +2069,11 @@ int ScriptManager::handleOpcode(byte *dataP) {
if (_vm->_globals._saveData->_data[svField341] == 3)
_vm->_graphicsManager.fastDisplay(_vm->_globals.SPRITE_ECRAN, 296, 212, 4);
if (_vm->_globals._saveData->_data[svField341] == 1)
_vm->_globals._saveData->_data[svUseless338] = 0;
_vm->_globals._saveData->_data[svField338] = 0;
if (_vm->_globals._saveData->_data[svField341] == 2)
_vm->_globals._saveData->_data[svUseless339] = 0;
_vm->_globals._saveData->_data[svField339] = 0;
if (_vm->_globals._saveData->_data[svField341] == 3)
_vm->_globals._saveData->_data[svUseless340] = 0;
_vm->_globals._saveData->_data[svField340] = 0;
}
_vm->_soundManager.playSoundFile("SOUND83.WAV");
_vm->_objectsManager.OPTI_ONE(6, 0, 23, 0);
Expand All @@ -2099,11 +2099,11 @@ int ScriptManager::handleOpcode(byte *dataP) {
if (_vm->_globals._saveData->_data[svField341] == 3)
_vm->_graphicsManager.fastDisplay(_vm->_globals.SPRITE_ECRAN, 296, 212, 4);
if (_vm->_globals._saveData->_data[svField341] == 1)
_vm->_globals._saveData->_data[svUseless338] = 0;
_vm->_globals._saveData->_data[svField338] = 0;
if (_vm->_globals._saveData->_data[svField341] == 2)
_vm->_globals._saveData->_data[svUseless339] = 0;
_vm->_globals._saveData->_data[svField339] = 0;
if (_vm->_globals._saveData->_data[svField341] == 3)
_vm->_globals._saveData->_data[svUseless340] = 0;
_vm->_globals._saveData->_data[svField340] = 0;
}
_vm->_soundManager.playSoundFile("SOUND83.WAV");
_vm->_objectsManager.OPTI_ONE(5, 0, 23, 0);
Expand All @@ -2129,11 +2129,11 @@ int ScriptManager::handleOpcode(byte *dataP) {
if (_vm->_globals._saveData->_data[svField341] == 3)
_vm->_graphicsManager.fastDisplay(_vm->_globals.SPRITE_ECRAN, 296, 212, 4);
if (_vm->_globals._saveData->_data[svField341] == 1)
_vm->_globals._saveData->_data[svUseless338] = 0;
_vm->_globals._saveData->_data[svField338] = 0;
if (_vm->_globals._saveData->_data[svField341] == 2)
_vm->_globals._saveData->_data[svUseless339] = 0;
_vm->_globals._saveData->_data[svField339] = 0;
if (_vm->_globals._saveData->_data[svField341] == 3)
_vm->_globals._saveData->_data[svUseless340] = 0;
_vm->_globals._saveData->_data[svField340] = 0;
}
_vm->_soundManager.playSoundFile("SOUND83.WAV");
_vm->_objectsManager.OPTI_ONE(4, 0, 23, 0);
Expand Down Expand Up @@ -2191,7 +2191,7 @@ int ScriptManager::handleOpcode(byte *dataP) {
v51->_startSpriteIndex = 57;
v51->_location = 97;
_vm->_globals._saveData->_data[svHopkinsCloneFl] = 1;
_vm->_globals._saveData->_data[svUseless352] = 1;
_vm->_globals._saveData->_data[svField352] = 1;
_vm->_globals._saveData->_data[svField353] = 1;
_vm->_globals._saveData->_data[svField354] = 1;
break;
Expand Down Expand Up @@ -2243,7 +2243,7 @@ int ScriptManager::handleOpcode(byte *dataP) {
_vm->_linesManager.ZONEP[4]._destX = 276;
_vm->_objectsManager.enableVerb(4, 19);
_vm->_graphicsManager.fastDisplay(_vm->_globals.SPRITE_ECRAN, 285, 379, 0);
_vm->_globals._saveData->_data[svUseless399] = 1;
_vm->_globals._saveData->_data[svField399] = 1;
break;

case 246:
Expand Down

0 comments on commit 167aa59

Please sign in to comment.