diff options
author | Thanasis Antoniou | 2019-03-21 12:12:34 +0200 |
---|---|---|
committer | Thanasis Antoniou | 2019-03-21 12:12:34 +0200 |
commit | 0d10297969317118d27ecef5eeeb3721b02030fc (patch) | |
tree | da7f94059981f7e030de411c5f1552d6a018fed8 | |
parent | 8fa1bf8cbdd516c8120d5861c20f729a07c0812e (diff) | |
download | scummvm-rg350-0d10297969317118d27ecef5eeeb3721b02030fc.tar.gz scummvm-rg350-0d10297969317118d27ecef5eeeb3721b02030fc.tar.bz2 scummvm-rg350-0d10297969317118d27ecef5eeeb3721b02030fc.zip |
BLADERUNNER: Handle gracefully missing HDFRAMES or required CDFRAMESx file
-rw-r--r-- | engines/bladerunner/bladerunner.cpp | 8 | ||||
-rw-r--r-- | engines/bladerunner/chapters.cpp | 3 | ||||
-rw-r--r-- | engines/bladerunner/slice_animations.cpp | 11 |
3 files changed, 18 insertions, 4 deletions
diff --git a/engines/bladerunner/bladerunner.cpp b/engines/bladerunner/bladerunner.cpp index ef91fd8c19..5b858b53c0 100644 --- a/engines/bladerunner/bladerunner.cpp +++ b/engines/bladerunner/bladerunner.cpp @@ -83,6 +83,7 @@ #include "common/savefile.h" #include "common/system.h" #include "common/debug-channels.h" +#include "gui/message.h" #include "engines/util.h" #include "engines/advancedDetector.h" @@ -847,7 +848,12 @@ void BladeRunnerEngine::gameTick() { } if (!_kia->isOpen() && !_sceneScript->isInsideScript() && !_aiScripts->isInsideScript()) { - _settings->openNewScene(); + if (!_settings->openNewScene()) { + Common::Error runtimeError = Common::Error(Common::kUnknownError, "A required game resource was not found"); + GUI::MessageDialog dialog(runtimeError.getDesc()); + dialog.runModal(); + return; + } } if (_gameAutoSave >= 0) { diff --git a/engines/bladerunner/chapters.cpp b/engines/bladerunner/chapters.cpp index afe04139b6..64da4812cb 100644 --- a/engines/bladerunner/chapters.cpp +++ b/engines/bladerunner/chapters.cpp @@ -30,7 +30,8 @@ namespace BladeRunner { bool Chapters::enterChapter(int chapter) { int id = _resourceIds[chapter]; - _vm->_sliceAnimations->openFrames(id); + if (!_vm->_sliceAnimations->openFrames(id)) + return false; if (!_vm->openArchive("A.TLK")) return false; diff --git a/engines/bladerunner/slice_animations.cpp b/engines/bladerunner/slice_animations.cpp index 5db08063b8..11ec717b3e 100644 --- a/engines/bladerunner/slice_animations.cpp +++ b/engines/bladerunner/slice_animations.cpp @@ -95,12 +95,15 @@ bool SliceAnimations::openCoreAnim() { } bool SliceAnimations::openFrames(int fileNumber) { + if (_framesPageFile._fileNumber == -1) { // Running for the first time, need to probe // First, try HDFRAMES.DAT if (_framesPageFile.open("HDFRAMES.DAT")) { _framesPageFile._fileNumber = 0; return true; + } else { + warning("SliceAnimations::openFrames: HDFRAMES.DAT resource not found. Falling back to using CDFRAMESx.DAT files instead..."); } } @@ -114,10 +117,14 @@ bool SliceAnimations::openFrames(int fileNumber) { _framesPageFile._fileNumber = fileNumber; - if (fileNumber == 1 && _framesPageFile.open("CDFRAMES.DAT")) // For Chapter1 we try both CDFRAMES.DAT and CDFRAMES1.DAT + if (fileNumber == 1 && _framesPageFile.open("CDFRAMES.DAT")) {// For Chapter1 we try both CDFRAMES.DAT and CDFRAMES1.DAT return true; + } - return _framesPageFile.open(Common::String::format("CDFRAMES%d.DAT", fileNumber)); + if (_framesPageFile.open(Common::String::format("CDFRAMES%d.DAT", fileNumber))) { + return true; + } + return false; } bool SliceAnimations::PageFile::open(const Common::String &name) { |