[Scummvm-git-logs] scummvm branch-2-8 -> ba260c3fbd40f311e6ba4744bb90e9d2b78f513b

dwatteau noreply at scummvm.org
Mon Jan 1 21:03:15 UTC 2024


This automated email contains information about 2 new commits which have been
pushed to the 'scummvm' repo located at https://github.com/scummvm/scummvm .

Summary:
c19ac6dd7e SCUMM: Test that the Mac Indy 3 / Loom executable has a resource fork
ba260c3fbd COMMON: Add createReadStreamForMemberAltStream to FSDirectory


Commit: c19ac6dd7e13ff2479de5496a1fe419d8c554598
    https://github.com/scummvm/scummvm/commit/c19ac6dd7e13ff2479de5496a1fe419d8c554598
Author: Torbjörn Andersson (eriktorbjorn at users.sourceforge.net)
Date: 2024-01-01T22:01:45+01:00

Commit Message:
SCUMM: Test that the Mac Indy 3 / Loom executable has a resource fork

This was prompted by bug #14753, but is not a fix for it.

(cherry picked from commit 57ebb1161938627be22f3dc114f4573a6bc22e03)

Changed paths:
    engines/scumm/scumm.cpp


diff --git a/engines/scumm/scumm.cpp b/engines/scumm/scumm.cpp
index a9de92a7c71..767e7b201cf 100644
--- a/engines/scumm/scumm.cpp
+++ b/engines/scumm/scumm.cpp
@@ -1230,6 +1230,16 @@ Common::Error ScummEngine::init() {
 			}
 		}
 
+		if (!macResourceFile.empty()) {
+			if (!resource.open(macResourceFile))
+				return Common::Error(Common::kReadingFailed, Common::U32String::format(_("Could not open Macintosh resource file %s"), macResourceFile.c_str()));
+
+			if (!resource.hasResFork())
+				return Common::Error(Common::kReadingFailed, Common::U32String::format(_("Could not find resource fork in Macintosh resource file %s"), macResourceFile.c_str()));
+
+			resource.close();
+		}
+
 		if (!_macScreen && _renderMode == Common::kRenderMacintoshBW)
 			_renderMode = Common::kRenderDefault;
 


Commit: ba260c3fbd40f311e6ba4744bb90e9d2b78f513b
    https://github.com/scummvm/scummvm/commit/ba260c3fbd40f311e6ba4744bb90e9d2b78f513b
Author: elasota (1137273+elasota at users.noreply.github.com)
Date: 2024-01-01T22:02:26+01:00

Commit Message:
COMMON: Add createReadStreamForMemberAltStream to FSDirectory

(cherry picked from commit 1a9e5ab3ac71668722f6c66477a86e68a6bd4692)

Changed paths:
    common/fs.cpp
    common/fs.h


diff --git a/common/fs.cpp b/common/fs.cpp
index 7b68f566051..76aad9ef8f4 100644
--- a/common/fs.cpp
+++ b/common/fs.cpp
@@ -390,6 +390,23 @@ SeekableReadStream *FSDirectory::createReadStreamForMember(const Path &path) con
 	return stream;
 }
 
+SeekableReadStream *FSDirectory::createReadStreamForMemberAltStream(const Path &path, AltStreamType altStreamType) const {
+	if (path.toString().empty() || !_node.isDirectory())
+		return nullptr;
+
+	FSNode *node = lookupCache(_fileCache, path);
+	if (!node)
+		return nullptr;
+
+	debug(5, "FSDirectory::createReadStreamForMemberAltStream('%s', %i) -> '%s'", path.toString().c_str(), static_cast<int>(altStreamType), node->getPath().c_str());
+
+	SeekableReadStream *stream = node->createReadStreamForAltStream(altStreamType);
+	if (!stream)
+		warning("FSDirectory::createReadStreamForMemberAltStream: Can't create stream for file '%s' alt stream type %i", Common::toPrintable(path.toString()).c_str(), static_cast<int>(altStreamType));
+
+	return stream;
+}
+
 FSDirectory *FSDirectory::getSubDirectory(const Path &name, int depth, bool flat, bool ignoreClashes) {
 	return getSubDirectory(Path(), name, depth, flat, ignoreClashes);
 }
diff --git a/common/fs.h b/common/fs.h
index 7480cd2ac7a..7e2f13ea0de 100644
--- a/common/fs.h
+++ b/common/fs.h
@@ -441,6 +441,12 @@ public:
 	 * for success.
 	 */
 	SeekableReadStream *createReadStreamForMember(const Path &path) const override;
+
+	/**
+	 * Open an alternate stream for a specified file. A full match of relative path and file name is needed
+	 * for success.
+	 */
+	SeekableReadStream *createReadStreamForMemberAltStream(const Path &path, AltStreamType altStreamType) const override;
 };
 
 /** @} */




More information about the Scummvm-git-logs mailing list