[Scummvm-git-logs] scummvm master -> 0d10297969317118d27ecef5eeeb3721b02030fc

antoniou79 antoniou at cti.gr
Thu Mar 21 11:13:37 CET 2019


This automated email contains information about 1 new commit which have been
pushed to the 'scummvm' repo located at https://github.com/scummvm/scummvm .

Summary:
0d10297969 BLADERUNNER: Handle gracefully missing HDFRAMES or required CDFRAMESx file


Commit: 0d10297969317118d27ecef5eeeb3721b02030fc
    https://github.com/scummvm/scummvm/commit/0d10297969317118d27ecef5eeeb3721b02030fc
Author: Thanasis Antoniou (a.antoniou79 at gmail.com)
Date: 2019-03-21T12:12:34+02:00

Commit Message:
BLADERUNNER: Handle gracefully missing HDFRAMES or required CDFRAMESx file

Changed paths:
    engines/bladerunner/bladerunner.cpp
    engines/bladerunner/chapters.cpp
    engines/bladerunner/slice_animations.cpp


diff --git a/engines/bladerunner/bladerunner.cpp b/engines/bladerunner/bladerunner.cpp
index ef91fd8..5b858b5 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 afe0413..64da481 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 5db0806..11ec717 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) {





More information about the Scummvm-git-logs mailing list