mirror of
https://github.com/libretro/scummvm.git
synced 2024-12-13 21:31:53 +00:00
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)
svn-id: r47318
This commit is contained in:
parent
c4a9d373ca
commit
22e8b3ed02
@ -288,6 +288,8 @@ int game_init(EngineState *s) {
|
||||
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));
|
||||
|
||||
|
@ -474,6 +474,36 @@ int ResourceManager::addInternalSources() {
|
||||
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;
|
||||
|
@ -274,6 +274,14 @@ public:
|
||||
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
|
||||
|
Loading…
Reference in New Issue
Block a user