diff options
Diffstat (limited to 'engines/neverhood/neverhood.cpp')
-rw-r--r-- | engines/neverhood/neverhood.cpp | 21 |
1 files changed, 15 insertions, 6 deletions
diff --git a/engines/neverhood/neverhood.cpp b/engines/neverhood/neverhood.cpp index 57fce58b94..e7c9f32d45 100644 --- a/engines/neverhood/neverhood.cpp +++ b/engines/neverhood/neverhood.cpp @@ -77,6 +77,9 @@ Common::Error NeverhoodEngine::run() { _gameState.sceneNum = 0; _gameState.which = 0; + // Assign default values to the config manager, in case settings are missing + ConfMan.registerDefault("originalsaveload", "false"); + _staticData = new StaticData(); _staticData->load("neverhood.dat"); _gameVars = new GameVars(); @@ -105,7 +108,8 @@ Common::Error NeverhoodEngine::run() { _gameModule = new GameModule(this); _isSaveAllowed = true; - + _updateSound = true; + if (isDemo()) { // Adjust this navigation list for the demo version NavigationList *navigationList = _staticData->getNavigationList(0x004B67E8); @@ -119,9 +123,10 @@ Common::Error NeverhoodEngine::run() { (*navigationList)[5].middleFlag = 1; } - if (ConfMan.hasKey("save_slot")) - loadGameState(ConfMan.getInt("save_slot")); - else + if (ConfMan.hasKey("save_slot")) { + if (loadGameState(ConfMan.getInt("save_slot")).getCode() != Common::kNoError) + _gameModule->startup(); + } else _gameModule->startup(); mainLoop(); @@ -186,8 +191,12 @@ void NeverhoodEngine::mainLoop() { _screen->update(); nextFrameTime = _screen->getNextFrameTime(); }; - _soundMan->update(); - _audioResourceMan->updateMusic(); + + if (_updateSound) { + _soundMan->update(); + _audioResourceMan->updateMusic(); + } + _system->updateScreen(); _system->delayMillis(10); } |