diff options
Diffstat (limited to 'engines/hopkins/hopkins.cpp')
-rw-r--r-- | engines/hopkins/hopkins.cpp | 43 |
1 files changed, 23 insertions, 20 deletions
diff --git a/engines/hopkins/hopkins.cpp b/engines/hopkins/hopkins.cpp index 407f264116..96131f2968 100644 --- a/engines/hopkins/hopkins.cpp +++ b/engines/hopkins/hopkins.cpp @@ -35,12 +35,9 @@ namespace Hopkins { -HopkinsEngine *g_vm; - HopkinsEngine::HopkinsEngine(OSystem *syst, const HopkinsGameDescription *gameDesc) : Engine(syst), _gameDescription(gameDesc), _randomSource("Hopkins") { DebugMan.addDebugChannel(kDebugPath, "Path", "Pathfinding debug level"); - g_vm = this; _animMan = new AnimationManager(this); _computer = new ComputerManager(this); _dialog = new DialogsManager(this); @@ -95,7 +92,7 @@ bool HopkinsEngine::canLoadGameStateCurrently() { * Returns true if it is currently okay to save the game */ bool HopkinsEngine::canSaveGameStateCurrently() { - return !_globals->_exitId && !_globals->_cityMapEnabledFl && _events->_mouseFl + return !_globals->_exitId && !_globals->_cityMapEnabledFl && _events->_mouseFl && _globals->_curRoomNum != 0 && !isUnderwaterSubScene(); } @@ -114,8 +111,6 @@ Common::Error HopkinsEngine::saveGameState(int slot, const Common::String &desc) } Common::Error HopkinsEngine::run() { - _saveLoad->initSaves(); - _globals->setConfig(); _fileIO->initCensorship(); initializeSystem(); @@ -164,7 +159,7 @@ bool HopkinsEngine::runWin95Demo() { _globals->_speed = 3; if (_startGameSlot == -1) - _graphicsMan->fadeOutLong(); + _graphicsMan->fadeOutShort(); _globals->_eventMode = EVENTMODE_IGNORE; _globals->_characterSpriteBuf = _fileIO->loadFile("PERSO.SPR"); @@ -201,12 +196,15 @@ bool HopkinsEngine::runWin95Demo() { switch (_globals->_exitId) { case 1: + // Handles room: Apartment _linesMan->setMaxLineIdx(40); _globals->_characterMaxPosY = 435; _objectsMan->sceneControl2("IM01", "IM01", "ANIM01", "IM01", 2, true); break; case 3: + // - Displays bank attack when leaving the apartment + // - Handles room: bottom of the apartment if (!_globals->_saveData->_data[svBankAttackAnimPlayedFl]) { _soundMan->playSound(3); if (getPlatform() == Common::kPlatformOS2 || getPlatform() == Common::kPlatformBeOS) @@ -235,7 +233,7 @@ bool HopkinsEngine::runWin95Demo() { _soundMan->removeSample(2); _soundMan->removeSample(3); _soundMan->removeSample(4); - _graphicsMan->fadeOutLong(); + _graphicsMan->fadeOutShort(); _globals->_saveData->_data[svBankAttackAnimPlayedFl] = 1; } _linesMan->setMaxLineIdx(5); @@ -244,12 +242,14 @@ bool HopkinsEngine::runWin95Demo() { break; case 4: + // Handle room: City map _globals->_disableInventFl = true; _objectsMan->handleCityMap(); _globals->_disableInventFl = false; break; case 5: + // Handle room: Outside the bank _linesMan->setMaxLineIdx(5); _globals->_characterMaxPosY = 455; @@ -793,14 +793,14 @@ bool HopkinsEngine::runFull() { if (_startGameSlot == -1) { if (getPlatform() == Common::kPlatformLinux) { - _graphicsMan->loadImage("H2"); - _graphicsMan->fadeInLong(); - _events->delay(500); - _graphicsMan->fadeOutLong(); - _globals->_speed = 2; - _globals->_eventMode = EVENTMODE_IGNORE; - _graphicsMan->_fadingFl = true; - _animMan->playAnim("MP.ANM", "MP.ANM", 10, 16, 200); + _graphicsMan->loadImage("H2"); + _graphicsMan->fadeInLong(); + _events->delay(500); + _graphicsMan->fadeOutLong(); + _globals->_speed = 2; + _globals->_eventMode = EVENTMODE_IGNORE; + _graphicsMan->_fadingFl = true; + _animMan->playAnim("MP.ANM", "MP.ANM", 10, 16, 200); } else { _animMan->playAnim("MP.ANM", "MP.ANM", 10, 16, 200); _graphicsMan->fadeOutLong(); @@ -1133,12 +1133,14 @@ bool HopkinsEngine::runFull() { break; case 30: + // Shooting _linesMan->setMaxLineIdx(15); _globals->_characterMaxPosY = 440; _objectsMan->sceneControl2("IM30", "IM30", "ANIM30", "IM30", 24, false); break; case 31: + // Shooting target _objectsMan->sceneControl("IM31", "IM31", "ANIM31", "IM31", 10, true); break; @@ -1153,6 +1155,7 @@ bool HopkinsEngine::runFull() { break; case 34: + // In the airport, before the flight cut-scene _objectsMan->sceneControl("IM34", "IM34", "ANIM34", "IM34", 2, false); break; @@ -1183,6 +1186,7 @@ bool HopkinsEngine::runFull() { } case 50: + // Flight cut scene playPlaneCutscene(); _globals->_exitId = 51; break; @@ -1904,10 +1908,7 @@ void HopkinsEngine::bombExplosion() { } void HopkinsEngine::restoreSystem() { - // If the game isn't alerady trying to quit, flag that quitting is needed - if (!shouldQuit()) - quitGame(); - + quitGame(); _events->refreshEvents(); } @@ -2232,6 +2233,8 @@ void HopkinsEngine::playPlaneCutscene() { if (!_events->_escKeyFl) { _graphicsMan->_fadingFl = true; _animMan->playAnim("PARA00A.ANM", "PARA00.ANM", 9, 9, 9); + } else { + _graphicsMan->fadeOutShort(); } _events->_escKeyFl = false; |