[Scummvm-git-logs] scummvm master -> b3df6c6f035cb0734f194d44078052a9332eb419
sev-
noreply at scummvm.org
Sun Mar 20 19:48:22 UTC 2022
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:
b3df6c6f03 COMMON: macresman: handle macbinary with resource forks
Commit: b3df6c6f035cb0734f194d44078052a9332eb419
https://github.com/scummvm/scummvm/commit/b3df6c6f035cb0734f194d44078052a9332eb419
Author: Misty De Meo (mistydemeo at gmail.com)
Date: 2022-03-20T20:48:17+01:00
Commit Message:
COMMON: macresman: handle macbinary with resource forks
Changed paths:
common/macresman.cpp
diff --git a/common/macresman.cpp b/common/macresman.cpp
index c6f0e15a7a6..3b8787ac770 100644
--- a/common/macresman.cpp
+++ b/common/macresman.cpp
@@ -130,10 +130,20 @@ bool MacResManager::open(const Path &fileName, Archive &archive) {
const ArchiveMemberPtr archiveMember = archive.getMember(fileName);
const Common::FSNode *plainFsNode = dynamic_cast<const Common::FSNode *>(archiveMember.get());
if (plainFsNode) {
+ // This could be a MacBinary file that still has a
+ // resource fork; if it is, it needs to get opened as MacBinary
+ // and not treated as raw.
+ SeekableReadStream *stream = archive.createReadStreamForMember(fileName);
+ bool isMacBinaryFile = false;
+ if (stream) {
+ isMacBinaryFile = isMacBinary(*stream);
+ }
+ delete stream;
+
String fullPath = plainFsNode->getPath() + "/..namedfork/rsrc";
FSNode resFsNode = FSNode(fullPath);
SeekableReadStream *macResForkRawStream = resFsNode.createReadStream();
- if (macResForkRawStream && loadFromRawFork(*macResForkRawStream)) {
+ if (!isMacBinaryFile && macResForkRawStream && loadFromRawFork(*macResForkRawStream)) {
_baseFileName = fileName;
return true;
}
More information about the Scummvm-git-logs
mailing list