[Scummvm-git-logs] scummvm master -> 66794328f0b7a188f5095f5bdc73753a19478c62

elasota noreply at scummvm.org
Thu Dec 14 05:51:57 UTC 2023


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:
904eaaa6e1 MTROPOLIS: Remove old boot code
66794328f0 MTROPOLIS: Exclude IgorServer file in Obsidian Japanese.  This file's data is intentionally wiped in the Steam/ZOOM re-r


Commit: 904eaaa6e14c82a4fd9675467f78dca4cf4627bf
    https://github.com/scummvm/scummvm/commit/904eaaa6e14c82a4fd9675467f78dca4cf4627bf
Author: elasota (1137273+elasota at users.noreply.github.com)
Date: 2023-12-14T00:48:33-05:00

Commit Message:
MTROPOLIS: Remove old boot code

Changed paths:
    engines/mtropolis/boot.cpp


diff --git a/engines/mtropolis/boot.cpp b/engines/mtropolis/boot.cpp
index f97c5d81f82..6e42b4afead 100644
--- a/engines/mtropolis/boot.cpp
+++ b/engines/mtropolis/boot.cpp
@@ -57,21 +57,6 @@ struct ManifestSubtitlesDef {
 	Common::String modifierMappingTablePath;
 };
 
-enum ManifestFileType {
-	MTFT_AUTO = 0,       // Automatic, determine based on extension or file type
-	MTFT_PLAYER = 1,     // mTropolis Player program
-	MTFT_EXTENSION = 2,  // Extension (only use this if the extension contains cursors, otherwise use MTFT_SPECIAL if it has something else useful, or exclude it if not)
-	MTFT_MAIN = 3,       // Main segment
-	MTFT_ADDITIONAL = 4, // Additional segment
-	MTFT_VIDEO = 5,      // External video file
-	MTFT_SPECIAL = 6,    // Some other kind of file, or something that might be incorrectly detected as a different type of file (e.g. installers)
-};
-
-struct ManifestFile {
-	const char *fileName;
-	ManifestFileType fileType;
-};
-
 struct Game {
 	MTropolisGameBootID bootID;
 	void (BootScriptContext::*bootFunction)();
@@ -84,55 +69,6 @@ struct GameDataHandlerFactory {
 	}
 };
 
