diff options
Diffstat (limited to 'engines/bladerunner/bladerunner.cpp')
-rw-r--r-- | engines/bladerunner/bladerunner.cpp | 17 |
1 files changed, 16 insertions, 1 deletions
diff --git a/engines/bladerunner/bladerunner.cpp b/engines/bladerunner/bladerunner.cpp index 6fc8dda67c..3d20423c39 100644 --- a/engines/bladerunner/bladerunner.cpp +++ b/engines/bladerunner/bladerunner.cpp @@ -254,7 +254,12 @@ Common::Error BladeRunnerEngine::loadGameState(int slot) { if (!BladeRunner::SaveFileManager::readHeader(*saveFile, header)) { error("Invalid savegame"); } + setTotalPlayTime(header._playTime); + // this essentially does something similar with setTotalPlayTime + // reseting and updating Blade Runner's _pauseStart and offset before starting a loaded game + _time->resetPauseStart(); + loadGame(*saveFile); delete saveFile; @@ -336,8 +341,17 @@ Common::Error BladeRunnerEngine::run() { // end of additional code for gracefully handling end-game if (ConfMan.hasKey("save_slot") && ConfMan.getInt("save_slot") != -1) { + // when loading from ScummVM main menu, we should emulate + // the Kia pause/resume in order to get a valid "current" time when the game + // is actually loaded (assuming delays can be introduced by a popup warning dialogue) + if(!_time->isLocked()) { + _time->pause(); + } loadGameState(ConfMan.getInt("save_slot")); ConfMan.set("save_slot", "-1"); + if(_time->isLocked()) { + _time->resume(); + } } else if (hasSavegames) { _kia->_forceOpen = true; _kia->open(kKIASectionLoad); @@ -402,7 +416,6 @@ bool BladeRunnerEngine::startup(bool hasSavegames) { _surfaceBack.create(640, 480, screenPixelFormat()); _time = new Time(this); - // Try to load the SUBTITLES.MIX first, before Startup.MIX // allows overriding any identically named resources (such as the original font files and as a bonus also the TRE files for the UI and dialogue menu) _subtitles = new Subtitles(this); @@ -972,6 +985,8 @@ void BladeRunnerEngine::gameTick() { _overlays->tick(); if (!inDialogueMenu) { + // TODO This is probably responsible for actors getting stuck in place + // after reaching a waypoint when dialoge menu is open actorsUpdate(); } |