[Scummvm-cvs-logs] SF.net SVN: scummvm:[47318] scummvm/trunk/engines/sci
thebluegr at users.sourceforge.net
thebluegr at users.sourceforge.net
Sat Jan 16 01:22:28 CET 2010
Revision: 47318
http://scummvm.svn.sourceforge.net/scummvm/?rev=47318&view=rev
Author: thebluegr
Date: 2010-01-16 00:22:22 +0000 (Sat, 16 Jan 2010)
Log Message:
-----------
The GM patches from Sierra's GM utility can now also be processed with their original names. Thus, the user can just extract the patches from Sierra's GM utility in the extras folder, and it's not necessary to rename each individual file to "4.pat" and place it inside the associated game (works with the games that Sierra's GM patch updates, i.e. LSL1, LSL5, Hoyle3, SQ1, SQ4, Eco1, Longbow and Fairy tales)
Modified Paths:
--------------
scummvm/trunk/engines/sci/engine/game.cpp
scummvm/trunk/engines/sci/resource.cpp
scummvm/trunk/engines/sci/resource.h
Modified: scummvm/trunk/engines/sci/engine/game.cpp
===================================================================
--- scummvm/trunk/engines/sci/engine/game.cpp 2010-01-15 23:35:24 UTC (rev 47317)
+++ scummvm/trunk/engines/sci/engine/game.cpp 2010-01-16 00:22:22 UTC (rev 47318)
@@ -288,6 +288,8 @@
s->_gameObj = s->_segMan->lookupScriptExport(0, 0);
uint32 gameFlags = 0; // unused
s->_gameId = convertSierraGameId(s->_segMan->getObjectName(s->_gameObj), &gameFlags, s->resMan);
+ // Add the after market GM patches for the specified game, if they exist
+ s->resMan->addNewGMPatch(s->_gameId);
debug(2, " \"%s\" at %04x:%04x", s->_gameId.c_str(), PRINT_REG(s->_gameObj));
Modified: scummvm/trunk/engines/sci/resource.cpp
===================================================================
--- scummvm/trunk/engines/sci/resource.cpp 2010-01-15 23:35:24 UTC (rev 47317)
+++ scummvm/trunk/engines/sci/resource.cpp 2010-01-16 00:22:22 UTC (rev 47318)
@@ -474,6 +474,36 @@
return 1;
}
+void ResourceManager::addNewGMPatch(Common::String gameId) {
+ Common::String gmPatchFile;
+
+ if (gameId == "ecoquest")
+ gmPatchFile = "ECO1GM.PAT";
+ else if (gameId == "hoyle3")
+ gmPatchFile = "HOY3GM.PAT";
+ else if (gameId == "hoyle3")
+ gmPatchFile = "HOY3GM.PAT";
+ else if (gameId == "lsl1sci")
+ gmPatchFile = "LL1_GM.PAT";
+ else if (gameId == "lsl5")
+ gmPatchFile = "LL5_GM.PAT";
+ else if (gameId == "longbow")
+ gmPatchFile = "ROBNGM.PAT";
+ else if (gameId == "sq1sci")
+ gmPatchFile = "SQ1_GM.PAT";
+ else if (gameId == "sq4")
+ gmPatchFile = "SQ4_GM.PAT";
+ else if (gameId == "fairytales")
+ gmPatchFile = "TALEGM.PAT";
+
+ if (!gmPatchFile.empty() && Common::File::exists(gmPatchFile)) {
+ ResourceSource *psrcPatch = new ResourceSource;
+ psrcPatch->source_type = kSourcePatch;
+ psrcPatch->location_name = gmPatchFile;
+ processPatch(psrcPatch, kResourceTypePatch, 4);
+ }
+}
+
void ResourceManager::scanNewSources() {
for (Common::List<ResourceSource *>::iterator it = _sources.begin(); it != _sources.end(); ++it) {
ResourceSource *source = *it;
Modified: scummvm/trunk/engines/sci/resource.h
===================================================================
--- scummvm/trunk/engines/sci/resource.h 2010-01-15 23:35:24 UTC (rev 47317)
+++ scummvm/trunk/engines/sci/resource.h 2010-01-16 00:22:22 UTC (rev 47318)
@@ -274,6 +274,14 @@
ViewType getViewType() const { return _viewType; }
const char *getMapVersionDesc() const { return versionDescription(_mapVersion); }
const char *getVolVersionDesc() const { return versionDescription(_volVersion); }
+
+ /**
+ * Adds the appropriate GM patch from the Sierra MIDI utility as 4.pat, without
+ * requiring the user to rename the file to 4.pat. Thus, the original Sierra
+ * archive can be extracted in the extras directory, and the GM patches can be
+ * applied per game, if applicable
+ */
+ void addNewGMPatch(Common::String gameId);
protected:
// Maximum number of bytes to allow being allocated for resources
This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site.
More information about the Scummvm-git-logs
mailing list