-struct FileIdentification {
-	union Tag {
-		uint32 value;
-		char debug[4];
-	};
-
-	FileIdentification();
-
-	Common::String fileName;
-	ManifestFileType category;
-
-	Tag macType;
-	Tag macCreator;
-	Common::SharedPtr<Common::MacResManager> resMan;
-	Common::SharedPtr<Common::SeekableReadStream> stream;
-};
-
-FileIdentification::FileIdentification() : category(MTFT_AUTO) {
-	macType.value = 0;
-	macCreator.value = 0;
-}
-
-class GameDataHandler {
-public:
-	GameDataHandler(const Boot::Game &game, const MTropolisGameDescription &desc);
-	virtual ~GameDataHandler();
-
-	virtual void unpackAdditionalFiles(Common::Array<Common::SharedPtr<ProjectPersistentResource> > &persistentResources, Common::Array<FileIdentification> &files);
-	virtual void categorizeSpecialFiles(Common::Array<FileIdentification> &files);
-	virtual void addPlugIns(ProjectDescription &projectDesc, const Common::Array<FileIdentification> &files);
-};
-
-GameDataHandler::GameDataHandler(const Boot::Game &game, const MTropolisGameDescription &desc) {
-}
-
-GameDataHandler::~GameDataHandler() {
-}
-
-void GameDataHandler::unpackAdditionalFiles(Common::Array<Common::SharedPtr<ProjectPersistentResource> > &persistentResources, Common::Array<FileIdentification> &files) {
-}
-
-void GameDataHandler::categorizeSpecialFiles(Common::Array<FileIdentification> &files) {
-}
-
-void GameDataHandler::addPlugIns(ProjectDescription &projectDesc, const Common::Array<FileIdentification> &files) {
-	Common::SharedPtr<MTropolis::PlugIn> standardPlugIn = PlugIns::createStandard();
-	projectDesc.addPlugIn(standardPlugIn);
-}
-
 template<class T>
 class PersistentResource : public ProjectPersistentResource {
 public:
@@ -159,185 +95,15 @@ Common::SharedPtr<ProjectPersistentResource> PersistentResource<T>::wrap(const C
 	return Common::SharedPtr<ProjectPersistentResource>(new PersistentResource<T>(item));
 }
 
-class ObsidianGameDataHandler : public GameDataHandler {
+class ObsidianGameDataHandler  {
 public:
-	ObsidianGameDataHandler(const Game &game, const MTropolisGameDescription &gameDesc);
-
-	void unpackAdditionalFiles(Common::Array<Common::SharedPtr<ProjectPersistentResource> > &persistentResources, Common::Array<FileIdentification> &files) override;
-	void categorizeSpecialFiles(Common::Array<FileIdentification> &files) override;
-	void addPlugIns(ProjectDescription &projectDesc, const Common::Array<FileIdentification> &files) override;
-
 	static Common::SharedPtr<MTropolis::PlugIn> loadPlugIn(Common::Archive &fs, const Common::Path &pluginsLocation, bool isMac, bool isRetail, bool isEnglish);
 
 private:
-	bool _isMac;
-	bool _isRetail;
-	bool _isEnglish;
-	bool _isJapanese;
-	bool _isGermanWithInstaller;
-
-	void unpackMacRetailInstaller(Common::Array<Common::SharedPtr<ProjectPersistentResource> > &persistentResources, Common::Array<FileIdentification> &files);
-	void unpackGermanWinRetailInstaller(Common::Array<Common::SharedPtr<ProjectPersistentResource> > &persistentResources, Common::Array<FileIdentification> &files);
 	static Common::SharedPtr<Obsidian::WordGameData> loadWinWordGameData(Common::SeekableReadStream *stream);
 	static Common::SharedPtr<Obsidian::WordGameData> loadMacWordGameData(Common::SeekableReadStream *stream);
-
-	Common::SharedPtr<Common::Archive> _installerArchive;
 };
 
-ObsidianGameDataHandler::ObsidianGameDataHandler(const Game &game, const MTropolisGameDescription &gameDesc) : GameDataHandler(game, gameDesc) {
-	_isMac = (gameDesc.desc.platform == Common::kPlatformMacintosh);
-	_isEnglish = (gameDesc.desc.language == Common::EN_ANY);
-	_isJapanese = (gameDesc.desc.language == Common::JA_JPN);
-	_isRetail = ((gameDesc.desc.flags & ADGF_DEMO) == 0);
-	_isGermanWithInstaller = (gameDesc.bootID == MTBOOT_OBSIDIAN_RETAIL_WIN_DE_DISC);
-}
-
-struct MacInstallerUnpackRequest {
-	const char *fileName;
-	uint32 type;
-	uint32 creator;
-};
-
-struct MacVISE3InstallerUnpackRequest {
-	const char *fileName;
-	bool extractData;
-	bool extractResources;
-	ManifestFileType fileType;
-};
-
-void ObsidianGameDataHandler::unpackAdditionalFiles(Common::Array<Common::SharedPtr<ProjectPersistentResource> > &persistentResources, Common::Array<FileIdentification> &files) {
-	if (_isMac && _isRetail)
-		unpackMacRetailInstaller(persistentResources, files);
-
-	if (_isGermanWithInstaller)
-		unpackGermanWinRetailInstaller(persistentResources, files);
-}
-
-void ObsidianGameDataHandler::unpackMacRetailInstaller(Common::Array<Common::SharedPtr<ProjectPersistentResource> > &persistentResources, Common::Array<FileIdentification> &files) {
-	const MacInstallerUnpackRequest requests[] = {
-		{"Obsidian", MKTAG('A', 'P', 'P', 'L'), MKTAG('M', 'f', 'P', 'l')},
-		{"Basic.rPP", MKTAG('M', 'F', 'X', 'O'), MKTAG('M', 'f', 'P', 'l')},
-		{"mCursors.cPP", MKTAG('M', 'F', 'c', 'r'), MKTAG('M', 'f', 'P', 'l')},
-		{"Obsidian.cPP", MKTAG('M', 'F', 'c', 'r'), MKTAG('M', 'f', 'M', 'f')},
-		{"RSGKit.rPP", MKTAG('M', 'F', 'c', 'o'), MKTAG('M', 'f', 'M', 'f')},
-	};
-
-	const char *installerFileName = nullptr;
-	if (_isEnglish)
-		installerFileName = "Obsidian Installer";
-	else if (_isJapanese)
-		installerFileName = "xn--u9j9ecg0a2fsa1io6k6jkdc2k";
-	else
-		error("Couldn't figure out what file name to use as installer to unpack");
-
-	Common::SeekableReadStream *installerDataForkStream = Common::MacResManager::openFileOrDataFork(installerFileName);
-	if (!installerDataForkStream)
-		error("Obsidian Installer has no data fork");
-
-	// Not counted/persisted because the StuffIt archive owns the stream.  It will also delete it if createStuffItArchive fails.
-	_installerArchive.reset(Common::createStuffItArchive(installerDataForkStream, true));
-	installerDataForkStream = nullptr;
-
-	persistentResources.push_back(PersistentResource<Common::Archive>::wrap(_installerArchive));
-
-	if (!_installerArchive)
-		error("Failed to open Obsidian Installer archive");
-
-	debug(1, "Unpacking resource files...");
-
-	for (const MacInstallerUnpackRequest &request : requests) {
-		Common::SharedPtr<Common::MacResManager> resMan(new Common::MacResManager());
-
-		if (!resMan->open(request.fileName, *_installerArchive))
-			error("Failed to open file '%s' from installer package", request.fileName);
-
-		FileIdentification ident;
-		ident.fileName = request.fileName;
-		ident.macCreator.value = request.creator;
-		ident.macType.value = request.type;
-		ident.resMan = resMan;
-		ident.category = MTFT_AUTO;
-		files.push_back(ident);
-	}
-
-	{
-		debug(1, "Unpacking startup segment...");
-
-		Common::SharedPtr<Common::SeekableReadStream> startupStream(_installerArchive->createReadStreamForMember("Obsidian Data 1"));
-
-		FileIdentification ident;
-		ident.fileName = "Obsidian Data 1";
-		ident.macCreator.value = MKTAG('M', 'f', 'P', 'l');
-		ident.macType.value = MKTAG('M', 'F', 'm', 'm');
-		ident.category = MTFT_AUTO;
-		ident.stream = startupStream;
-		files.push_back(ident);
-	}
-}
-
-void ObsidianGameDataHandler::unpackGermanWinRetailInstaller(Common::Array<Common::SharedPtr<ProjectPersistentResource> > &persistentResources, Common::Array<FileIdentification> &files) {
-	Common::SharedPtr<Common::InstallShieldV3> isa(new Common::InstallShieldV3());
-
-	if (!isa->open("_SETUP.1"))
-		error("Couldn't open installer archive");
-
-	persistentResources.push_back(PersistentResource<Common::Archive>::wrap(_installerArchive));
-
-	FileIdentification ident;
-
-	Common::Array<FileIdentification> newIdents;
-
-	ident.category = MTFT_PLAYER;
-	ident.fileName = "Obsidian.exe";
-	ident.stream.reset(isa->createReadStreamForMember("Group1\\Obsidian.exe"));
-	newIdents.push_back(ident);
-
-	ident.category = MTFT_EXTENSION;
-	ident.fileName = "Obsidian.c95";
-	ident.stream.reset(isa->createReadStreamForMember("Group2\\Obsidian.c95"));
-	newIdents.push_back(ident);
-
-	ident.category = MTFT_EXTENSION;
-	ident.fileName = "MCURSORS.C95";
-	ident.stream.reset(isa->createReadStreamForMember("Group2\\MCURSORS.C95"));
-	newIdents.push_back(ident);
-
-	for (const FileIdentification &newIdent : newIdents) {
-		if (!newIdent.stream)
-			error("Failed to open archive file '%s'", newIdent.fileName.c_str());
-	}
-
-	files.push_back(newIdents);
-}
-
-void ObsidianGameDataHandler::categorizeSpecialFiles(Common::Array<FileIdentification> &files) {
-	// Flag the installer as Special so it doesn't get detected as the player due to being an application
-	// Flag RSGKit as Special so it doesn't get fed to the cursor loader
-	for (FileIdentification &file : files) {
-		if (file.fileName == "Obsidian Installer" || file.fileName == "RSGKit.rPP" || file.fileName == "RSGKit.r95")
-			file.category = MTFT_SPECIAL;
-	}
-}
-
-void ObsidianGameDataHandler::addPlugIns(ProjectDescription &projectDesc, const Common::Array<FileIdentification> &files) {
-	Common::SharedPtr<Obsidian::WordGameData> wgData;
-
-	if (_isRetail && _isEnglish) {
-		if (_isMac) {
-			wgData = loadMacWordGameData(nullptr);
-		} else {
-			wgData = loadWinWordGameData(nullptr);
-		}
-	}
-
-	Common::SharedPtr<Obsidian::ObsidianPlugIn> obsidianPlugIn(new Obsidian::ObsidianPlugIn(wgData));
-	projectDesc.addPlugIn(obsidianPlugIn);
-
-	Common::SharedPtr<MTropolis::PlugIn> standardPlugIn = PlugIns::createStandard();
-	static_cast<Standard::StandardPlugIn *>(standardPlugIn.get())->getHacks().allowGarbledListModData = true;
-	projectDesc.addPlugIn(standardPlugIn);
-}
-
 Common::SharedPtr<MTropolis::PlugIn> ObsidianGameDataHandler::loadPlugIn(Common::Archive &fs, const Common::Path &pluginsLocation, bool isMac, bool isRetail, bool isEnglish) {
 	Common::SharedPtr<Obsidian::WordGameData> wgData;
 
@@ -438,145 +204,6 @@ Common::SharedPtr<Obsidian::WordGameData> ObsidianGameDataHandler::loadWinWordGa
 	return wgData;
 }
 
-class MTIGameDataHandler : public GameDataHandler {
-public:
-	MTIGameDataHandler(const Game &game, const MTropolisGameDescription &gameDesc);
-
-	void addPlugIns(ProjectDescription &projectDesc, const Common::Array<FileIdentification> &files) override;
-};
-
-MTIGameDataHandler::MTIGameDataHandler(const Game &game, const MTropolisGameDescription &gameDesc) : GameDataHandler(game, gameDesc) {
-}
-
-void MTIGameDataHandler::addPlugIns(ProjectDescription &projectDesc, const Common::Array<FileIdentification> &files) {
-	Common::SharedPtr<MTropolis::PlugIn> mtiPlugIn(PlugIns::createMTI());
-	projectDesc.addPlugIn(mtiPlugIn);
-
-	Common::SharedPtr<MTropolis::PlugIn> standardPlugIn = PlugIns::createStandard();
-	static_cast<Standard::StandardPlugIn *>(standardPlugIn.get())->getHacks().allowGarbledListModData = true;
-	projectDesc.addPlugIn(standardPlugIn);
-}
-
-class AlbertGameDataHandler : public GameDataHandler {
-public:
-	AlbertGameDataHandler(const Game &game, const MTropolisGameDescription &gameDesc);
-
-	void addPlugIns(ProjectDescription &projectDesc, const Common::Array<FileIdentification> &files) override;
-};
-
-AlbertGameDataHandler::AlbertGameDataHandler(const Game &game, const MTropolisGameDescription &gameDesc) : GameDataHandler(game, gameDesc) {
-}
-
-void AlbertGameDataHandler::addPlugIns(ProjectDescription &projectDesc, const Common::Array<FileIdentification> &files) {
-	Common::SharedPtr<MTropolis::PlugIn> standardPlugIn = PlugIns::createStandard();
-	static_cast<Standard::StandardPlugIn *>(standardPlugIn.get())->getHacks().allowGarbledListModData = true;
-	projectDesc.addPlugIn(standardPlugIn);
-}
-
-class SPQRGameDataHandler : public GameDataHandler {
-public:
-	SPQRGameDataHandler(const Game &game, const MTropolisGameDescription &gameDesc);
-
-	void addPlugIns(ProjectDescription &projectDesc, const Common::Array<FileIdentification> &files) override;
-	void unpackAdditionalFiles(Common::Array<Common::SharedPtr<ProjectPersistentResource> > &persistentResources, Common::Array<FileIdentification> &files) override;
-
-private:
-	bool _isMac;
-};
-
-SPQRGameDataHandler::SPQRGameDataHandler(const Game &game, const MTropolisGameDescription &gameDesc) : GameDataHandler(game, gameDesc), _isMac(gameDesc.desc.platform == Common::kPlatformMacintosh) {
-}
-
-void SPQRGameDataHandler::addPlugIns(ProjectDescription &projectDesc, const Common::Array<FileIdentification> &files) {
-	Common::SharedPtr<MTropolis::PlugIn> standardPlugIn = PlugIns::createStandard();
-	projectDesc.addPlugIn(standardPlugIn);
-
-	Common::SharedPtr<MTropolis::PlugIn> spqrPlugIn = PlugIns::createSPQR();
-	projectDesc.addPlugIn(spqrPlugIn);
-}
-
-void SPQRGameDataHandler::unpackAdditionalFiles(Common::Array<Common::SharedPtr<ProjectPersistentResource> > &persistentResources, Common::Array<FileIdentification> &files) {
-	if (_isMac) {
-		const MacVISE3InstallerUnpackRequest unpackRequests[] = {
-			{"SPQR:Resource:Basic.rPP", false, true, MTFT_EXTENSION},
-			{"SPQR:Resource:Extras.rPP", false, true, MTFT_EXTENSION},
-			{"SPQR:Resource:mCursors.cPP", false, true, MTFT_EXTENSION},
-			{"SPQR:SPQR PPC Start", false, true, MTFT_PLAYER},
-			{"SPQR:Data File SPQR", true, false, MTFT_MAIN},
-		};
-
-		Common::SharedPtr<Common::SeekableReadStream> installerDataForkStream(Common::MacResManager::openFileOrDataFork("Install.vct"));
-		if (!installerDataForkStream)
-			error("Failed to open SPQR installer");
-
-		Common::ScopedPtr<Common::Archive> archive(Common::createMacVISEArchive(installerDataForkStream.get()));
-
-		debug(1, "Unpacking files...");
-
-		for (const MacVISE3InstallerUnpackRequest &request : unpackRequests) {
-			Common::Path requestPath(request.fileName, ':');
-
-			Common::MacFinderInfo finfo;
-			if (!Common::MacResManager::getFileFinderInfo(requestPath, *archive, finfo))
-				error("Couldn't get Finder info for file '%s'", request.fileName);
-
-			FileIdentification ident;
-			ident.fileName = request.fileName;
-			ident.macCreator.value = MKTAG(finfo.creator[0], finfo.creator[1], finfo.creator[2], finfo.creator[3]);
-			ident.macType.value = MKTAG(finfo.type[0], finfo.type[1], finfo.type[2], finfo.type[3]);
-			ident.category = request.fileType;
-
-			if (request.extractResources) {
-				Common::SharedPtr<Common::MacResManager> resMan(new Common::MacResManager());
-				if (!resMan->open(requestPath, *archive))
-					error("Failed to open Mac res manager for file '%s'", request.fileName);
-
-				ident.resMan = resMan;
-			}
-
-			if (request.extractData)
-				ident.stream.reset(archive->createReadStreamForMember(requestPath));
-
-			files.push_back(ident);
-		}
-	}
-}
-
-class STTGSGameDataHandler : public GameDataHandler {
-public:
-	STTGSGameDataHandler(const Game &game, const MTropolisGameDescription &gameDesc);
-
-	void addPlugIns(ProjectDescription &projectDesc, const Common::Array<FileIdentification> &files) override;
-};
-
-STTGSGameDataHandler::STTGSGameDataHandler(const Game &game, const MTropolisGameDescription &gameDesc) : GameDataHandler(game, gameDesc) {
-}
-
-void STTGSGameDataHandler::addPlugIns(ProjectDescription &projectDesc, const Common::Array<FileIdentification> &files) {
-	Common::SharedPtr<MTropolis::PlugIn> standardPlugIn = PlugIns::createStandard();
-	static_cast<Standard::StandardPlugIn *>(standardPlugIn.get())->getHacks().allowGarbledListModData = true;
-	projectDesc.addPlugIn(standardPlugIn);
-}
-
-static bool fileSortCompare(const FileIdentification &a, const FileIdentification &b) {
-	// If file names are mismatched then we want the first one to be shorter
-	if (a.fileName.size() > b.fileName.size())
-		return !fileSortCompare(b, a);
-
-	size_t aSize = a.fileName.size();
-	for (size_t i = 0; i < aSize; i++) {
-		char ac = invariantToLower(a.fileName[i]);
-		char bc = invariantToLower(b.fileName[i]);
-
-		if (ac < bc)
-			return true;
-		if (bc < ac)
-			return false;
-	}
-
-	return aSize < b.fileName.size();
-}
-
 static void loadCursorsMac(Common::Archive &archive, const Common::Path &path, CursorGraphicCollection &cursorGraphics) {
 	Common::MacResManager resMan;
 


Commit: 66794328f0b7a188f5095f5bdc73753a19478c62
    https://github.com/scummvm/scummvm/commit/66794328f0b7a188f5095f5bdc73753a19478c62
Author: elasota (1137273+elasota at users.noreply.github.com)
Date: 2023-12-14T00:51:37-05:00

Commit Message:
MTROPOLIS: Exclude IgorServer file in Obsidian Japanese.  This file's data is intentionally wiped in the Steam/ZOOM re-release, so it can't be extracted, and it is unused.

Changed paths:
    engines/mtropolis/boot.cpp


diff --git a/engines/mtropolis/boot.cpp b/engines/mtropolis/boot.cpp
index 6e42b4afead..cbb9cd8abe9 100644
--- a/engines/mtropolis/boot.cpp
+++ b/engines/mtropolis/boot.cpp
@@ -1290,6 +1290,7 @@ void BootScriptContext::bootObsidianRetailMacJp() {
 	addJunction("Obsidian Data 6", "fs:Obsidian Data 6");
 
 	addExclusion("Obsidian Data 0");
+	addExclusion("Obsidian \xc4:Resource:\xcaIgorServer.rPP");	// Steam/ZOOM release wipes this file
 }
 
 void BootScriptContext::bootObsidianGeneric() {




More information about the Scummvm-git-logs mailing list