diff options
Diffstat (limited to 'engines/hopkins/hopkins.cpp')
-rw-r--r-- | engines/hopkins/hopkins.cpp | 919 |
1 files changed, 460 insertions, 459 deletions
diff --git a/engines/hopkins/hopkins.cpp b/engines/hopkins/hopkins.cpp index 1742294cdb..01c67f6430 100644 --- a/engines/hopkins/hopkins.cpp +++ b/engines/hopkins/hopkins.cpp @@ -47,8 +47,8 @@ HopkinsEngine::HopkinsEngine(OSystem *syst, const HopkinsGameDescription *gameDe _eventsManager = new EventsManager(this); _fileManager = new FileManager(this); _fontManager = new FontManager(this); + _globals = new Globals(this); - _globals.setParent(this); _graphicsManager.setParent(this); _linesManager.setParent(this); _menuManager.setParent(this); @@ -60,6 +60,7 @@ HopkinsEngine::HopkinsEngine(OSystem *syst, const HopkinsGameDescription *gameDe } HopkinsEngine::~HopkinsEngine() { + delete _globals; delete _fontManager; delete _fileManager; delete _eventsManager; @@ -77,14 +78,14 @@ Common::String HopkinsEngine::generateSaveName(int slot) { * Returns true if it is currently okay to restore a game */ bool HopkinsEngine::canLoadGameStateCurrently() { - return !_globals._exitId && !_globals._cityMapEnabledFl && _eventsManager->_mouseFl; + return !_globals->_exitId && !_globals->_cityMapEnabledFl && _eventsManager->_mouseFl; } /** * Returns true if it is currently okay to save the game */ bool HopkinsEngine::canSaveGameStateCurrently() { - return !_globals._exitId && !_globals._cityMapEnabledFl && _eventsManager->_mouseFl; + return !_globals->_exitId && !_globals->_cityMapEnabledFl && _eventsManager->_mouseFl; } /** @@ -104,7 +105,7 @@ Common::Error HopkinsEngine::saveGameState(int slot, const Common::String &desc) Common::Error HopkinsEngine::run() { _saveLoadManager.initSaves(); - _globals.setConfig(); + _globals->setConfig(); _fileManager->initCensorship(); initializeSystem(); @@ -123,12 +124,12 @@ Common::Error HopkinsEngine::run() { } bool HopkinsEngine::runWin95Demo() { - _globals.loadObjects(); + _globals->loadObjects(); _objectsManager.changeObject(14); _objectsManager.addObject(14); _objectsManager._helicopterFl = false; - _globals.iRegul = 1; + _globals->iRegul = 1; _graphicsManager.lockScreen(); _graphicsManager.clearScreen(); @@ -142,39 +143,39 @@ bool HopkinsEngine::runWin95Demo() { playIntro(); _eventsManager->_rateCounter = 0; - _globals.iRegul = 1; - _globals._speed = 1; + _globals->iRegul = 1; + _globals->_speed = 1; for (int i = 1; i < 50; i++) { _graphicsManager.copySurface(_graphicsManager._vesaScreen, 0, 0, 640, 440, _graphicsManager._vesaBuffer, 0, 0); _eventsManager->refreshScreenAndEvents(); } - _globals.iRegul = 0; + _globals->iRegul = 0; if (_eventsManager->_rateCounter > 475) - _globals._speed = 2; + _globals->_speed = 2; if (_eventsManager->_rateCounter > 700) - _globals._speed = 3; + _globals->_speed = 3; _graphicsManager.fadeOutLong(); - _globals.iRegul = 1; - _globals.PERSO = _fileManager->loadFile("PERSO.SPR"); - _globals._characterType = 0; + _globals->iRegul = 1; + _globals->PERSO = _fileManager->loadFile("PERSO.SPR"); + _globals->_characterType = 0; _objectsManager._mapCarPosX = _objectsManager._mapCarPosY = 0; - memset(_globals._saveData, 0, 2000); - _globals._exitId = 0; + memset(_globals->_saveData, 0, 2000); + _globals->_exitId = 0; if (getLanguage() != Common::PL_POL) if (!displayAdultDisclaimer()) return Common::kNoError; for (;;) { - if (_globals._exitId == 300) - _globals._exitId = 0; + if (_globals->_exitId == 300) + _globals->_exitId = 0; - if (!_globals._exitId) { - _globals._exitId = _menuManager.menu(); - if (_globals._exitId == -1) { - _globals.PERSO = _globals.freeMemory(_globals.PERSO); + if (!_globals->_exitId) { + _globals->_exitId = _menuManager.menu(); + if (_globals->_exitId == -1) { + _globals->PERSO = _globals->freeMemory(_globals->PERSO); restoreSystem(); return false; } @@ -183,36 +184,36 @@ bool HopkinsEngine::runWin95Demo() { if (shouldQuit()) return false; - switch (_globals._exitId) { + switch (_globals->_exitId) { case 1: _linesManager.setMaxLineIdx(40); - _globals._characterMaxPosY = 435; + _globals->_characterMaxPosY = 435; _objectsManager.PERSONAGE2("IM01", "IM01", "ANIM01", "IM01", 2, true); break; case 3: - if (!_globals._saveData->_data[svBankAttackAnimPlayedFl]) { + if (!_globals->_saveData->_data[svBankAttackAnimPlayedFl]) { _soundManager.playSound(3); if (getPlatform() == Common::kPlatformOS2 || getPlatform() == Common::kPlatformBeOS) _graphicsManager.loadImage("fond"); else { - if (_globals._language == LANG_FR) + if (_globals->_language == LANG_FR) _graphicsManager.loadImage("fondfr"); - else if (_globals._language == LANG_EN) + else if (_globals->_language == LANG_EN) _graphicsManager.loadImage("fondan"); - else if (_globals._language == LANG_SP) + else if (_globals->_language == LANG_SP) _graphicsManager.loadImage("fondes"); } _graphicsManager.fadeInLong(); _eventsManager->delay(500); _graphicsManager.fadeOutLong(); - _globals.iRegul = 1; + _globals->iRegul = 1; _soundManager._specialSoundNum = 2; _graphicsManager.lockScreen(); _graphicsManager.clearScreen(); _graphicsManager.unlockScreen(); _graphicsManager.clearPalette(); - if (!_globals._censorshipFl) + if (!_globals->_censorshipFl) _animationManager->playAnim("BANQUE.ANM", 200, 28, 200); else _animationManager->playAnim("BANKUK.ANM", 200, 28, 200); @@ -222,25 +223,25 @@ bool HopkinsEngine::runWin95Demo() { _soundManager.removeSample(3); _soundManager.removeSample(4); _graphicsManager.fadeOutLong(); - _globals._saveData->_data[svBankAttackAnimPlayedFl] = 1; + _globals->_saveData->_data[svBankAttackAnimPlayedFl] = 1; } _linesManager.setMaxLineIdx(5); - _globals._characterMaxPosY = 450; + _globals->_characterMaxPosY = 450; _objectsManager.PERSONAGE2("IM03", "IM03", "ANIM03", "IM03", 2, false); break; case 4: - _globals._disableInventFl = true; + _globals->_disableInventFl = true; _objectsManager.handleCityMap(); - _globals._disableInventFl = false; + _globals->_disableInventFl = false; break; case 5: _linesManager.setMaxLineIdx(5); - _globals._characterMaxPosY = 455; + _globals->_characterMaxPosY = 455; - if (_globals._saveData->_data[svFreedHostageFl]) { - if (_globals._saveData->_data[svFreedHostageFl] == 1) + if (_globals->_saveData->_data[svFreedHostageFl]) { + if (_globals->_saveData->_data[svFreedHostageFl] == 1) _objectsManager.PERSONAGE2("IM05", "IM05A", "ANIM05B", "IM05", 3, false); } else { _objectsManager.PERSONAGE2("IM05", "IM05", "ANIM05", "IM05", 3, false); @@ -249,12 +250,12 @@ bool HopkinsEngine::runWin95Demo() { case 6: _linesManager.setMaxLineIdx(20); - _globals._characterMaxPosY = 460; + _globals->_characterMaxPosY = 460; _objectsManager.PERSONAGE2("IM06", "IM06", "ANIM06", "IM06", 2, true); break; case 7: - if (_globals._saveData->_data[svBombBoxOpenedFl]) + if (_globals->_saveData->_data[svBombBoxOpenedFl]) _objectsManager.PERSONAGE("BOMBEB", "BOMBE", "BOMBE", "BOMBE", 2, true); else _objectsManager.PERSONAGE("BOMBEA", "BOMBE", "BOMBE", "BOMBE", 2, true); @@ -262,14 +263,14 @@ bool HopkinsEngine::runWin95Demo() { case 8: _linesManager.setMaxLineIdx(15); - _globals._characterMaxPosY = 450; + _globals->_characterMaxPosY = 450; _objectsManager.PERSONAGE2("IM08", "IM08", "ANIM08", "IM08", 2, true); break; case 9: - _globals._characterMaxPosY = 440; + _globals->_characterMaxPosY = 440; _linesManager.setMaxLineIdx(20); - if (_globals._saveData->_data[svBombDisarmedFl]) + if (_globals->_saveData->_data[svBombDisarmedFl]) _objectsManager.PERSONAGE2("IM09", "IM09", "ANIM09", "IM09", 10, true); else bombExplosion(); @@ -281,15 +282,15 @@ bool HopkinsEngine::runWin95Demo() { case 11: _linesManager.setMaxLineIdx(20); - _globals._characterMaxPosY = 450; + _globals->_characterMaxPosY = 450; _objectsManager.PERSONAGE2("IM11", "IM11", "ANIM11", "IM11", 2, false); break; case 12: - _globals._characterMaxPosY = 450; + _globals->_characterMaxPosY = 450; _linesManager.setMaxLineIdx(20); - if (_globals._saveData->_data[svBombDisarmedFl]) { - if (_globals._language == LANG_FR) + if (_globals->_saveData->_data[svBombDisarmedFl]) { + if (_globals->_language == LANG_FR) _graphicsManager.loadImage("ENDFR"); else _graphicsManager.loadImage("ENDUK"); @@ -338,11 +339,11 @@ bool HopkinsEngine::runWin95Demo() { break; case 113: - _globals._exitId = 0; - _globals._prevScreenId = _globals._screenId; - _globals._saveData->_data[svLastPrevScreenId] = _globals._screenId; - _globals._screenId = 113; - _globals._saveData->_data[svLastScreenId] = _globals._screenId; + _globals->_exitId = 0; + _globals->_prevScreenId = _globals->_screenId; + _globals->_saveData->_data[svLastPrevScreenId] = _globals->_screenId; + _globals->_screenId = 113; + _globals->_saveData->_data[svLastScreenId] = _globals->_screenId; _computerManager->showComputer(COMPUTER_HOPKINS); _graphicsManager.lockScreen(); _graphicsManager.clearScreen(); @@ -355,11 +356,11 @@ bool HopkinsEngine::runWin95Demo() { break; case 114: - _globals._prevScreenId = _globals._screenId; - _globals._saveData->_data[svLastPrevScreenId] = _globals._screenId; - _globals._screenId = 114; - _globals._saveData->_data[svLastScreenId] = _globals._screenId; - _globals._exitId = 0; + _globals->_prevScreenId = _globals->_screenId; + _globals->_saveData->_data[svLastPrevScreenId] = _globals->_screenId; + _globals->_screenId = 114; + _globals->_saveData->_data[svLastScreenId] = _globals->_screenId; + _globals->_exitId = 0; _computerManager->showComputer(COMPUTER_SAMANTHA); _graphicsManager.lockScreen(); _graphicsManager.clearScreen(); @@ -367,11 +368,11 @@ bool HopkinsEngine::runWin95Demo() { break; case 115: - _globals._exitId = 0; - _globals._prevScreenId = _globals._screenId; - _globals._saveData->_data[svLastPrevScreenId] = _globals._screenId; - _globals._screenId = 115; - _globals._saveData->_data[svLastScreenId] = _globals._screenId; + _globals->_exitId = 0; + _globals->_prevScreenId = _globals->_screenId; + _globals->_saveData->_data[svLastPrevScreenId] = _globals->_screenId; + _globals->_screenId = 115; + _globals->_saveData->_data[svLastScreenId] = _globals->_screenId; _computerManager->showComputer(COMPUTER_PUBLIC); _graphicsManager.lockScreen(); _graphicsManager.clearScreen(); @@ -380,19 +381,19 @@ bool HopkinsEngine::runWin95Demo() { case 150: _soundManager.playSound(28); - _globals.iRegul = 4; // CHECKME! + _globals->iRegul = 4; // CHECKME! _graphicsManager.lockScreen(); _graphicsManager.clearScreen(); _graphicsManager.unlockScreen(); _graphicsManager.clearPalette(); _animationManager->playAnim("JOUR1A.anm", 12, 12, 2000); - _globals.iRegul = 0; - _globals._exitId = 300; + _globals->iRegul = 0; + _globals->_exitId = 300; break; case 151: _soundManager.playSound(28); - _globals.iRegul = 4; // CHECKME! + _globals->iRegul = 4; // CHECKME! _graphicsManager.lockScreen(); _graphicsManager.clearScreen(); _graphicsManager.unlockScreen(); @@ -401,20 +402,20 @@ bool HopkinsEngine::runWin95Demo() { _graphicsManager.fadeInLong(); _eventsManager->delay(5000); _graphicsManager.fadeOutLong(); - _globals._exitId = 300; - _globals.iRegul = 0; + _globals->_exitId = 300; + _globals->iRegul = 0; break; case 152: _soundManager.playSound(28); - _globals.iRegul = 4; // CHECKME! + _globals->iRegul = 4; // CHECKME! _graphicsManager.lockScreen(); _graphicsManager.clearScreen(); _graphicsManager.unlockScreen(); _graphicsManager.clearPalette(); _animationManager->playAnim("JOUR4A.anm", 12, 12, 2000); - _globals.iRegul = 0; - _globals._exitId = 300; + _globals->iRegul = 0; + _globals->_exitId = 300; break; } } @@ -422,7 +423,7 @@ bool HopkinsEngine::runWin95Demo() { } bool HopkinsEngine::runLinuxDemo() { - _globals.loadObjects(); + _globals->loadObjects(); _objectsManager.changeObject(14); _objectsManager.addObject(14); _objectsManager._helicopterFl = false; @@ -446,23 +447,23 @@ bool HopkinsEngine::runLinuxDemo() { if (!_eventsManager->_escKeyFl) playIntro(); - _globals.iRegul = 0; - _globals.PERSO = _fileManager->loadFile("PERSO.SPR"); - _globals._characterType = 0; + _globals->iRegul = 0; + _globals->PERSO = _fileManager->loadFile("PERSO.SPR"); + _globals->_characterType = 0; _objectsManager._mapCarPosX = _objectsManager._mapCarPosY = 0; - memset(_globals._saveData, 0, 2000); - _globals._exitId = 0; + memset(_globals->_saveData, 0, 2000); + _globals->_exitId = 0; for (;;) { - if (_globals._exitId == 300) - _globals._exitId = 0; + if (_globals->_exitId == 300) + _globals->_exitId = 0; - if (!_globals._exitId) { - _globals._exitId = _menuManager.menu(); - if (_globals._exitId == -1) { + if (!_globals->_exitId) { + _globals->_exitId = _menuManager.menu(); + if (_globals->_exitId == -1) { if (!shouldQuit()) endLinuxDemo(); - _globals.PERSO = _globals.freeMemory(_globals.PERSO); + _globals->PERSO = _globals->freeMemory(_globals->PERSO); restoreSystem(); } } @@ -470,7 +471,7 @@ bool HopkinsEngine::runLinuxDemo() { if (shouldQuit()) return false; - switch (_globals._exitId) { + switch (_globals->_exitId) { case 17: case 18: case 19: @@ -491,27 +492,27 @@ bool HopkinsEngine::runLinuxDemo() { case 1: _linesManager.setMaxLineIdx(40); - _globals._characterMaxPosY = 435; + _globals->_characterMaxPosY = 435; _objectsManager.PERSONAGE2("IM01", "IM01", "ANIM01", "IM01", 1, true); break; case 3: - if (!_globals._saveData->_data[svBankAttackAnimPlayedFl]) { + if (!_globals->_saveData->_data[svBankAttackAnimPlayedFl]) { _soundManager.playSound(3); if (getPlatform() == Common::kPlatformOS2 || getPlatform() == Common::kPlatformBeOS) _graphicsManager.loadImage("fond"); else { - if (_globals._language == LANG_FR) + if (_globals->_language == LANG_FR) _graphicsManager.loadImage("fondfr"); - else if (_globals._language == LANG_EN) + else if (_globals->_language == LANG_EN) _graphicsManager.loadImage("fondan"); - else if (_globals._language == LANG_SP) + else if (_globals->_language == LANG_SP) _graphicsManager.loadImage("fondes"); } _graphicsManager.fadeInLong(); _eventsManager->delay(500); _graphicsManager.fadeOutLong(); - _globals.iRegul = 1; + _globals->iRegul = 1; _soundManager._specialSoundNum = 2; _graphicsManager.lockScreen(); @@ -520,7 +521,7 @@ bool HopkinsEngine::runLinuxDemo() { _graphicsManager.clearPalette(); _graphicsManager.FADE_LINUX = 2; - if (!_globals._censorshipFl) + if (!_globals->_censorshipFl) _animationManager->playAnim("BANQUE.ANM", 200, 28, 200); else _animationManager->playAnim("BANKUK.ANM", 200, 28, 200); @@ -529,24 +530,24 @@ bool HopkinsEngine::runLinuxDemo() { _soundManager.removeSample(2); _soundManager.removeSample(3); _soundManager.removeSample(4); - _globals._saveData->_data[svBankAttackAnimPlayedFl] = 1; + _globals->_saveData->_data[svBankAttackAnimPlayedFl] = 1; } _linesManager.setMaxLineIdx(5); - _globals._characterMaxPosY = 450; + _globals->_characterMaxPosY = 450; _objectsManager.PERSONAGE2("IM03", "IM03", "ANIM03", "IM03", 2, false); break; case 4: - _globals._disableInventFl = true; + _globals->_disableInventFl = true; _objectsManager.handleCityMap(); - _globals._disableInventFl = false; + _globals->_disableInventFl = false; break; case 5: _linesManager.setMaxLineIdx(5); - _globals._characterMaxPosY = 455; - if (_globals._saveData->_data[svFreedHostageFl] == 1) + _globals->_characterMaxPosY = 455; + if (_globals->_saveData->_data[svFreedHostageFl] == 1) _objectsManager.PERSONAGE2("IM05", "IM05A", "ANIM05B", "IM05", 3, false); else _objectsManager.PERSONAGE2("IM05", "IM05", "ANIM05", "IM05", 3, false); @@ -554,12 +555,12 @@ bool HopkinsEngine::runLinuxDemo() { case 6: _linesManager.setMaxLineIdx(20); - _globals._characterMaxPosY = 460; + _globals->_characterMaxPosY = 460; _objectsManager.PERSONAGE2("IM06", "IM06", "ANIM06", "IM06", 2, true); break; case 7: - if (_globals._saveData->_data[svBombBoxOpenedFl]) + if (_globals->_saveData->_data[svBombBoxOpenedFl]) _objectsManager.PERSONAGE("BOMBEB", "BOMBE", "BOMBE", "BOMBE", 2, true); else _objectsManager.PERSONAGE("BOMBEA", "BOMBE", "BOMBE", "BOMBE", 2, true); @@ -567,15 +568,15 @@ bool HopkinsEngine::runLinuxDemo() { case 8: _linesManager.setMaxLineIdx(15); - _globals._characterMaxPosY = 450; + _globals->_characterMaxPosY = 450; _objectsManager.PERSONAGE2("IM08", "IM08", "ANIM08", "IM08", 2, true); break; case 9: _linesManager.setMaxLineIdx(20); - _globals._characterMaxPosY = 440; + _globals->_characterMaxPosY = 440; - if (!_globals._saveData->_data[svBombDisarmedFl]) + if (!_globals->_saveData->_data[svBombDisarmedFl]) bombExplosion(); else _objectsManager.PERSONAGE2("IM09", "IM09", "ANIM09", "IM09", 10, true); @@ -587,14 +588,14 @@ bool HopkinsEngine::runLinuxDemo() { case 11: _linesManager.setMaxLineIdx(20); - _globals._characterMaxPosY = 450; + _globals->_characterMaxPosY = 450; _objectsManager.PERSONAGE2("IM11", "IM11", "ANIM11", "IM11", 2, false); break; case 12: _linesManager.setMaxLineIdx(20); - _globals._characterMaxPosY = 450; - if (_globals._saveData->_data[svBombDisarmedFl]) + _globals->_characterMaxPosY = 450; + if (_globals->_saveData->_data[svBombDisarmedFl]) _objectsManager.PERSONAGE2("IM12", "IM12", "ANIM12", "IM12", 1, false); else bombExplosion(); @@ -602,13 +603,13 @@ bool HopkinsEngine::runLinuxDemo() { case 13: _linesManager.setMaxLineIdx(40); - _globals._characterMaxPosY = 440; + _globals->_characterMaxPosY = 440; _objectsManager.PERSONAGE2("IM13", "IM13", "ANIM13", "IM13", 1, true); break; case 14: _linesManager.setMaxLineIdx(40); - _globals._characterMaxPosY = 440; + _globals->_characterMaxPosY = 440; _objectsManager.PERSONAGE2("IM14", "IM14", "ANIM14", "IM14", 1, true); break; @@ -618,24 +619,24 @@ bool HopkinsEngine::runLinuxDemo() { case 16: _linesManager.setMaxLineIdx(5); - _globals._characterMaxPosY = 450; + _globals->_characterMaxPosY = 450; - if (_globals._saveData->_data[svForestAvailableFl] == 1) { + if (_globals->_saveData->_data[svForestAvailableFl] == 1) { _objectsManager.PERSONAGE2("IM16", "IM16A", "ANIM16", "IM16", 7, true); - } else if (!_globals._saveData->_data[svForestAvailableFl]) { + } else if (!_globals->_saveData->_data[svForestAvailableFl]) { _objectsManager.PERSONAGE2("IM16", "IM16", "ANIM16", "IM16", 7, true); } break; case 25: _linesManager.setMaxLineIdx(20); - _globals._characterMaxPosY = 445; + _globals->_characterMaxPosY = 445; _objectsManager.PERSONAGE2("IM25", "IM25", "ANIM25", "IM25", 30, true); break; case 26: _linesManager.setMaxLineIdx(40); - _globals._characterMaxPosY = 435; + _globals->_characterMaxPosY = 435; _objectsManager.PERSONAGE2("IM26", "IM26", "ANIM26", "IM26", 30, true); case 33: @@ -655,11 +656,11 @@ bool HopkinsEngine::runLinuxDemo() { break; case 113: - _globals._exitId = 0; - _globals._prevScreenId = _globals._screenId; - _globals._saveData->_data[svLastPrevScreenId] = _globals._screenId; - _globals._screenId = 113; - _globals._saveData->_data[svLastScreenId] = 113; + _globals->_exitId = 0; + _globals->_prevScreenId = _globals->_screenId; + _globals->_saveData->_data[svLastPrevScreenId] = _globals->_screenId; + _globals->_screenId = 113; + _globals->_saveData->_data[svLastScreenId] = 113; _computerManager->showComputer(COMPUTER_HOPKINS); _graphicsManager.lockScreen(); @@ -673,11 +674,11 @@ bool HopkinsEngine::runLinuxDemo() { break; case 114: - _globals._exitId = 0; - _globals._prevScreenId = _globals._screenId; - _globals._saveData->_data[svLastPrevScreenId] = _globals._screenId; - _globals._screenId = 114; - _globals._saveData->_data[svLastScreenId] = 114; + _globals->_exitId = 0; + _globals->_prevScreenId = _globals->_screenId; + _globals->_saveData->_data[svLastPrevScreenId] = _globals->_screenId; + _globals->_screenId = 114; + _globals->_saveData->_data[svLastScreenId] = 114; _computerManager->showComputer(COMPUTER_SAMANTHA); _graphicsManager.lockScreen(); _graphicsManager.clearScreen(); @@ -685,11 +686,11 @@ bool HopkinsEngine::runLinuxDemo() { break; case 115: - _globals._exitId = 0; - _globals._prevScreenId = _globals._screenId; - _globals._saveData->_data[svLastPrevScreenId] = _globals._screenId; - _globals._screenId = 115; - _globals._saveData->_data[svLastScreenId] = 115; + _globals->_exitId = 0; + _globals->_prevScreenId = _globals->_screenId; + _globals->_saveData->_data[svLastPrevScreenId] = _globals->_screenId; + _globals->_screenId = 115; + _globals->_saveData->_data[svLastScreenId] = 115; _computerManager->showComputer(COMPUTER_PUBLIC); _graphicsManager.lockScreen(); _graphicsManager.clearScreen(); @@ -698,7 +699,7 @@ bool HopkinsEngine::runLinuxDemo() { case 150: _soundManager.playSound(16); - _globals.iRegul = 1; + _globals->iRegul = 1; _graphicsManager.lockScreen(); _graphicsManager.clearScreen(); @@ -706,13 +707,13 @@ bool HopkinsEngine::runLinuxDemo() { _graphicsManager.clearPalette(); _graphicsManager.FADE_LINUX = 2; _animationManager->playAnim("JOUR1A.anm", 12, 12, 2000); - _globals.iRegul = 0; - _globals._exitId = 300; + _globals->iRegul = 0; + _globals->_exitId = 300; break; case 151: _soundManager.playSound(16); - _globals.iRegul = 1; + _globals->iRegul = 1; _graphicsManager.lockScreen(); _graphicsManager.clearScreen(); @@ -720,13 +721,13 @@ bool HopkinsEngine::runLinuxDemo() { _graphicsManager.clearPalette(); _graphicsManager.FADE_LINUX = 2; _animationManager->playAnim("JOUR3A.anm", 12, 12, 2000); - _globals.iRegul = 0; - _globals._exitId = 300; + _globals->iRegul = 0; + _globals->_exitId = 300; break; case 152: _soundManager.playSound(16); - _globals.iRegul = 1; + _globals->iRegul = 1; _graphicsManager.lockScreen(); _graphicsManager.clearScreen(); @@ -734,8 +735,8 @@ bool HopkinsEngine::runLinuxDemo() { _graphicsManager.clearPalette(); _graphicsManager.FADE_LINUX = 2; _animationManager->playAnim("JOUR4A.anm", 12, 12, 2000); - _globals.iRegul = 0; - _globals._exitId = 300; + _globals->iRegul = 0; + _globals->_exitId = 300; break; } } @@ -746,7 +747,7 @@ bool HopkinsEngine::runFull() { if (getPlatform() == Common::kPlatformLinux) _soundManager.playSound(16); - _globals.loadObjects(); + _globals->loadObjects(); _objectsManager.changeObject(14); _objectsManager.addObject(14); @@ -757,7 +758,7 @@ bool HopkinsEngine::runFull() { // in my copy: it mentions a Win95 version v4 using DirectDraw (Strangerke) } else if (getPlatform() == Common::kPlatformWindows) { _objectsManager._helicopterFl = false; - _globals.iRegul = 1; + _globals->iRegul = 1; // This code displays the game version. // It wasn't present in the original and could be put in the debugger // It has been added there for debug purposes @@ -775,7 +776,7 @@ bool HopkinsEngine::runFull() { _graphicsManager.fadeOutLong(); _graphicsManager.clearVesaScreen(); - _globals.iRegul = 1; + _globals->iRegul = 1; } _graphicsManager.lockScreen(); @@ -789,8 +790,8 @@ bool HopkinsEngine::runFull() { _eventsManager->delay(500); _graphicsManager.fadeOutLong(); - _globals._speed = 2; - _globals.iRegul = 1; + _globals->_speed = 2; + _globals->iRegul = 1; _graphicsManager.FADE_LINUX = 2; _animationManager->playAnim("MP.ANM", 10, 16, 200); } else { @@ -810,21 +811,21 @@ bool HopkinsEngine::runFull() { _eventsManager->delay(500); _graphicsManager.fadeOutLong(); } - _globals.iRegul = 0; - _globals.PERSO = _fileManager->loadFile("PERSO.SPR"); - _globals._characterType = 0; + _globals->iRegul = 0; + _globals->PERSO = _fileManager->loadFile("PERSO.SPR"); + _globals->_characterType = 0; _objectsManager._mapCarPosX = _objectsManager._mapCarPosY = 0; - memset(_globals._saveData, 0, 2000); + memset(_globals->_saveData, 0, 2000); - _globals._exitId = 0; + _globals->_exitId = 0; for (;;) { - if (_globals._exitId == 300) - _globals._exitId = 0; - if (!_globals._exitId) { - _globals._exitId = _menuManager.menu(); - if (_globals._exitId == -1) { - _globals.PERSO = _globals.freeMemory(_globals.PERSO); + if (_globals->_exitId == 300) + _globals->_exitId = 0; + if (!_globals->_exitId) { + _globals->_exitId = _menuManager.menu(); + if (_globals->_exitId == -1) { + _globals->PERSO = _globals->freeMemory(_globals->PERSO); restoreSystem(); return false; } @@ -833,31 +834,31 @@ bool HopkinsEngine::runFull() { if (shouldQuit()) return false; - switch (_globals._exitId) { + switch (_globals->_exitId) { case 1: _linesManager.setMaxLineIdx(40); - _globals._characterMaxPosY = 435; + _globals->_characterMaxPosY = 435; _objectsManager.PERSONAGE2("IM01", "IM01", "ANIM01", "IM01", 1, true); break; case 3: - if (!_globals._saveData->_data[svBankAttackAnimPlayedFl]) { + if (!_globals->_saveData->_data[svBankAttackAnimPlayedFl]) { // Play the bank attack animation _soundManager.playSound(3); if (getPlatform() == Common::kPlatformOS2 || getPlatform() == Common::kPlatformBeOS) _graphicsManager.loadImage("fond"); else { - if (_globals._language == LANG_FR) + if (_globals->_language == LANG_FR) _graphicsManager.loadImage("fondfr"); - else if (_globals._language == LANG_EN) + else if (_globals->_language == LANG_EN) _graphicsManager.loadImage("fondan"); - else if (_globals._language == LANG_SP) + else if (_globals->_language == LANG_SP) _graphicsManager.loadImage("fondes"); } _graphicsManager.fadeInLong(); _eventsManager->delay(500); _graphicsManager.fadeOutLong(); - _globals.iRegul = 1; + _globals->iRegul = 1; _soundManager._specialSoundNum = 2; _graphicsManager.lockScreen(); _graphicsManager.clearScreen(); @@ -867,7 +868,7 @@ bool HopkinsEngine::runFull() { if (getPlatform() == Common::kPlatformLinux) _graphicsManager.FADE_LINUX = 2; - if (!_globals._censorshipFl) + if (!_globals->_censorshipFl) _animationManager->playAnim("BANQUE.ANM", 200, 28, 200); else _animationManager->playAnim("BANKUK.ANM", 200, 28, 200); @@ -888,23 +889,23 @@ bool HopkinsEngine::runFull() { _graphicsManager.fadeOutLong(); } - _globals._saveData->_data[svBankAttackAnimPlayedFl] = 1; + _globals->_saveData->_data[svBankAttackAnimPlayedFl] = 1; } _linesManager.setMaxLineIdx(5); - _globals._characterMaxPosY = 450; + _globals->_characterMaxPosY = 450; _objectsManager.PERSONAGE2("IM03", "IM03", "ANIM03", "IM03", 2, false); break; case 4: - _globals._disableInventFl = true; + _globals->_disableInventFl = true; _objectsManager.handleCityMap(); - _globals._disableInventFl = false; + _globals->_disableInventFl = false; break; case 5: _linesManager.setMaxLineIdx(5); - _globals._characterMaxPosY = 455; - if (_globals._saveData->_data[svFreedHostageFl] == 1) + _globals->_characterMaxPosY = 455; + if (_globals->_saveData->_data[svFreedHostageFl] == 1) _objectsManager.PERSONAGE2("IM05", "IM05A", "ANIM05B", "IM05", 3, false); else _objectsManager.PERSONAGE2("IM05", "IM05", "ANIM05", "IM05", 3, false); @@ -912,12 +913,12 @@ bool HopkinsEngine::runFull() { case 6: _linesManager.setMaxLineIdx(20); - _globals._characterMaxPosY = 460; + _globals->_characterMaxPosY = 460; _objectsManager.PERSONAGE2("IM06", "IM06", "ANIM06", "IM06", 2, true); break; case 7: - if (_globals._saveData->_data[svBombBoxOpenedFl]) + if (_globals->_saveData->_data[svBombBoxOpenedFl]) _objectsManager.PERSONAGE("BOMBEB", "BOMBE", "BOMBE", "BOMBE", 2, true); else _objectsManager.PERSONAGE("BOMBEA", "BOMBE", "BOMBE", "BOMBE", 2, true); @@ -925,14 +926,14 @@ bool HopkinsEngine::runFull() { case 8: _linesManager.setMaxLineIdx(15); - _globals._characterMaxPosY = 450; + _globals->_characterMaxPosY = 450; _objectsManager.PERSONAGE2("IM08", "IM08", "ANIM08", "IM08", 2, true); break; case 9: _linesManager.setMaxLineIdx(20); - _globals._characterMaxPosY = 440; - if (_globals._saveData->_data[svBombDisarmedFl]) + _globals->_characterMaxPosY = 440; + if (_globals->_saveData->_data[svBombDisarmedFl]) _objectsManager.PERSONAGE2("IM09", "IM09", "ANIM09", "IM09", 10, true); else bombExplosion(); @@ -944,14 +945,14 @@ bool HopkinsEngine::runFull() { case 11: _linesManager.setMaxLineIdx(20); - _globals._characterMaxPosY = 450; + _globals->_characterMaxPosY = 450; _objectsManager.PERSONAGE2("IM11", "IM11", "ANIM11", "IM11", 2, false); break; case 12: _linesManager.setMaxLineIdx(20); - _globals._characterMaxPosY = 450; - if (_globals._saveData->_data[svBombDisarmedFl]) + _globals->_characterMaxPosY = 450; + if (_globals->_saveData->_data[svBombDisarmedFl]) _objectsManager.PERSONAGE2("IM12", "IM12", "ANIM12", "IM12", 1, false); else bombExplosion(); @@ -959,13 +960,13 @@ bool HopkinsEngine::runFull() { case 13: _linesManager.setMaxLineIdx(40); - _globals._characterMaxPosY = 440; + _globals->_characterMaxPosY = 440; _objectsManager.PERSONAGE2("IM13", "IM13", "ANIM13", "IM13", 1, true); break; case 14: _linesManager.setMaxLineIdx(40); - _globals._characterMaxPosY = 440; + _globals->_characterMaxPosY = 440; _objectsManager.PERSONAGE2("IM14", "IM14", "ANIM14", "IM14", 1, true); break; @@ -978,8 +979,8 @@ bool HopkinsEngine::runFull() { case 16: _linesManager.setMaxLineIdx(5); - _globals._characterMaxPosY = 450; - if (_globals._saveData->_data[svForestAvailableFl] == 1) + _globals->_characterMaxPosY = 450; + if (_globals->_saveData->_data[svForestAvailableFl] == 1) _objectsManager.PERSONAGE2("IM16", "IM16A", "ANIM16", "IM16", 7, true); else _objectsManager.PERSONAGE2("IM16", "IM16", "ANIM16", "IM16", 7, true); @@ -987,13 +988,13 @@ bool HopkinsEngine::runFull() { case 17: _linesManager.setMaxLineIdx(40); - _globals._characterMaxPosY = 440; - if (_globals._saveData->_data[svHutBurningFl] == 1) + _globals->_characterMaxPosY = 440; + if (_globals->_saveData->_data[svHutBurningFl] == 1) _objectsManager.PERSONAGE2("IM17", "IM17A", "ANIM17", "IM17", 11, true); - else if (!_globals._saveData->_data[svHutBurningFl]) + else if (!_globals->_saveData->_data[svHutBurningFl]) _objectsManager.PERSONAGE2("IM17", "IM17", "ANIM17", "IM17", 11, true); - if (_globals._exitId == 18) { - _globals.iRegul = 1; + if (_globals->_exitId == 18) { + _globals->iRegul = 1; _graphicsManager.lockScreen(); _graphicsManager.clearScreen(); _graphicsManager.unlockScreen(); @@ -1012,13 +1013,13 @@ bool HopkinsEngine::runFull() { _animationManager->playAnim("PURG1A.ANM", 12, 18, 50); _graphicsManager.fadeOutShort(); } - _globals.iRegul = 0; + _globals->iRegul = 0; } break; case 18: _linesManager.setMaxLineIdx(5); - _globals._characterMaxPosY = 450; + _globals->_characterMaxPosY = 450; if (getPlatform() == Common::kPlatformLinux || getPlatform() == Common::kPlatformWindows) _objectsManager.PERSONAGE2("IM18", "IM18", "ANIM18", "IM18", 29, false); else @@ -1027,8 +1028,8 @@ bool HopkinsEngine::runFull() { case 19: _linesManager.setMaxLineIdx(40); - _globals._characterMaxPosY = 440; - if (_globals._saveData->_data[svHeavenGuardGoneFl]) + _globals->_characterMaxPosY = 440; + if (_globals->_saveData->_data[svHeavenGuardGoneFl]) _objectsManager.PERSONAGE2("IM19", "IM19A", "ANIM19", "IM19", 6, true); else _objectsManager.PERSONAGE2("IM19", "IM19", "ANIM19", "IM19", 6, true); @@ -1036,10 +1037,10 @@ bool HopkinsEngine::runFull() { case 20: _linesManager.setMaxLineIdx(10); - _globals._characterMaxPosY = 440; + _globals->_characterMaxPosY = 440; _objectsManager.PERSONAGE2("IM20", "IM20", "ANIM20", "IM20", 6, true); - if (_globals._exitId == 17) { - _globals.iRegul = 1; + if (_globals->_exitId == 17) { + _globals->iRegul = 1; _soundManager.stopSound(); _graphicsManager.lockScreen(); _graphicsManager.clearScreen(); @@ -1051,26 +1052,26 @@ bool HopkinsEngine::runFull() { _animationManager->playAnim("PURG2A.ANM", 12, 18, 50); if (getPlatform() != Common::kPlatformLinux) _graphicsManager.fadeOutShort(); - _globals.iRegul = 0; + _globals->iRegul = 0; } break; case 22: _linesManager.setMaxLineIdx(20); - _globals._characterMaxPosY = 445; + _globals->_characterMaxPosY = 445; _objectsManager.PERSONAGE2("IM22", "IM22", "ANIM22", "IM22", 6, true); break; case 23: _linesManager.setMaxLineIdx(20); - _globals._characterMaxPosY = 440; + _globals->_characterMaxPosY = 440; _objectsManager.PERSONAGE2("IM23", "IM23", "ANIM23", "IM23", 6, true); break; case 24: _linesManager.setMaxLineIdx(5); - _globals._characterMaxPosY = 450; - if (_globals._saveData->_data[svCinemaDogGoneFl] == 1) + _globals->_characterMaxPosY = 450; + if (_globals->_saveData->_data[svCinemaDogGoneFl] == 1) _objectsManager.PERSONAGE2("IM24", "IM24A", "ANIM24", "IM24", 1, true); else _objectsManager.PERSONAGE2("IM24", "IM24", "ANIM24", "IM24", 1, true); @@ -1078,7 +1079,7 @@ bool HopkinsEngine::runFull() { case 25: _linesManager.setMaxLineIdx(20); - _globals._characterMaxPosY = 445; + _globals->_characterMaxPosY = 445; if (getPlatform() == Common::kPlatformLinux || getPlatform() == Common::kPlatformWindows) _objectsManager.PERSONAGE2("IM25", "IM25", "ANIM25", "IM25", 30, true); else @@ -1087,7 +1088,7 @@ bool HopkinsEngine::runFull() { case 26: _linesManager.setMaxLineIdx(40); - _globals._characterMaxPosY = 435; + _globals->_characterMaxPosY = 435; if (getPlatform() == Common::kPlatformLinux || getPlatform() == Common::kPlatformWindows) _objectsManager.PERSONAGE2("IM26", "IM26", "ANIM26", "IM26", 30, true); else @@ -1096,8 +1097,8 @@ bool HopkinsEngine::runFull() { case 27: _linesManager.setMaxLineIdx(15); - _globals._characterMaxPosY = 440; - if (_globals._saveData->_data[svPoolDogGoneFl] == 1) + _globals->_characterMaxPosY = 440; + if (_globals->_saveData->_data[svPoolDogGoneFl] == 1) _objectsManager.PERSONAGE2("IM27", "IM27A", "ANIM27", "IM27", 27, true); else _objectsManager.PERSONAGE2("IM27", "IM27", "ANIM27", "IM27", 27, true); @@ -1105,8 +1106,8 @@ bool HopkinsEngine::runFull() { case 28: _linesManager.setMaxLineIdx(5); - _globals._characterMaxPosY = 450; - if (_globals._saveData->_data[svCinemaCurtainCond1] != 1 || _globals._saveData->_data[svCinemaCurtainCond2] != 1) + _globals->_characterMaxPosY = 450; + if (_globals->_saveData->_data[svCinemaCurtainCond1] != 1 || _globals->_saveData->_data[svCinemaCurtainCond2] != 1) _objectsManager.PERSONAGE2("IM28", "IM28", "ANIM28", "IM28", 1, false); else _objectsManager.PERSONAGE2("IM28A", "IM28", "ANIM28", "IM28", 1, false); @@ -1114,13 +1115,13 @@ bool HopkinsEngine::runFull() { case 29: _linesManager.setMaxLineIdx(50); - _globals._characterMaxPosY = 445; + _globals->_characterMaxPosY = 445; _objectsManager.PERSONAGE2("IM29", "IM29", "ANIM29", "IM29", 1, true); break; case 30: _linesManager.setMaxLineIdx(15); - _globals._characterMaxPosY = 440; + _globals->_characterMaxPosY = 440; _objectsManager.PERSONAGE2("IM30", "IM30", "ANIM30", "IM30", 24, false); break; @@ -1130,7 +1131,7 @@ bool HopkinsEngine::runFull() { case 32: _linesManager.setMaxLineIdx(20); - _globals._characterMaxPosY = 445; + _globals->_characterMaxPosY = 445; _objectsManager.PERSONAGE2("IM32", "IM32", "ANIM32", "IM32", 2, true); break; @@ -1150,18 +1151,18 @@ bool HopkinsEngine::runFull() { case 40: case 41: { _linesManager.setMaxLineIdx(40); - _globals._characterMaxPosY = 435; - _globals._disableInventFl = false; + _globals->_characterMaxPosY = 435; + _globals->_disableInventFl = false; _objectsManager._forestFl = true; - Common::String im = Common::String::format("IM%d", _globals._exitId); + Common::String im = Common::String::format("IM%d", _globals->_exitId); _soundManager.playSound(13); if (_objectsManager._forestSprite == g_PTRNUL) { _objectsManager._forestSprite = _objectsManager.loadSprite("HOPDEG.SPR"); _soundManager.loadSample(1, "SOUND41.WAV"); } _objectsManager.PERSONAGE2(im, im, "BANDIT", im, 13, false); - if (_globals._exitId < 35 || _globals._exitId > 49) { - _objectsManager._forestSprite = _globals.freeMemory(_objectsManager._forestSprite); + if (_globals->_exitId < 35 || _globals->_exitId > 49) { + _objectsManager._forestSprite = _globals->freeMemory(_objectsManager._forestSprite); _objectsManager._forestFl = false; _soundManager.removeSample(1); } @@ -1170,133 +1171,133 @@ bool HopkinsEngine::runFull() { case 50: playPlaneCutscene(); - _globals._exitId = 51; + _globals->_exitId = 51; break; case 51: _linesManager.setMaxLineIdx(10); - _globals._characterMaxPosY = 440; + _globals->_characterMaxPosY = 440; _objectsManager.PERSONAGE2("IM51", "IM51", "ANIM51", "IM51", 14, true); break; case 52: _linesManager.setMaxLineIdx(15); - _globals._characterMaxPosY = 445; + _globals->_characterMaxPosY = 445; _objectsManager.PERSONAGE2("IM52", "IM52", "ANIM52", "IM52", 14, true); break; case 54: _linesManager.setMaxLineIdx(30); - _globals._characterMaxPosY = 440; + _globals->_characterMaxPosY = 440; _objectsManager.PERSONAGE2("IM54", "IM54", "ANIM54", "IM54", 14, true); break; case 55: _linesManager.setMaxLineIdx(30); - _globals._characterMaxPosY = 460; + _globals->_characterMaxPosY = 460; _objectsManager.PERSONAGE2("IM55", "IM55", "ANIM55", "IM55", 14, false); break; case 56: _linesManager.setMaxLineIdx(30); - _globals._characterMaxPosY = 440; + _globals->_characterMaxPosY = 440; _objectsManager.PERSONAGE2("IM56", "IM56", "ANIM56", "IM56", 14, false); break; case 57: _linesManager.setMaxLineIdx(30); - _globals._characterMaxPosY = 440; + _globals->_characterMaxPosY = 440; _objectsManager.PERSONAGE2("IM57", "IM57", "ANIM57", "IM57", 14, true); break; case 58: _linesManager.setMaxLineIdx(30); - _globals._characterMaxPosY = 440; + _globals->_characterMaxPosY = 440; _objectsManager.PERSONAGE2("IM58", "IM58", "ANIM58", "IM58", 14, false); break; case 59: _linesManager.setMaxLineIdx(5); - _globals._characterMaxPosY = 445; + _globals->_characterMaxPosY = 445; _objectsManager.PERSONAGE2("IM59", "IM59", "ANIM59", "IM59", 21, false); break; case 60: _linesManager.setMaxLineIdx(30); - _globals._characterMaxPosY = 440; + _globals->_characterMaxPosY = 440; _objectsManager.PERSONAGE2("IM60", "IM60", "ANIM60", "IM60", 21, false); break; case 61: - if (_globals._saveData->_data[svBaseElevatorCond1] == 1 && !_globals._saveData->_data[svBaseFireFl]) + if (_globals->_saveData->_data[svBaseElevatorCond1] == 1 && !_globals->_saveData->_data[svBaseFireFl]) handleConflagration(); _objectsManager.PERSONAGE("IM61", "IM61", "ANIM61", "IM61", 21, false); break; case 62: _linesManager.setMaxLineIdx(8); - _globals._characterMaxPosY = 435; + _globals->_characterMaxPosY = 435; _objectsManager.PERSONAGE2("IM62", "IM62", NULL, "IM62", 21, false); break; case 63: _linesManager.setMaxLineIdx(30); - _globals._characterMaxPosY = 435; + _globals->_characterMaxPosY = 435; _objectsManager.PERSONAGE2("IM63", "IM63", "ANIM63", "IM63", 21, false); break; case 64: _linesManager.setMaxLineIdx(30); - _globals._characterMaxPosY = 435; + _globals->_characterMaxPosY = 435; _objectsManager.PERSONAGE2("IM64", "IM64", "ANIM64", "IM64", 21, true); break; case 65: _linesManager.setMaxLineIdx(30); - _globals._characterMaxPosY = 435; + _globals->_characterMaxPosY = 435; _objectsManager.PERSONAGE2("IM65", "IM65", "ANIM65", "IM65", 21, false); break; case 66: _linesManager.setMaxLineIdx(5); - _globals._characterMaxPosY = 445; + _globals->_characterMaxPosY = 445; _objectsManager.PERSONAGE2("IM66", "IM66", "ANIM66", "IM66", 21, false); break; case 67: _linesManager.setMaxLineIdx(8); - _globals._characterMaxPosY = 435; + _globals->_characterMaxPosY = 435; _objectsManager.PERSONAGE2("IM67", "IM67", NULL, "IM67", 21, false); break; case 68: _linesManager.setMaxLineIdx(8); - _globals._characterMaxPosY = 435; + _globals->_characterMaxPosY = 435; _objectsManager.PERSONAGE2("IM68", "IM68", "ANIM68", "IM68", 21, true); break; case 69: _linesManager.setMaxLineIdx(5); - _globals._characterMaxPosY = 445; + _globals->_characterMaxPosY = 445; _objectsManager.PERSONAGE2("IM69", "IM69", "ANIM69", "IM69", 21, false); break; case 70: _linesManager.setMaxLineIdx(8); - _globals._characterMaxPosY = 435; + _globals->_characterMaxPosY = 435; _objectsManager.PERSONAGE2("IM70", "IM70", NULL, "IM70", 21, false); break; case 71: _linesManager.setMaxLineIdx(5); - _globals._characterMaxPosY = 445; + _globals->_characterMaxPosY = 445; _objectsManager.PERSONAGE2("IM71", "IM71", "ANIM71", "IM71", 21, false); break; case 73: _linesManager.setMaxLineIdx(15); - _globals._characterMaxPosY = 445; - if (_globals._saveData->_data[svSecondElevatorAvailableFl] == 1) + _globals->_characterMaxPosY = 445; + if (_globals->_saveData->_data[svSecondElevatorAvailableFl] == 1) _objectsManager.PERSONAGE2("IM73", "IM73A", "ANIM73", "IM73", 21, true); else _objectsManager.PERSONAGE2("IM73", "IM73", "ANIM73", "IM73", 21, true); @@ -1368,8 +1369,8 @@ bool HopkinsEngine::runFull() { case 93: _linesManager.setMaxLineIdx(5); - _globals._characterMaxPosY = 445; - if (_globals._saveData->_data[svEscapeLeftJailFl]) { + _globals->_characterMaxPosY = 445; + if (_globals->_saveData->_data[svEscapeLeftJailFl]) { if (getPlatform() == Common::kPlatformLinux || getPlatform() == Common::kPlatformWindows) _objectsManager.PERSONAGE2("IM93", "IM93C", "ANIM93", "IM93", 29, true); else @@ -1384,28 +1385,28 @@ bool HopkinsEngine::runFull() { case 94: _linesManager.setMaxLineIdx(5); - _globals._characterMaxPosY = 440; + _globals->_characterMaxPosY = 440; _objectsManager.PERSONAGE2("IM94", "IM94", "ANIM94", "IM94", 19, true); break; case 95: _linesManager.setMaxLineIdx(5); - _globals._characterMaxPosY = 435; + _globals->_characterMaxPosY = 435; _objectsManager.PERSONAGE2("IM95", "IM95", "ANIM95", "IM95", 19, false); break; case 96: _linesManager.setMaxLineIdx(5); - _globals._characterMaxPosY = 435; + _globals->_characterMaxPosY = 435; _objectsManager.PERSONAGE2("IM96", "IM96", "ANIM96", "IM96", 19, false); break; case 97: _linesManager.setMaxLineIdx(5); - _globals._characterMaxPosY = 435; + _globals->_characterMaxPosY = 435; _objectsManager.PERSONAGE2("IM97", "IM97", "ANIM97", "IM97", 19, false); - if (_globals._exitId == 18) { - _globals.iRegul = 1; + if (_globals->_exitId == 18) { + _globals->iRegul = 1; _soundManager.stopSound(); _graphicsManager.lockScreen(); _graphicsManager.clearScreen(); @@ -1414,19 +1415,19 @@ bool HopkinsEngine::runFull() { _soundManager.playSound(6); _animationManager->playAnim("PURG1A.ANM", 12, 18, 50); _graphicsManager.fadeOutShort(); - _globals.iRegul = 0; + _globals->iRegul = 0; } break; case 98: _linesManager.setMaxLineIdx(5); - _globals._characterMaxPosY = 435; + _globals->_characterMaxPosY = 435; _objectsManager.PERSONAGE2("IM98", "IM98", "ANIM98", "IM98", 19, true); break; case 99: _linesManager.setMaxLineIdx(5); - _globals._characterMaxPosY = 435; + _globals->_characterMaxPosY = 435; _objectsManager.PERSONAGE2("IM99", "IM99", "ANIM99", "IM99", 19, true); break; @@ -1443,11 +1444,11 @@ bool HopkinsEngine::runFull() { break; case 113: - _globals._prevScreenId = _globals._screenId; - _globals._screenId = 113; - _globals._saveData->_data[svLastPrevScreenId] = _globals._prevScreenId; - _globals._saveData->_data[svLastScreenId] = _globals._screenId; - _globals._exitId = 0; + _globals->_prevScreenId = _globals->_screenId; + _globals->_screenId = 113; + _globals->_saveData->_data[svLastPrevScreenId] = _globals->_prevScreenId; + _globals->_saveData->_data[svLastScreenId] = _globals->_screenId; + _globals->_exitId = 0; _computerManager->showComputer(COMPUTER_HOPKINS); _graphicsManager.lockScreen(); _graphicsManager.clearScreen(); @@ -1460,11 +1461,11 @@ bool HopkinsEngine::runFull() { break; case 114: - _globals._exitId = 0; - _globals._prevScreenId = _globals._screenId; - _globals._screenId = 114; - _globals._saveData->_data[svLastPrevScreenId] = _globals._prevScreenId; - _globals._saveData->_data[svLastScreenId] = _globals._screenId; + _globals->_exitId = 0; + _globals->_prevScreenId = _globals->_screenId; + _globals->_screenId = 114; + _globals->_saveData->_data[svLastPrevScreenId] = _globals->_prevScreenId; + _globals->_saveData->_data[svLastScreenId] = _globals->_screenId; _computerManager->showComputer(COMPUTER_SAMANTHA); _graphicsManager.lockScreen(); _graphicsManager.clearScreen(); @@ -1472,11 +1473,11 @@ bool HopkinsEngine::runFull() { break; case 115: - _globals._prevScreenId = _globals._screenId; - _globals._screenId = 115; - _globals._saveData->_data[svLastPrevScreenId] = _globals._prevScreenId; - _globals._saveData->_data[svLastScreenId] = _globals._screenId; - _globals._exitId = 0; + _globals->_prevScreenId = _globals->_screenId; + _globals->_screenId = 115; + _globals->_saveData->_data[svLastPrevScreenId] = _globals->_prevScreenId; + _globals->_saveData->_data[svLastScreenId] = _globals->_screenId; + _globals->_exitId = 0; _computerManager->showComputer(COMPUTER_PUBLIC); _graphicsManager.lockScreen(); _graphicsManager.clearScreen(); @@ -1485,7 +1486,7 @@ bool HopkinsEngine::runFull() { case 150: _soundManager.playSound(16); - _globals.iRegul = 1; + _globals->iRegul = 1; _graphicsManager.lockScreen(); _graphicsManager.clearScreen(); _graphicsManager.unlockScreen(); @@ -1493,13 +1494,13 @@ bool HopkinsEngine::runFull() { if (getPlatform() == Common::kPlatformLinux) _graphicsManager.FADE_LINUX = 2; _animationManager->playAnim("JOUR1A.ANM", 12, 12, 2000); - _globals.iRegul = 0; - _globals._exitId = 300; + _globals->iRegul = 0; + _globals->_exitId = 300; break; case 151: _soundManager.playSound(16); - _globals.iRegul = 1; + _globals->iRegul = 1; _graphicsManager.lockScreen(); _graphicsManager.clearScreen(); _graphicsManager.unlockScreen(); @@ -1507,13 +1508,13 @@ bool HopkinsEngine::runFull() { if (getPlatform() == Common::kPlatformLinux) _graphicsManager.FADE_LINUX = 2; _animationManager->playAnim("JOUR3A.ANM", 12, 12, 2000); - _globals.iRegul = 0; - _globals._exitId = 300; + _globals->iRegul = 0; + _globals->_exitId = 300; break; case 152: _soundManager.playSound(16); - _globals.iRegul = 1; + _globals->iRegul = 1; _graphicsManager.lockScreen(); _graphicsManager.clearScreen(); _graphicsManager.unlockScreen(); @@ -1521,8 +1522,8 @@ bool HopkinsEngine::runFull() { if (getPlatform() == Common::kPlatformLinux) _graphicsManager.FADE_LINUX = 2; _animationManager->playAnim("JOUR4A.ANM", 12, 12, 2000); - _globals.iRegul = 0; - _globals._exitId = 300; + _globals->iRegul = 0; + _globals->_exitId = 300; break; case 194: @@ -1531,21 +1532,21 @@ bool HopkinsEngine::runFull() { case 197: case 198: case 199: - _globals.PERSO = _globals.freeMemory(_globals.PERSO); - _globals.iRegul = 1; + _globals->PERSO = _globals->freeMemory(_globals->PERSO); + _globals->iRegul = 1; _soundManager.stopSound(); _soundManager.playSound(23); - _globals._exitId = handleBaseMap(); // Handles the base map (non-Windows) - //_globals._exitId = WBASE(); // Handles the 3D Doom level (Windows) + _globals->_exitId = handleBaseMap(); // Handles the base map (non-Windows) + //_globals->_exitId = WBASE(); // Handles the 3D Doom level (Windows) _soundManager.stopSound(); - _globals.PERSO = _fileManager->loadFile("PERSO.SPR"); - _globals._characterType = 0; - _globals.iRegul = 0; + _globals->PERSO = _fileManager->loadFile("PERSO.SPR"); + _globals->_characterType = 0; + _globals->iRegul = 0; _graphicsManager._lineNbr = SCREEN_WIDTH; break; } } - _globals.PERSO = _globals.freeMemory(_globals.PERSO); + _globals->PERSO = _globals->freeMemory(_globals->PERSO); restoreSystem(); return true; } @@ -1580,7 +1581,7 @@ void HopkinsEngine::initializeSystem() { SearchMan.addSubDirectoryMatching(gameDataDir, "VOICE"); SearchMan.addSubDirectoryMatching(gameDataDir, "TSVGA"); - _globals.clearAll(); + _globals->clearAll(); _eventsManager->initMouseData(); _fontManager->initData(); @@ -1591,7 +1592,7 @@ void HopkinsEngine::initializeSystem() { _eventsManager->setMouseOn(); _eventsManager->_mouseFl = false; - _globals.loadCharacterData(); + _globals->loadCharacterData(); _eventsManager->_mouseOffset.x = 0; _eventsManager->_mouseOffset.y = 0; @@ -1611,7 +1612,7 @@ void HopkinsEngine::playIntro() { memset(&paletteData, 0, PALETTE_EXT_BLOCK_SIZE); _eventsManager->refreshScreenAndEvents(); _eventsManager->_mouseFl = false; - _globals.iRegul = 1; + _globals->iRegul = 1; _eventsManager->refreshScreenAndEvents(); _soundManager.playSound(16); _animationManager->_clearAnimationFl = true; @@ -1648,7 +1649,7 @@ void HopkinsEngine::playIntro() { for (int i = 0; i <= 4; i++) _eventsManager->refreshScreenAndEvents(); - _globals.iRegul = 1; + _globals->iRegul = 1; _graphicsManager.fadeInLong(); if (_graphicsManager._largeScreenFl) { _graphicsManager._scrollStatus = 2; @@ -1693,9 +1694,9 @@ void HopkinsEngine::playIntro() { for (int i = 0; i <= 4; i++) _eventsManager->refreshScreenAndEvents(); - _globals.iRegul = 1; + _globals->iRegul = 1; _graphicsManager.fadeInLong(); - for (uint i = 0; i < 200 / _globals._speed; ++i) + for (uint i = 0; i < 200 / _globals->_speed; ++i) _eventsManager->refreshScreenAndEvents(); _objectsManager.setBobAnimation(3); @@ -1735,7 +1736,7 @@ void HopkinsEngine::playIntro() { for (int i = 0; i <= 3; i++) _eventsManager->refreshScreenAndEvents(); - _globals.iRegul = 1; + _globals->iRegul = 1; _graphicsManager.setPaletteVGA256WithRefresh(paletteData2, _graphicsManager._vesaBuffer); int introIndex = 0; @@ -1768,24 +1769,24 @@ void HopkinsEngine::playIntro() { introIndex += 2; if (introIndex > 15) { _graphicsManager.setPaletteVGA256WithRefresh(paletteData, _graphicsManager._vesaBuffer); - for (uint j = 1; j < 100 / _globals._speed; ++j) + for (uint j = 1; j < 100 / _globals->_speed; ++j) _eventsManager->refreshScreenAndEvents(); _objectsManager.setBobAnimation(3); _soundManager.mixVoice(7, 3); _objectsManager.stopBobAnimation(3); - for (uint k = 1; k < 60 / _globals._speed; ++k) + for (uint k = 1; k < 60 / _globals->_speed; ++k) _eventsManager->refreshScreenAndEvents(); _objectsManager.setBobAnimation(5); - for (uint l = 0; l < 20 / _globals._speed; ++l) + for (uint l = 0; l < 20 / _globals->_speed; ++l) _eventsManager->refreshScreenAndEvents(); Common::copy(&paletteData2[0], &paletteData2[PALETTE_BLOCK_SIZE], &_graphicsManager._palette[0]); _graphicsManager.setPaletteVGA256WithRefresh(_graphicsManager._palette, _graphicsManager._vesaBuffer); - for (uint m = 0; m < 50 / _globals._speed; ++m) { - if (m == 30 / _globals._speed) { + for (uint m = 0; m < 50 / _globals->_speed; ++m) { + if (m == 30 / _globals->_speed) { _objectsManager.setBobAnimation(3); _soundManager.mixVoice(8, 3); _objectsManager.stopBobAnimation(3); @@ -1829,7 +1830,7 @@ void HopkinsEngine::displayNotAvailable() { if (!getIsDemo()) return; - if (_globals._language == LANG_FR) + if (_globals->_language == LANG_FR) _graphicsManager.loadImage("ndfr"); else _graphicsManager.loadImage("nduk"); @@ -1841,19 +1842,19 @@ void HopkinsEngine::displayNotAvailable() { _soundManager.mixVoice(628, 4); _graphicsManager.fadeOutLong(); - _globals._exitId = 4; + _globals->_exitId = 4; } void HopkinsEngine::handleNotAvailable(int sortie) { // Use the code of the linux demo instead of the code of the Windows demo. // The behavior is somewhat better, and common code is easier to maintain. displayNotAvailable(); - _globals._exitId = sortie; + _globals->_exitId = sortie; } void HopkinsEngine::displayEndDemo() { _soundManager.playSound(28); - if (_globals._language == LANG_FR) + if (_globals->_language == LANG_FR) _graphicsManager.loadImage("endfr"); else _graphicsManager.loadImage("enduk"); @@ -1861,7 +1862,7 @@ void HopkinsEngine::displayEndDemo() { _graphicsManager.fadeInLong(); _eventsManager->delay(1500); _graphicsManager.fadeOutLong(); - _globals._exitId = 0; + _globals->_exitId = 0; } void HopkinsEngine::bombExplosion() { @@ -1872,7 +1873,7 @@ void HopkinsEngine::bombExplosion() { _graphicsManager.unlockScreen(); _graphicsManager.clearPalette(); - _globals.iRegul = 1; + _globals->iRegul = 1; _soundManager._specialSoundNum = 199; _graphicsManager.FADE_LINUX = 2; _animationManager->playAnim("BOMBE2A.ANM", 50, 14, 500); @@ -1893,9 +1894,9 @@ void HopkinsEngine::bombExplosion() { _eventsManager->refreshScreenAndEvents(); } - _globals._introSpeechOffFl = true; + _globals->_introSpeechOffFl = true; _talkManager.startStaticCharacterDialogue("vire.pe2"); - _globals._introSpeechOffFl = false; + _globals->_introSpeechOffFl = false; _objectsManager.setBobAnimation(7); for (int idx = 0; idx < 100; ++idx) { @@ -1904,8 +1905,8 @@ void HopkinsEngine::bombExplosion() { _graphicsManager.fadeOutLong(); _graphicsManager.endDisplayBob(); - _globals.iRegul = 0; - _globals._exitId = 151; + _globals->iRegul = 0; + _globals->_exitId = 151; } void HopkinsEngine::restoreSystem() { @@ -1914,11 +1915,11 @@ void HopkinsEngine::restoreSystem() { } void HopkinsEngine::endLinuxDemo() { - _globals._linuxEndDemoFl = true; + _globals->_linuxEndDemoFl = true; _graphicsManager.resetDirtyRects(); _objectsManager._forestFl = false; _eventsManager->_breakoutFl = false; - _globals._disableInventFl = true; + _globals->_disableInventFl = true; _graphicsManager.loadImage("BOX"); _soundManager.playSound(28); _graphicsManager.fadeInLong(); @@ -1943,8 +1944,8 @@ void HopkinsEngine::endLinuxDemo() { } void HopkinsEngine::handleConflagration() { - _globals._disableInventFl = true; - _globals.iRegul = 1; + _globals->_disableInventFl = true; + _globals->iRegul = 1; _graphicsManager.loadImage("IM71"); _animationManager->loadAnim("ANIM71"); _graphicsManager.SETCOLOR3(252, 100, 100, 100); @@ -1957,26 +1958,26 @@ void HopkinsEngine::handleConflagration() { _eventsManager->refreshScreenAndEvents(); _graphicsManager.fadeInLong(); - _globals.iRegul = 1; + _globals->iRegul = 1; for (int cpt = 0; cpt <= 249; cpt++) _eventsManager->refreshScreenAndEvents(); - _globals._introSpeechOffFl = true; + _globals->_introSpeechOffFl = true; _talkManager.startAnimatedCharacterDialogue("SVGARD1.pe2"); - _globals._introSpeechOffFl = false; + _globals->_introSpeechOffFl = false; for (int cpt = 0; cpt <= 49; cpt++) _eventsManager->refreshScreenAndEvents(); _graphicsManager.fadeOutLong(); _graphicsManager.endDisplayBob(); - _globals._saveData->_data[svBaseFireFl] = 1; - _globals._disableInventFl = false; + _globals->_saveData->_data[svBaseFireFl] = 1; + _globals->_disableInventFl = false; } void HopkinsEngine::playSubmarineCutscene() { - _globals.iRegul = 1; + _globals->iRegul = 1; _graphicsManager._lineNbr = SCREEN_WIDTH; _graphicsManager.lockScreen(); _graphicsManager.clearScreen(); @@ -2013,7 +2014,7 @@ void HopkinsEngine::playSubmarineCutscene() { _eventsManager->_escKeyFl = false; _animationManager->_clearAnimationFl = false; - _globals._exitId = 85; + _globals->_exitId = 85; } void HopkinsEngine::playUnderwaterBaseCutscene() { @@ -2023,8 +2024,8 @@ void HopkinsEngine::playUnderwaterBaseCutscene() { _graphicsManager.clearPalette(); _animationManager->NO_SEQ = false; _soundManager.playSound(26); - _globals.iRegul = 1; - _globals._disableInventFl = true; + _globals->iRegul = 1; + _globals->_disableInventFl = true; _animationManager->NO_COUL = true; _graphicsManager.FADE_LINUX = 2; _animationManager->playSequence("abase.seq", 50, 15, 50); @@ -2038,7 +2039,7 @@ void HopkinsEngine::playUnderwaterBaseCutscene() { _eventsManager->refreshScreenAndEvents(); _graphicsManager.fadeInLong(); - _globals.enableHiding(); + _globals->enableHiding(); do _eventsManager->refreshScreenAndEvents(); @@ -2046,23 +2047,23 @@ void HopkinsEngine::playUnderwaterBaseCutscene() { _graphicsManager.fadeOutLong(); _graphicsManager.endDisplayBob(); - _globals.resetHidingItems(); - _globals._disableInventFl = false; - _globals._exitId = 93; - _globals.iRegul = 0; + _globals->resetHidingItems(); + _globals->_disableInventFl = false; + _globals->_exitId = 93; + _globals->iRegul = 0; } void HopkinsEngine::playEnding() { - _globals.PERSO = _globals.freeMemory(_globals.PERSO); + _globals->PERSO = _globals->freeMemory(_globals->PERSO); _dialogsManager->_removeInventFl = true; - _globals._disableInventFl = true; + _globals->_disableInventFl = true; _graphicsManager._scrollOffset = 0; - _globals._cityMapEnabledFl = false; - _globals.iRegul = 1; + _globals->_cityMapEnabledFl = false; + _globals->iRegul = 1; _soundManager.playSound(26); _linesManager._route = (RouteItem *)g_PTRNUL; - _globals._freezeCharacterFl = true; - _globals._exitId = 0; + _globals->_freezeCharacterFl = true; + _globals->_exitId = 0; _soundManager.loadSample(1, "SOUND90.WAV"); _graphicsManager.loadImage("IM100"); _animationManager->loadAnim("ANIM100"); @@ -2081,15 +2082,15 @@ void HopkinsEngine::playEnding() { _eventsManager->refreshScreenAndEvents(); _graphicsManager.fadeInLong(); - _globals.iRegul = 1; + _globals->iRegul = 1; do _eventsManager->refreshScreenAndEvents(); while (_objectsManager.getBobAnimDataIdx(6) != 54); - _globals._introSpeechOffFl = true; + _globals->_introSpeechOffFl = true; _talkManager.startAnimatedCharacterDialogue("GM4.PE2"); - _globals._disableInventFl = true; + _globals->_disableInventFl = true; _objectsManager.stopBobAnimation(6); _objectsManager.stopBobAnimation(10); _objectsManager.setBobAnimation(9); @@ -2105,23 +2106,23 @@ void HopkinsEngine::playEnding() { _eventsManager->refreshScreenAndEvents(); while (_objectsManager.getBobAnimDataIdx(7) != 65); - _globals._introSpeechOffFl = true; + _globals->_introSpeechOffFl = true; _talkManager.startAnimatedCharacterDialogue("DUELB4.PE2"); _eventsManager->mouseOff(); - _globals._disableInventFl = true; + _globals->_disableInventFl = true; do _eventsManager->refreshScreenAndEvents(); while (_objectsManager.getBobAnimDataIdx(7) != 72); - _globals._introSpeechOffFl = true; + _globals->_introSpeechOffFl = true; _talkManager.startAnimatedCharacterDialogue("DUELH1.PE2"); do _eventsManager->refreshScreenAndEvents(); while (_objectsManager.getBobAnimDataIdx(7) != 81); - _globals._introSpeechOffFl = true; + _globals->_introSpeechOffFl = true; _talkManager.startAnimatedCharacterDialogue("DUELB5.PE2"); do @@ -2129,7 +2130,7 @@ void HopkinsEngine::playEnding() { while (_objectsManager.getBobAnimDataIdx(7) != 120); _objectsManager.stopBobAnimation(7); - if (_globals._saveData->_data[svGameWonFl] == 1) { + if (_globals->_saveData->_data[svGameWonFl] == 1) { _soundManager._specialSoundNum = 200; _soundManager._skipRefreshFl = true; _graphicsManager.FADE_LINUX = 2; @@ -2143,11 +2144,11 @@ void HopkinsEngine::playEnding() { if (!_eventsManager->_escKeyFl) { do _eventsManager->refreshEvents(); - while (_eventsManager->_rateCounter < 2000 / _globals._speed && !_eventsManager->_escKeyFl); + while (_eventsManager->_rateCounter < 2000 / _globals->_speed && !_eventsManager->_escKeyFl); } _eventsManager->_escKeyFl = false; _graphicsManager.fadeOutLong(); - _globals.iRegul = 1; + _globals->iRegul = 1; _soundManager._specialSoundNum = 0; _graphicsManager.FADE_LINUX = 2; _animationManager->playAnim("JOUR2A.anm", 12, 12, 1000); @@ -2162,19 +2163,19 @@ void HopkinsEngine::playEnding() { _animationManager->playAnim("FF1a.anm", 9, 18, 9); _animationManager->playAnim("FF2a.anm", 24, 24, 100); displayCredits(); - _globals.iRegul = 0; - _globals._exitId = 300; + _globals->iRegul = 0; + _globals->_exitId = 300; _dialogsManager->_removeInventFl = false; - _globals._disableInventFl = false; + _globals->_disableInventFl = false; } else { _soundManager._specialSoundNum = 200; _soundManager._skipRefreshFl = true; _animationManager->playAnim2("BERM.ANM", 100, 24, 300); _objectsManager.stopBobAnimation(7); _objectsManager.setBobAnimation(8); - _globals._introSpeechOffFl = true; + _globals->_introSpeechOffFl = true; _talkManager.startAnimatedCharacterDialogue("GM5.PE2"); - _globals._disableInventFl = true; + _globals->_disableInventFl = true; do _eventsManager->refreshScreenAndEvents(); @@ -2190,22 +2191,22 @@ void HopkinsEngine::playEnding() { _graphicsManager.endDisplayBob(); _soundManager.removeSample(1); _soundManager.playSound(16); - _globals.iRegul = 1; + _globals->iRegul = 1; _soundManager._specialSoundNum = 0; _dialogsManager->_removeInventFl = false; - _globals._disableInventFl = false; + _globals->_disableInventFl = false; _animationManager->playAnim("JOUR4A.anm", 12, 12, 1000); - _globals.iRegul = 0; - _globals._exitId = 300; + _globals->iRegul = 0; + _globals->_exitId = 300; } - _globals.PERSO = _fileManager->loadFile("PERSO.SPR"); - _globals._characterType = 0; - _globals.iRegul = 0; + _globals->PERSO = _fileManager->loadFile("PERSO.SPR"); + _globals->_characterType = 0; + _globals->iRegul = 0; } void HopkinsEngine::playPlaneCutscene() { _soundManager.playSound(28); - _globals.iRegul = 1; + _globals->iRegul = 1; _graphicsManager.lockScreen(); _graphicsManager.clearScreen(); _graphicsManager.unlockScreen(); @@ -2293,7 +2294,7 @@ void HopkinsEngine::drawBaseMap() { } int HopkinsEngine::handleBaseMap() { - _globals._disableInventFl = true; + _globals->_disableInventFl = true; // Load the map image loadBaseMap(); @@ -2335,10 +2336,10 @@ int HopkinsEngine::handleBaseMap() { zone = 6; if (zone) { _eventsManager->changeMouseCursor(4); - _globals._baseMapColor += 25; - if (_globals._baseMapColor > 100) - _globals._baseMapColor = 0; - _graphicsManager.SETCOLOR4(251, _globals._baseMapColor, _globals._baseMapColor, _globals._baseMapColor); + _globals->_baseMapColor += 25; + if (_globals->_baseMapColor > 100) + _globals->_baseMapColor = 0; + _graphicsManager.SETCOLOR4(251, _globals->_baseMapColor, _globals->_baseMapColor, _globals->_baseMapColor); } else { _eventsManager->changeMouseCursor(0); _graphicsManager.SETCOLOR4(251, 100, 100, 100); @@ -2348,7 +2349,7 @@ int HopkinsEngine::handleBaseMap() { loopCond = true; } while (!loopCond); - _globals._disableInventFl = false; + _globals->_disableInventFl = false; _graphicsManager.fadeOutLong(); int result; @@ -2379,10 +2380,10 @@ int HopkinsEngine::handleBaseMap() { } void HopkinsEngine::loadCredits() { - _globals._creditsPosY = 440; - _globals._creditsStep = 45; + _globals->_creditsPosY = 440; + _globals->_creditsStep = 45; byte *bufPtr; - switch (_globals._language) { + switch (_globals->_language) { case LANG_EN: bufPtr = _fileManager->loadFile("CREAN.TXT"); break; @@ -2406,28 +2407,28 @@ void HopkinsEngine::loadCredits() { loopCond = true; break; } - _globals._creditsItem[idxLines]._color = curPtr[1]; - _globals._creditsItem[idxLines]._actvFl = true; - _globals._creditsItem[idxLines]._linePosY = _globals._creditsPosY + idxLines * _globals._creditsStep; + _globals->_creditsItem[idxLines]._color = curPtr[1]; + _globals->_creditsItem[idxLines]._actvFl = true; + _globals->_creditsItem[idxLines]._linePosY = _globals->_creditsPosY + idxLines * _globals->_creditsStep; int idxBuf = 0; for(; idxBuf < 49; idxBuf++) { byte curChar = curPtr[idxBuf + 3]; if (curChar == '%' || curChar == 10) break; - _globals._creditsItem[idxLines]._line[idxBuf] = curChar; + _globals->_creditsItem[idxLines]._line[idxBuf] = curChar; } - _globals._creditsItem[idxLines]._line[idxBuf] = 0; - _globals._creditsItem[idxLines]._lineSize = idxBuf - 1; + _globals->_creditsItem[idxLines]._line[idxBuf] = 0; + _globals->_creditsItem[idxLines]._lineSize = idxBuf - 1; curPtr = curPtr + idxBuf + 2; ++idxLines; } else { curPtr++; } - _globals._creditsLineNumb = idxLines; + _globals->_creditsLineNumb = idxLines; } while (!loopCond); - _globals.freeMemory(bufPtr); + _globals->freeMemory(bufPtr); } void HopkinsEngine::displayCredits(int startPosY, byte *buffer, char color) { @@ -2444,20 +2445,20 @@ void HopkinsEngine::displayCredits(int startPosY, byte *buffer, char color) { int startPosX = 320 - strWidth / 2; int endPosX = strWidth + startPosX; int endPosY = startPosY + 12; - if ((_globals._creditsStartX == -1) && (_globals._creditsEndX == -1) && (_globals._creditsStartY == -1) && (_globals._creditsEndY == -1)) { - _globals._creditsStartX = startPosX; - _globals._creditsEndX = endPosX; - _globals._creditsStartY = startPosY; - _globals._creditsEndY = endPosY; + if ((_globals->_creditsStartX == -1) && (_globals->_creditsEndX == -1) && (_globals->_creditsStartY == -1) && (_globals->_creditsEndY == -1)) { + _globals->_creditsStartX = startPosX; + _globals->_creditsEndX = endPosX; + _globals->_creditsStartY = startPosY; + _globals->_creditsEndY = endPosY; } - if (startPosX < _globals._creditsStartX) - _globals._creditsStartX = startPosX; - if (endPosX > _globals._creditsEndX) - _globals._creditsEndX = endPosX; - if (_globals._creditsStartY > startPosY) - _globals._creditsStartY = startPosY; - if (endPosY > _globals._creditsEndY) - _globals._creditsEndY = endPosY; + if (startPosX < _globals->_creditsStartX) + _globals->_creditsStartX = startPosX; + if (endPosX > _globals->_creditsEndX) + _globals->_creditsEndX = endPosX; + if (_globals->_creditsStartY > startPosY) + _globals->_creditsStartY = startPosY; + if (endPosY > _globals->_creditsEndY) + _globals->_creditsEndY = endPosY; bufPtr = buffer; for (;;) { @@ -2473,23 +2474,23 @@ void HopkinsEngine::displayCredits(int startPosY, byte *buffer, char color) { void HopkinsEngine::displayCredits() { loadCredits(); - _globals._creditsPosY = 436; + _globals->_creditsPosY = 436; _graphicsManager.loadImage("GENERIC"); _graphicsManager.fadeInLong(); _soundManager.playSound(28); _eventsManager->_mouseFl = false; - _globals.iRegul = 3; - _globals._creditsStartX = _globals._creditsEndX = _globals._creditsStartY = _globals._creditsEndY = -1; + _globals->iRegul = 3; + _globals->_creditsStartX = _globals->_creditsEndX = _globals->_creditsStartY = _globals->_creditsEndY = -1; int soundId = 28; do { - for (int i = 0; i < _globals._creditsLineNumb; ++i) { - if (_globals._creditsItem[i]._actvFl) { - int nextY = _globals._creditsPosY + i * _globals._creditsStep; - _globals._creditsItem[i]._linePosY = nextY; + for (int i = 0; i < _globals->_creditsLineNumb; ++i) { + if (_globals->_creditsItem[i]._actvFl) { + int nextY = _globals->_creditsPosY + i * _globals->_creditsStep; + _globals->_creditsItem[i]._linePosY = nextY; if ((nextY - 21 >= 0) && (nextY - 21 <= 418)) { int col = 0; - switch (_globals._creditsItem[i]._color) { + switch (_globals->_creditsItem[i]._color) { case '1': col = 163; break; @@ -2504,32 +2505,32 @@ void HopkinsEngine::displayCredits() { col = 163; break; } - if (_globals._creditsItem[i]._lineSize != -1) - displayCredits(nextY, _globals._creditsItem[i]._line, col); + if (_globals->_creditsItem[i]._lineSize != -1) + displayCredits(nextY, _globals->_creditsItem[i]._line, col); } } } - --_globals._creditsPosY; - if (_globals._creditsStartX != -1 || _globals._creditsEndX != -1 || _globals._creditsStartY != -1 || _globals._creditsEndY != -1) { + --_globals->_creditsPosY; + if (_globals->_creditsStartX != -1 || _globals->_creditsEndX != -1 || _globals->_creditsStartY != -1 || _globals->_creditsEndY != -1) { _eventsManager->refreshScreenAndEvents(); _graphicsManager.copySurface(_graphicsManager._vesaScreen, 60, 50, 520, 380, _graphicsManager._vesaBuffer, 60, 50); } else { _eventsManager->refreshScreenAndEvents(); } - if (_globals._creditsItem[_globals._creditsLineNumb - 1]._linePosY <= 39) { - _globals._creditsPosY = 440; + if (_globals->_creditsItem[_globals->_creditsLineNumb - 1]._linePosY <= 39) { + _globals->_creditsPosY = 440; ++soundId; if (soundId > 31) soundId = 28; _soundManager.playSound(soundId); } - _globals._creditsStartX = -1; - _globals._creditsEndX = -1; - _globals._creditsStartY = -1; - _globals._creditsEndY = -1; + _globals->_creditsStartX = -1; + _globals->_creditsEndX = -1; + _globals->_creditsStartY = -1; + _globals->_creditsEndY = -1; } while ((_eventsManager->getMouseButton() != 1) && (!shouldQuit())); _graphicsManager.fadeOutLong(); - _globals.iRegul = 1; + _globals->iRegul = 1; _eventsManager->_mouseFl = true; } @@ -2548,29 +2549,29 @@ void HopkinsEngine::handleOceanMouseEvents() { int oldX; switch (_objectsManager._zoneNum) { case 1: - switch (_globals._oceanDirection) { + switch (_globals->_oceanDirection) { case DIR_UP: - _objectsManager.SPACTION(_globals.PERSO, "27,26,25,24,23,22,21,20,19,18,-1,", 6, false); + _objectsManager.SPACTION(_globals->PERSO, "27,26,25,24,23,22,21,20,19,18,-1,", 6, false); break; case DIR_RIGHT: - _objectsManager.SPACTION(_globals.PERSO, "0,1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16,17,-1,", 6, false); + _objectsManager.SPACTION(_globals->PERSO, "0,1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16,17,-1,", 6, false); break; case DIR_DOWN: - _objectsManager.SPACTION(_globals.PERSO, "9,10,11,12,13,14,15,16,17,18,-1,", 6, false); + _objectsManager.SPACTION(_globals->PERSO, "9,10,11,12,13,14,15,16,17,18,-1,", 6, false); break; default: break; } - _globals._oceanDirection = DIR_LEFT; - _globals._exitId = 1; + _globals->_oceanDirection = DIR_LEFT; + _globals->_exitId = 1; oldX = _objectsManager.getSpriteX(0); for (;;) { - if (_globals._speed == 1) + if (_globals->_speed == 1) oldX -= 2; - else if (_globals._speed == 2) + else if (_globals->_speed == 2) oldX -= 4; - else if (_globals._speed == 3) + else if (_globals->_speed == 3) oldX -= 6; _objectsManager.setSpriteX(0, oldX); setSubmarineSprites(); @@ -2585,28 +2586,28 @@ void HopkinsEngine::handleOceanMouseEvents() { } break; case 2: - switch (_globals._oceanDirection) { + switch (_globals->_oceanDirection) { case DIR_UP: - _objectsManager.SPACTION(_globals.PERSO, "27,28,29,30,31,32,33,34,35,36,-1,", 6, false); + _objectsManager.SPACTION(_globals->PERSO, "27,28,29,30,31,32,33,34,35,36,-1,", 6, false); break; case DIR_DOWN: - _objectsManager.SPACTION(_globals.PERSO, "9,8,7,6,5,4,3,2,1,0,-1,", 6, false); + _objectsManager.SPACTION(_globals->PERSO, "9,8,7,6,5,4,3,2,1,0,-1,", 6, false); break; case DIR_LEFT: - _objectsManager.SPACTION(_globals.PERSO, "18,19,20,21,22,23,24,25,26,27,28,29,30,31,32,33,34,35,36,-1,", 6, false); + _objectsManager.SPACTION(_globals->PERSO, "18,19,20,21,22,23,24,25,26,27,28,29,30,31,32,33,34,35,36,-1,", 6, false); break; default: break; } - _globals._oceanDirection = DIR_RIGHT; - _globals._exitId = 2; + _globals->_oceanDirection = DIR_RIGHT; + _globals->_exitId = 2; oldX = _objectsManager.getSpriteX(0); for (;;) { - if (_globals._speed == 1) + if (_globals->_speed == 1) oldX += 2; - else if (_globals._speed == 2) + else if (_globals->_speed == 2) oldX += 4; - else if (_globals._speed == 3) + else if (_globals->_speed == 3) oldX += 6; _objectsManager.setSpriteX(0, oldX); setSubmarineSprites(); @@ -2620,15 +2621,15 @@ void HopkinsEngine::handleOceanMouseEvents() { } break; case 3: - switch (_globals._oceanDirection) { + switch (_globals->_oceanDirection) { case DIR_RIGHT: oldX = _objectsManager.getSpriteX(0); do { - if (_globals._speed == 1) + if (_globals->_speed == 1) oldX += 2; - else if (_globals._speed == 2) + else if (_globals->_speed == 2) oldX += 4; - else if (_globals._speed == 3) + else if (_globals->_speed == 3) oldX += 6; _objectsManager.setSpriteX(0, oldX); setSubmarineSprites(); @@ -2639,19 +2640,19 @@ void HopkinsEngine::handleOceanMouseEvents() { } } while (oldX <= 235); if (!displAnim) - _objectsManager.SPACTION(_globals.PERSO, "36,35,34,33,32,31,30,29,28,27,-1,", 6, false); + _objectsManager.SPACTION(_globals->PERSO, "36,35,34,33,32,31,30,29,28,27,-1,", 6, false); break; case DIR_DOWN: - _objectsManager.SPACTION(_globals.PERSO, "9,10,11,12,13,14,15,16,17,18,19,20,21,22,23,24,25,26,27,-1,", 6, false); + _objectsManager.SPACTION(_globals->PERSO, "9,10,11,12,13,14,15,16,17,18,19,20,21,22,23,24,25,26,27,-1,", 6, false); break; case DIR_LEFT: oldX = _objectsManager.getSpriteX(0); do { - if (_globals._speed == 1) + if (_globals->_speed == 1) oldX -= 2; - else if (_globals._speed == 2) + else if (_globals->_speed == 2) oldX -= 4; - else if (_globals._speed == 3) + else if (_globals->_speed == 3) oldX -= 6; _objectsManager.setSpriteX(0, oldX); setSubmarineSprites(); @@ -2662,27 +2663,27 @@ void HopkinsEngine::handleOceanMouseEvents() { } } while (oldX > 236); if (!displAnim) - _objectsManager.SPACTION(_globals.PERSO, "18,19,20,21,22,23,24,25,26,27,-1,", 6, false); + _objectsManager.SPACTION(_globals->PERSO, "18,19,20,21,22,23,24,25,26,27,-1,", 6, false); break; default: break; } - _globals._oceanDirection = DIR_UP; - _globals._exitId = 3; + _globals->_oceanDirection = DIR_UP; + _globals->_exitId = 3; break; case 4: - switch (_globals._oceanDirection) { + switch (_globals->_oceanDirection) { case DIR_UP: - _objectsManager.SPACTION(_globals.PERSO, "27,26,25,24,23,22,21,20,19,18,17,16,15,14,13,12,11,10,9,-1,", 6, false); + _objectsManager.SPACTION(_globals->PERSO, "27,26,25,24,23,22,21,20,19,18,17,16,15,14,13,12,11,10,9,-1,", 6, false); break; case DIR_RIGHT: oldX = _objectsManager.getSpriteX(0); do { - if (_globals._speed == 1) + if (_globals->_speed == 1) oldX += 2; - else if (_globals._speed == 2) + else if (_globals->_speed == 2) oldX += 4; - else if (_globals._speed == 3) + else if (_globals->_speed == 3) oldX += 6; _objectsManager.setSpriteX(0, oldX); setSubmarineSprites(); @@ -2693,16 +2694,16 @@ void HopkinsEngine::handleOceanMouseEvents() { } } while (oldX <= 235); if (!displAnim) - _objectsManager.SPACTION(_globals.PERSO, "0,1,2,3,4,5,6,7,8,9,-1,", 6, false); + _objectsManager.SPACTION(_globals->PERSO, "0,1,2,3,4,5,6,7,8,9,-1,", 6, false); break; case DIR_LEFT: oldX = _objectsManager.getSpriteX(0); for (;;) { - if (_globals._speed == 1) + if (_globals->_speed == 1) oldX -= 2; - else if (_globals._speed == 2) + else if (_globals->_speed == 2) oldX -= 4; - else if (_globals._speed == 3) + else if (_globals->_speed == 3) oldX -= 6; _objectsManager.setSpriteX(0, oldX); setSubmarineSprites(); @@ -2712,7 +2713,7 @@ void HopkinsEngine::handleOceanMouseEvents() { if (oldX <= 236) { if (!displAnim) - _objectsManager.SPACTION(_globals.PERSO, "18,17,16,15,14,13,12,11,10,9,-1,", 6, false); + _objectsManager.SPACTION(_globals->PERSO, "18,17,16,15,14,13,12,11,10,9,-1,", 6, false); break; } } @@ -2720,14 +2721,14 @@ void HopkinsEngine::handleOceanMouseEvents() { default: break; } - _globals._oceanDirection = DIR_DOWN; - _globals._exitId = 4; + _globals->_oceanDirection = DIR_DOWN; + _globals->_exitId = 4; break; } } void HopkinsEngine::setSubmarineSprites() { - switch (_globals._oceanDirection) { + switch (_globals->_oceanDirection) { case DIR_UP: _objectsManager.setSpriteIndex(0, 27); break; @@ -2746,13 +2747,13 @@ void HopkinsEngine::setSubmarineSprites() { } void HopkinsEngine::handleOceanMaze(int16 curExitId, Common::String backgroundFilename, Directions defaultDirection, int16 exit1, int16 exit2, int16 exit3, int16 exit4, int16 soundId) { - _globals._cityMapEnabledFl = false; + _globals->_cityMapEnabledFl = false; _graphicsManager._noFadingFl = false; - _globals._freezeCharacterFl = false; - _globals._exitId = 0; - _globals._disableInventFl = true; + _globals->_freezeCharacterFl = false; + _globals->_exitId = 0; + _globals->_disableInventFl = true; _soundManager.playSound(soundId); - _globals.PERSO = _fileManager->loadFile("VAISSEAU.SPR"); + _globals->PERSO = _fileManager->loadFile("VAISSEAU.SPR"); if (backgroundFilename.size()) _graphicsManager.loadImage(backgroundFilename); @@ -2774,10 +2775,10 @@ void HopkinsEngine::handleOceanMaze(int16 curExitId, Common::String backgroundFi if (!exit4) _linesManager.disableZone(4); - if (!_globals._oceanDirection) - _globals._oceanDirection = defaultDirection; + if (!_globals->_oceanDirection) + _globals->_oceanDirection = defaultDirection; - switch (_globals._oceanDirection) { + switch (_globals->_oceanDirection) { case DIR_UP: _objectsManager._characterPos.x = 236; _objectsManager._startSpriteIndex = 27; @@ -2798,7 +2799,7 @@ void HopkinsEngine::handleOceanMaze(int16 curExitId, Common::String backgroundFi break; } - _objectsManager.addStaticSprite(_globals.PERSO, Common::Point(_objectsManager._characterPos.x, 110), 0, _objectsManager._startSpriteIndex, 0, false, 0, 0); + _objectsManager.addStaticSprite(_globals->PERSO, Common::Point(_objectsManager._characterPos.x, 110), 0, _objectsManager._startSpriteIndex, 0, false, 0, 0); _graphicsManager.SETCOLOR3(252, 100, 100, 100); _graphicsManager.SETCOLOR3(253, 100, 100, 100); _graphicsManager.SETCOLOR3(251, 100, 100, 100); @@ -2814,7 +2815,7 @@ void HopkinsEngine::handleOceanMaze(int16 curExitId, Common::String backgroundFi if (!_graphicsManager._noFadingFl) _graphicsManager.fadeInLong(); _graphicsManager._noFadingFl = false; - _globals.iRegul = 1; + _globals->iRegul = 1; for (;;) { int mouseButton = _eventsManager->getMouseButton(); @@ -2824,23 +2825,23 @@ void HopkinsEngine::handleOceanMaze(int16 curExitId, Common::String backgroundFi setSubmarineSprites(); _eventsManager->refreshScreenAndEvents(); - if (_globals._exitId || shouldQuit()) + if (_globals->_exitId || shouldQuit()) break; } - if (_globals._exitId == 1) - _globals._exitId = exit1; - else if (_globals._exitId == 2) - _globals._exitId = exit2; - else if (_globals._exitId == 3) - _globals._exitId = exit3; - else if (_globals._exitId == 4) - _globals._exitId = exit4; + if (_globals->_exitId == 1) + _globals->_exitId = exit1; + else if (_globals->_exitId == 2) + _globals->_exitId = exit2; + else if (_globals->_exitId == 3) + _globals->_exitId = exit3; + else if (_globals->_exitId == 4) + _globals->_exitId = exit4; _graphicsManager.fadeOutLong(); _objectsManager.removeSprite(0); _objectsManager.clearScreen(); - _globals.PERSO = _fileManager->loadFile("PERSO.SPR"); - _globals._characterType = 0; + _globals->PERSO = _fileManager->loadFile("PERSO.SPR"); + _globals->_characterType = 0; } void HopkinsEngine::syncSoundSettings() { @@ -2859,8 +2860,8 @@ bool HopkinsEngine::displayAdultDisclaimer() { _graphicsManager._maxY = SCREEN_HEIGHT - 1; _eventsManager->_breakoutFl = false; _objectsManager._forestFl = false; - _globals._disableInventFl = true; - _globals._exitId = 0; + _globals->_disableInventFl = true; + _globals->_exitId = 0; _graphicsManager.loadImage("ADULT"); _graphicsManager.fadeInLong(); @@ -2882,7 +2883,7 @@ bool HopkinsEngine::displayAdultDisclaimer() { _eventsManager->refreshScreenAndEvents(); } while (!shouldQuit() && (buttonIndex == 0 || _eventsManager->getMouseButton() != 1)); - _globals._disableInventFl = false; + _globals->_disableInventFl = false; _graphicsManager.fadeOutLong(); if (buttonIndex != 2) { |