From 645625a89a804ee2a2cf3b669eebf852691659c6 Mon Sep 17 00:00:00 2001 From: Vladimir Serbinenko Date: Fri, 10 Mar 2023 17:51:21 +0100 Subject: [PATCH] SCUMM: Support playing most RuSCUMM versions without patching manually --- engines/scumm/scumm.cpp | 18 ++++++++++++++++++ 1 file changed, 18 insertions(+) diff --git a/engines/scumm/scumm.cpp b/engines/scumm/scumm.cpp index 6a0522c07344..55a35c689f2a 100644 --- a/engines/scumm/scumm.cpp +++ b/engines/scumm/scumm.cpp @@ -20,6 +20,7 @@ */ #include "common/config-manager.h" +#include "common/compression/clickteam.h" #include "common/debug-channels.h" #include "common/macresman.h" #include "common/md5.h" @@ -40,6 +41,7 @@ #include "scumm/charset.h" #include "scumm/costume.h" #include "scumm/debugger.h" +#include "scumm/detection_tables.h" #include "scumm/dialogs.h" #include "scumm/file.h" #include "scumm/file_nes.h" @@ -888,6 +890,22 @@ Common::Error ScummEngine::init() { const Common::FSNode gameDataDir(ConfMan.get("path")); + for (uint i = 0; ruScummPatcherTable[i].patcherName; i++) { + if (ruScummPatcherTable[i].gameid == _game.id && (_game.variant == nullptr || strcmp(_game.variant, ruScummPatcherTable[i].variant) == 0)) { + Common::File *f = new Common::File(); + if (f->open(ruScummPatcherTable[i].patcherName)) { + Common::Archive *patcher = Common::ClickteamInstaller::openPatch(f, Common::ClickteamInstaller::ClickteamVersion::MANIAC_MANSION_PRCA, + true, true, &SearchMan, DisposeAfterUse::YES); + if (patcher) { + SearchMan.add("ruscumm", patcher, 2); + break; + } + } + delete f; + } + } + + ConfMan.registerDefault("original_gui", true); if (ConfMan.hasKey("original_gui", _targetName)) { _useOriginalGUI = ConfMan.getBool("original_gui");