BLADERUNNER: Explicit message about missing game files
This commit is contained in:
parent
b3f0ffcb70
commit
577a84a24c
4 changed files with 65 additions and 2 deletions
|
@ -44,7 +44,7 @@ bool MIXArchive::exists(const Common::String &filename) {
|
||||||
|
|
||||||
bool MIXArchive::open(const Common::String &filename) {
|
bool MIXArchive::open(const Common::String &filename) {
|
||||||
if (!_fd.open(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;
|
return false;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
@ -310,6 +310,20 @@ void BladeRunnerEngine::pauseEngineIntern(bool pause) {
|
||||||
}
|
}
|
||||||
|
|
||||||
Common::Error BladeRunnerEngine::run() {
|
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();
|
Graphics::PixelFormat format = screenPixelFormat();
|
||||||
initGraphics(640, 480, &format);
|
initGraphics(640, 480, &format);
|
||||||
|
|
||||||
|
@ -386,6 +400,53 @@ Common::Error BladeRunnerEngine::run() {
|
||||||
return Common::kNoError;
|
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) {
|
bool BladeRunnerEngine::startup(bool hasSavegames) {
|
||||||
// These are static objects in original game
|
// These are static objects in original game
|
||||||
|
|
||||||
|
|
|
@ -251,6 +251,8 @@ public:
|
||||||
|
|
||||||
Common::Error run() override;
|
Common::Error run() override;
|
||||||
|
|
||||||
|
bool checkFiles(Common::Array<Common::String> &missingFiles);
|
||||||
|
|
||||||
bool startup(bool hasSavegames = false);
|
bool startup(bool hasSavegames = false);
|
||||||
void initChapterAndScene();
|
void initChapterAndScene();
|
||||||
void shutdown();
|
void shutdown();
|
||||||
|
|
|
@ -111,7 +111,7 @@ bool SliceAnimations::openFrames(int fileNumber) {
|
||||||
|
|
||||||
return true;
|
return true;
|
||||||
} else {
|
} 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...");
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue