From 0d10297969317118d27ecef5eeeb3721b02030fc Mon Sep 17 00:00:00 2001 From: Thanasis Antoniou Date: Thu, 21 Mar 2019 12:12:34 +0200 Subject: BLADERUNNER: Handle gracefully missing HDFRAMES or required CDFRAMESx file --- engines/bladerunner/slice_animations.cpp | 11 +++++++++-- 1 file changed, 9 insertions(+), 2 deletions(-) (limited to 'engines/bladerunner/slice_animations.cpp') 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) { -- cgit v1.2.3