[Scummvm-cvs-logs] scummvm master -> fb34336863ec8942ef7365c5decfdafcb020bc6a
Strangerke
Strangerke at scummvm.org
Mon Jan 25 00:28:27 CET 2016
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:
fb34336863 LAB: Do not crash the DOS version in case of missing file as some files are known to be missing in the original
Commit: fb34336863ec8942ef7365c5decfdafcb020bc6a
https://github.com/scummvm/scummvm/commit/fb34336863ec8942ef7365c5decfdafcb020bc6a
Author: Strangerke (strangerke at scummvm.org)
Date: 2016-01-25T00:21:28+01:00
Commit Message:
LAB: Do not crash the DOS version in case of missing file as some files are known to be missing in the original
Changed paths:
engines/lab/anim.cpp
engines/lab/resource.cpp
diff --git a/engines/lab/anim.cpp b/engines/lab/anim.cpp
index 3da4519..f2e6992 100644
--- a/engines/lab/anim.cpp
+++ b/engines/lab/anim.cpp
@@ -287,6 +287,9 @@ void Anim::readDiff(Common::File *diffFile, bool playOnce, bool onlyDiffData) {
_continuous = false;
+ if (!_diffFile)
+ return;
+
uint32 magicBytes = _diffFile->readUint32LE();
if (magicBytes != 1219009121) {
_isPlaying = false;
diff --git a/engines/lab/resource.cpp b/engines/lab/resource.cpp
index 096d293..ed0cb37 100644
--- a/engines/lab/resource.cpp
+++ b/engines/lab/resource.cpp
@@ -211,9 +211,15 @@ Common::String Resource::translateFileName(const Common::String filename) {
Common::File *Resource::openDataFile(const Common::String filename, uint32 fileHeader) {
Common::File *dataFile = new Common::File();
dataFile->open(translateFileName(filename));
- if (!dataFile->isOpen())
- error("openDataFile: Couldn't open %s (%s)", translateFileName(filename).c_str(), filename.c_str());
-
+ warning("%s", filename.c_str());
+ if (!dataFile->isOpen()) {
+ // The DOS version is known to have some missing files
+ if (_vm->getPlatform() == Common::kPlatformDOS) {
+ warning("Incomplete DOS version, skipping file %s", filename.c_str());
+ return nullptr;
+ } else
+ error("openDataFile: Couldn't open %s (%s)", translateFileName(filename).c_str(), filename.c_str());
+ }
if (fileHeader > 0) {
uint32 headerTag = dataFile->readUint32BE();
if (headerTag != fileHeader) {
More information about the Scummvm-git-logs
mailing list