[Scummvm-git-logs] scummvm master -> a77748bbf7f330c46b98c1d7a7e7768b8497113a

elasota noreply at scummvm.org
Sun Dec 4 20:47:40 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:
a77748bbf7 MTROPOLIS: Switch to openFileOrDataFork.


Commit: a77748bbf7f330c46b98c1d7a7e7768b8497113a
    https://github.com/scummvm/scummvm/commit/a77748bbf7f330c46b98c1d7a7e7768b8497113a
Author: elasota (ejlasota at gmail.com)
Date: 2022-12-04T15:47:21-05:00

Commit Message:
MTROPOLIS: Switch to openFileOrDataFork.

Changed paths:
    engines/mtropolis/boot.cpp


diff --git a/engines/mtropolis/boot.cpp b/engines/mtropolis/boot.cpp
index fb0758604f7..cdfa3d4762e 100644
--- a/engines/mtropolis/boot.cpp
+++ b/engines/mtropolis/boot.cpp
@@ -221,27 +221,18 @@ void ObsidianGameDataHandler::unpackMacRetailInstaller(Common::Array<Common::Sha
 		{"RSGKit.rPP", MKTAG('M', 'F', 'c', 'o'), MKTAG('M', 'f', 'M', 'f')},
 	};
 
-	Common::SharedPtr<Common::MacResManager> installerResMan(new Common::MacResManager());
-	persistentResources.push_back(PersistentResource<Common::MacResManager>::wrap(installerResMan));
-
-	if (!installerResMan->open("Obsidian Installer"))
-		error("Failed to open Obsidian Installer");
-
-	if (!installerResMan->hasDataFork())
+	Common::SeekableReadStream *installerDataForkStream = Common::MacResManager::openFileOrDataFork("Obsidian Installer");
+	if (!installerDataForkStream)
 		error("Obsidian Installer has no data fork");
 
-	Common::SeekableReadStream *installerDataForkStream = installerResMan->getDataFork();
-
 	// Not counted/persisted because the StuffIt archive owns the stream.  It will also delete it if createStuffItArchive fails.
 	_installerArchive.reset(Common::createStuffItArchive(installerDataForkStream));
 	installerDataForkStream = nullptr;
 
 	persistentResources.push_back(PersistentResource<Common::Archive>::wrap(_installerArchive));
 
-	if (!_installerArchive) {
-
+	if (!_installerArchive)
 		error("Failed to open Obsidian Installer archive");
-	}
 
 	debug(1, "Unpacking resource files...");
 
@@ -439,16 +430,10 @@ void SPQRGameDataHandler::unpackAdditionalFiles(Common::Array<Common::SharedPtr<
 			{"SPQR:Data File SPQR", true, false, MTFT_MAIN},
 		};
 
-		Common::SharedPtr<Common::MacResManager> installerResMan(new Common::MacResManager());
-
-		if (!installerResMan->open("Install.vct"))
+		Common::SharedPtr<Common::SeekableReadStream> installerDataForkStream(Common::MacResManager::openFileOrDataFork("Install.vct"));
+		if (!installerDataForkStream)
 			error("Failed to open SPQR installer");
 
-		if (!installerResMan->hasDataFork())
-			error("SPQR installer has no data fork");
-
-		Common::SharedPtr<Common::SeekableReadStream> installerDataForkStream(installerResMan->getDataFork());
-
 		Common::ScopedPtr<Common::Archive> archive(Common::createMacVISEArchive(installerDataForkStream.get()));
 
 		debug(1, "Unpacking files...");
@@ -1218,12 +1203,9 @@ Common::SharedPtr<ProjectDescription> bootProject(const MTropolisGameDescription
 			if (segmentFile->stream)
 				dataFork = segmentFile->stream;
 			else {
-				Boot::initResManForFile(*segmentFile);
-				dataFork.reset(segmentFile->resMan->getDataFork());
+				dataFork.reset(Common::MacResManager::openFileOrDataFork(segmentFile->fileName));
 				if (!dataFork)
 					error("Segment file '%s' has no data fork", segmentFile->fileName.c_str());
-
-				persistentResources.push_back(Boot::PersistentResource<Common::MacResManager>::wrap(segmentFile->resMan));
 			}
 
 			persistentResources.push_back(Boot::PersistentResource<Common::SeekableReadStream>::wrap(dataFork));




More information about the Scummvm-git-logs mailing list