mirror of
https://github.com/libretro/scummvm.git
synced 2025-02-09 12:22:51 +00:00
DETECTOR: Allow detecting with MacBinary with no resource fork
This commit is contained in:
parent
2e4744f013
commit
98f178c58f
@ -133,7 +133,7 @@ bool MacResManager::hasDataFork() const {
|
||||
}
|
||||
|
||||
bool MacResManager::hasResFork() const {
|
||||
return !_baseFileName.empty() && _mode != kResForkNone;
|
||||
return !_baseFileName.empty() && _mode != kResForkNone && _resForkSize != 0;
|
||||
}
|
||||
|
||||
uint32 MacResManager::getResForkDataSize() const {
|
||||
@ -446,13 +446,15 @@ bool MacResManager::loadFromMacBinary(SeekableReadStream *stream) {
|
||||
_resForkOffset = MBI_INFOHDR + dataSizePad;
|
||||
_resForkSize = rsrcSize;
|
||||
}
|
||||
|
||||
if (_resForkOffset < 0)
|
||||
return false;
|
||||
|
||||
_mode = kResForkMacBinary;
|
||||
return load(stream);
|
||||
}
|
||||
|
||||
if (_resForkOffset < 0)
|
||||
return false;
|
||||
|
||||
_mode = kResForkMacBinary;
|
||||
return load(stream);
|
||||
return false;
|
||||
}
|
||||
|
||||
bool MacResManager::loadFromRawFork(SeekableReadStream *stream) {
|
||||
@ -472,6 +474,11 @@ bool MacResManager::load(SeekableReadStream *stream) {
|
||||
if (_mode == kResForkNone)
|
||||
return false;
|
||||
|
||||
if (_resForkSize == 0) {
|
||||
_stream = stream;
|
||||
return true;
|
||||
}
|
||||
|
||||
stream->seek(_resForkOffset);
|
||||
|
||||
_dataOffset = stream->readUint32BE() + _resForkOffset;
|
||||
|
@ -557,6 +557,15 @@ static bool getFilePropertiesIntern(uint md5Bytes, const AdvancedMetaEngine::Fil
|
||||
|
||||
if (fileProps.size != 0)
|
||||
return true;
|
||||
|
||||
Common::SeekableReadStream *dataFork = macResMan.getDataFork();
|
||||
if (dataFork && dataFork->size()) {
|
||||
fileProps.size = dataFork->size();
|
||||
fileProps.md5 = Common::computeStreamMD5AsString(*dataFork, md5Bytes);
|
||||
delete dataFork;
|
||||
return true;
|
||||
}
|
||||
delete dataFork;
|
||||
}
|
||||
|
||||
if (!allFiles.contains(fname))
|
||||
|
Loading…
x
Reference in New Issue
Block a user