diff options
author | Matthew Stewart | 2018-07-25 01:56:40 -0400 |
---|---|---|
committer | Eugene Sandulenko | 2018-08-09 08:37:30 +0200 |
commit | b1fa6126cc0429aaa378550f28d234e06d35a3aa (patch) | |
tree | 9da57528b3721c6841c21bc6115cf00dab404c7f /engines | |
parent | 55725257910d69eec219d12bf68474289526faaa (diff) | |
download | scummvm-rg350-b1fa6126cc0429aaa378550f28d234e06d35a3aa.tar.gz scummvm-rg350-b1fa6126cc0429aaa378550f28d234e06d35a3aa.tar.bz2 scummvm-rg350-b1fa6126cc0429aaa378550f28d234e06d35a3aa.zip |
STARTREK: Link away missions together, temporarily
Diffstat (limited to 'engines')
-rw-r--r-- | engines/startrek/awaymission.cpp | 2 | ||||
-rw-r--r-- | engines/startrek/menu.cpp | 9 | ||||
-rw-r--r-- | engines/startrek/room.cpp | 15 | ||||
-rw-r--r-- | engines/startrek/startrek.cpp | 8 | ||||
-rw-r--r-- | engines/startrek/startrek.h | 1 |
5 files changed, 28 insertions, 7 deletions
diff --git a/engines/startrek/awaymission.cpp b/engines/startrek/awaymission.cpp index 41533d7bb7..c3fe9f732d 100644 --- a/engines/startrek/awaymission.cpp +++ b/engines/startrek/awaymission.cpp @@ -45,7 +45,7 @@ void StarTrekEngine::initAwayMission() { } void StarTrekEngine::runAwayMission() { - while (true) { + while (_gameMode == GAMEMODE_AWAYMISSION && !_resetGameMode) { // Original game manipulates the stack when the room changes to return execution // to this point. Instead of doing that, just check if a variable is set. if (_roomIndexToLoad != -1 && _spawnIndexToLoad != -1) { diff --git a/engines/startrek/menu.cpp b/engines/startrek/menu.cpp index 2251588616..aa9c3ebb82 100644 --- a/engines/startrek/menu.cpp +++ b/engines/startrek/menu.cpp @@ -227,6 +227,7 @@ void StarTrekEngine::showOptionsMenu(int x, int y) { break; case 1: // Load showLoadMenu(); + _resetGameMode = true; break; case 2: // Enable music _sound->setMusicEnabled(true); @@ -955,15 +956,17 @@ void StarTrekEngine::showGameOverMenu() { case 0: // Load game _gfx->fadeoutScreen(); showLoadMenu(); // TODO: this probably manipulates the stack to jump out of this function... - break; + _resetGameMode = true; + return; case 1: // Restart _gfx->fadeoutScreen(); // TODO - break; + _resetGameMode = true; + return; case 2: // Quit _gfx->fadeoutScreen(); _system->quit(); - break; + return; default: break; } diff --git a/engines/startrek/room.cpp b/engines/startrek/room.cpp index daf8e09512..08743f7188 100644 --- a/engines/startrek/room.cpp +++ b/engines/startrek/room.cpp @@ -444,7 +444,20 @@ void Room::endMission(int16 score, int16 arg1, int16 arg2) { _vm->_awayMission.disableInput = false; - // TODO: game mode switch + // TODO: This is a stopgap measure (loading the next away mission immediately). + // Replace this with the proper code later. + _vm->_gameMode = GAMEMODE_BEAMDOWN; + if (_vm->_missionName == "DEMON") + _vm->_missionToLoad = "TUG"; + if (_vm->_missionName == "TUG") + _vm->_missionToLoad = "LOVE"; + if (_vm->_missionName == "LOVE") + _vm->_missionToLoad = "MUDD"; + if (_vm->_missionName == "MUDD") + _vm->_missionToLoad = "FEATHER"; + if (_vm->_missionName == "FEATHER") + _vm->_missionToLoad = "TRIAL"; + _vm->_roomIndexToLoad = 0; } void Room::showGameOverMenu() { // TODO: takes an optional parameter? diff --git a/engines/startrek/startrek.cpp b/engines/startrek/startrek.cpp index a0eada7327..79681a88df 100644 --- a/engines/startrek/startrek.cpp +++ b/engines/startrek/startrek.cpp @@ -135,13 +135,17 @@ Common::Error StarTrekEngine::runGameMode(int mode) { _gameMode = mode; _sound->stopAllVocSounds(); - if (!_sound->_loopingAudioName.empty()) - _sound->playVoc(_sound->_loopingAudioName); + _resetGameMode = true; if (_gameMode == GAMEMODE_START) _gameMode = GAMEMODE_BRIDGE; while (true) { + if (_resetGameMode) { + if (!_sound->_loopingAudioName.empty()) + _sound->playVoc(_sound->_loopingAudioName); + _resetGameMode = false; + } TrekEvent event; if (_gameMode != _lastGameMode) { diff --git a/engines/startrek/startrek.h b/engines/startrek/startrek.h index b6b72150de..6e17375791 100644 --- a/engines/startrek/startrek.h +++ b/engines/startrek/startrek.h @@ -628,6 +628,7 @@ public: public: int _gameMode; int _lastGameMode; + bool _resetGameMode; // NOTE: this has a different meaning than the original game. When non-empty, a new // room load is triggered, as opposed to original behaviour where this was only read |