aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorPeter Kohaut2019-07-04 00:07:28 +0200
committerPeter Kohaut2019-07-04 00:09:47 +0200
commit577a84a24cf6676c7c170e143b4d4933751b09ac (patch)
tree459d8d90f8231f25b24f4dcca9632846aa4ab0a2
parentb3f0ffcb700edcf199ca84cc721e89f7e41e0c13 (diff)
downloadscummvm-rg350-577a84a24cf6676c7c170e143b4d4933751b09ac.tar.gz
scummvm-rg350-577a84a24cf6676c7c170e143b4d4933751b09ac.tar.bz2
scummvm-rg350-577a84a24cf6676c7c170e143b4d4933751b09ac.zip
BLADERUNNER: Explicit message about missing game files
-rw-r--r--engines/bladerunner/archive.cpp2
-rw-r--r--engines/bladerunner/bladerunner.cpp61
-rw-r--r--engines/bladerunner/bladerunner.h2
-rw-r--r--engines/bladerunner/slice_animations.cpp2
4 files changed, 65 insertions, 2 deletions
diff --git a/engines/bladerunner/archive.cpp b/engines/bladerunner/archive.cpp
index 8435a9d91d..0b2ac97ca1 100644
--- a/engines/bladerunner/archive.cpp
+++ b/engines/bladerunner/archive.cpp
@@ -44,7 +44,7 @@ bool MIXArchive::exists(const Common::String &filename) {
bool MIXArchive::open(const Common::String &filename) {
if (!_fd.open(filename)) {
- warning("MIXArchive::open(): Can not open %s", filename.c_str());
+ error("MIXArchive::open(): Can not open %s", filename.c_str());
return false;
}
diff --git a/engines/bladerunner/bladerunner.cpp b/engines/bladerunner/bladerunner.cpp
index 7362291c74..ecb4048233 100644
--- a/engines/bladerunner/bladerunner.cpp
+++ b/engines/bladerunner/bladerunner.cpp
@@ -310,6 +310,20 @@ void BladeRunnerEngine::pauseEngineIntern(bool pause) {
}
Common::Error BladeRunnerEngine::run() {
+
+ Common::Array<Common::String> missingFiles;
+ if (!checkFiles(missingFiles)) {
+ Common::String missingFileStr = "";
+ for (uint i = 0; i < missingFiles.size(); ++i) {
+ if (i > 0) {
+ missingFileStr += ", ";
+ }
+ missingFileStr += missingFiles[i];
+ }
+
+ return Common::Error(Common::kNoGameDataFoundError, missingFileStr);
+ }
+
Graphics::PixelFormat format = screenPixelFormat();
initGraphics(640, 480, &format);
@@ -386,6 +400,53 @@ Common::Error BladeRunnerEngine::run() {
return Common::kNoError;
}
+bool BladeRunnerEngine::checkFiles(Common::Array<Common::String> &missingFiles) {
+ missingFiles.clear();
+
+ Common::Array<Common::String> requiredFiles;
+ requiredFiles.push_back("1.TLK");
+ requiredFiles.push_back("2.TLK");
+ requiredFiles.push_back("3.TLK");
+ requiredFiles.push_back("A.TLK");
+ requiredFiles.push_back("COREANIM.DAT");
+ requiredFiles.push_back("MODE.MIX");
+ requiredFiles.push_back("MUSIC.MIX");
+ requiredFiles.push_back("OUTTAKE1.MIX");
+ requiredFiles.push_back("OUTTAKE2.MIX");
+ requiredFiles.push_back("OUTTAKE3.MIX");
+ requiredFiles.push_back("OUTTAKE4.MIX");
+ requiredFiles.push_back("SFX.MIX");
+ requiredFiles.push_back("SPCHSFX.TLK");
+ requiredFiles.push_back("STARTUP.MIX");
+ requiredFiles.push_back("VQA1.MIX");
+ requiredFiles.push_back("VQA2.MIX");
+ requiredFiles.push_back("VQA3.MIX");
+
+ for (uint i = 0; i < requiredFiles.size(); ++i) {
+ if (!Common::File::exists(requiredFiles[i])) {
+ missingFiles.push_back(requiredFiles[i]);
+ }
+ }
+
+ bool hasHdFrames = Common::File::exists("HDFRAMES.DAT");
+
+ if (!hasHdFrames) {
+ requiredFiles.clear();
+ requiredFiles.push_back("CDFRAMES1.DAT");
+ requiredFiles.push_back("CDFRAMES2.DAT");
+ requiredFiles.push_back("CDFRAMES3.DAT");
+ requiredFiles.push_back("CDFRAMES4.DAT");
+
+ for (uint i = 0; i < requiredFiles.size(); ++i) {
+ if (!Common::File::exists(requiredFiles[i])) {
+ missingFiles.push_back(requiredFiles[i]);
+ }
+ }
+ }
+
+ return missingFiles.empty();
+}
+
bool BladeRunnerEngine::startup(bool hasSavegames) {
// These are static objects in original game
diff --git a/engines/bladerunner/bladerunner.h b/engines/bladerunner/bladerunner.h
index 2c1aec4c1b..ceff3d70c4 100644
--- a/engines/bladerunner/bladerunner.h
+++ b/engines/bladerunner/bladerunner.h
@@ -251,6 +251,8 @@ public:
Common::Error run() override;
+ bool checkFiles(Common::Array<Common::String> &missingFiles);
+
bool startup(bool hasSavegames = false);
void initChapterAndScene();
void shutdown();
diff --git a/engines/bladerunner/slice_animations.cpp b/engines/bladerunner/slice_animations.cpp
index 553f153356..55a3d13e34 100644
--- a/engines/bladerunner/slice_animations.cpp
+++ b/engines/bladerunner/slice_animations.cpp
@@ -111,7 +111,7 @@ bool SliceAnimations::openFrames(int fileNumber) {
return true;
} else {
- warning("SliceAnimations::openFrames: HDFRAMES.DAT resource not found. Falling back to using CDFRAMESx.DAT files instead...");
+ debug("SliceAnimations::openFrames: HDFRAMES.DAT resource not found. Falling back to using CDFRAMESx.DAT files instead...");
}
}