diff options
author | Eugene Sandulenko | 2019-11-11 11:30:02 +0100 |
---|---|---|
committer | Eugene Sandulenko | 2019-11-13 22:07:08 +0100 |
commit | 93be6abf58c902bcbe33b6d7f535ea477b6e6afc (patch) | |
tree | 2c72de8c186989be1cc088374ee38462eb15c9ef /engines/griffon | |
parent | 477e12c1e1ccf529fdee9d4339b618fcd8b24160 (diff) | |
download | scummvm-rg350-93be6abf58c902bcbe33b6d7f535ea477b6e6afc.tar.gz scummvm-rg350-93be6abf58c902bcbe33b6d7f535ea477b6e6afc.tar.bz2 scummvm-rg350-93be6abf58c902bcbe33b6d7f535ea477b6e6afc.zip |
GRIFFON: Fix the menu logic. Finally!
Diffstat (limited to 'engines/griffon')
-rw-r--r-- | engines/griffon/combat.cpp | 2 | ||||
-rw-r--r-- | engines/griffon/engine.cpp | 6 | ||||
-rw-r--r-- | engines/griffon/griffon.cpp | 17 | ||||
-rw-r--r-- | engines/griffon/griffon.h | 6 |
4 files changed, 20 insertions, 11 deletions
diff --git a/engines/griffon/combat.cpp b/engines/griffon/combat.cpp index ebd5876eb4..a21ce7f4f0 100644 --- a/engines/griffon/combat.cpp +++ b/engines/griffon/combat.cpp @@ -1004,7 +1004,7 @@ void GriffonEngine::damageNPC(int npcnum, int damage, int spell) { if (_npcInfo[npcnum].script == kScriptEndOfGame) { endOfGame(); - _gameMode = kGameModeEnd; + _gameMode = kGameModeIntro; } } } diff --git a/engines/griffon/engine.cpp b/engines/griffon/engine.cpp index 19519bb3da..a1eb5139ac 100644 --- a/engines/griffon/engine.cpp +++ b/engines/griffon/engine.cpp @@ -107,7 +107,7 @@ void GriffonEngine::mainLoop() { _console->onFrame(); updateEngine(); - } while (!_shouldQuit && _gameMode != kGameModeEnd && _gameMode != kGameModeNewGame); + } while (!_shouldQuit && _gameMode == kGameModePlay); } void GriffonEngine::updateEngine() { @@ -163,7 +163,7 @@ void GriffonEngine::updateEngine() { checkHit(); - if (_gameMode == kGameModeEnd) + if (_gameMode != kGameModePlay) return; } @@ -246,7 +246,7 @@ void GriffonEngine::updateEngine() { if (_player.hp <= 0) { theEnd(); - _gameMode = kGameModeEnd; + _gameMode = kGameModeIntro; return; } diff --git a/engines/griffon/griffon.cpp b/engines/griffon/griffon.cpp index 85e1e367ae..7632623e49 100644 --- a/engines/griffon/griffon.cpp +++ b/engines/griffon/griffon.cpp @@ -137,13 +137,20 @@ Common::Error GriffonEngine::run() { if (_shouldQuit) return Common::kNoError; + _gameMode = kGameModeIntro; + while (!_shouldQuit) { - if (_gameMode != kGameModeNewGame) + switch (_gameMode) { + case kGameModeIntro: + case kGameModePlay: title(0); + break; - if (_gameMode == kGameModeNewGame) { + case kGameModeNewGame: newGame(); - } else if (_gameMode == kGameModeLoadGame) { + break; + + case kGameModeLoadGame: _player.walkSpeed = 1.1f; _animSpeed = 0.5f; _attacking = false; @@ -157,6 +164,10 @@ Common::Error GriffonEngine::run() { _secsInGame = 0; loadMap(_curMap); mainLoop(); + break; + + default: + error("Bad game mode: %d", _gameMode); } } diff --git a/engines/griffon/griffon.h b/engines/griffon/griffon.h index 611ecc8de2..f2e397e233 100644 --- a/engines/griffon/griffon.h +++ b/engines/griffon/griffon.h @@ -322,11 +322,9 @@ struct ObjectInfoStruct { enum { kGameModeIntro, - kGameModeEnd, - kGameModeSaveLoad, + kGameModePlay, kGameModeNewGame, - kGameModeLoadGame, - kGameModePlay + kGameModeLoadGame }; class GriffonEngine : public Engine { |