mirror of
https://github.com/libretro/scummvm.git
synced 2024-12-14 21:59:17 +00:00
LAB: Do not crash the DOS version in case of missing file as some files are known to be missing in the original
This commit is contained in:
parent
78b9a903ad
commit
fb34336863
@ -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;
|
||||
|
@ -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) {
|
||||
|
Loading…
Reference in New Issue
Block a user