From 7dc316cced4c7a45a376d76a6ca0c84bd563132f Mon Sep 17 00:00:00 2001 From: Torbjörn Andersson Date: Tue, 30 Dec 2014 10:54:49 +0100 Subject: SCUMM: Add secret "easter_egg" config key This makes it possible to override the detection of Maniac Mansion when starting the Day of the Tentacle easter egg. There is no GUI for setting this, no error handling, and setting it to Day of the Tentacle itself is probably a bad idea... --- engines/scumm/scumm.cpp | 28 ++++++++++++++++------------ 1 file changed, 16 insertions(+), 12 deletions(-) diff --git a/engines/scumm/scumm.cpp b/engines/scumm/scumm.cpp index 9518ed4e5c..7d927b0cda 100644 --- a/engines/scumm/scumm.cpp +++ b/engines/scumm/scumm.cpp @@ -2601,20 +2601,24 @@ bool ScummEngine::startManiac() { Common::String currentPath = ConfMan.get("path"); Common::String maniacTarget; - // Look for a game with a game path pointing to a 'Maniac' directory - // as a subdirectory to the current game. - Common::ConfigManager::DomainMap::iterator iter = ConfMan.beginGameDomains(); - for (; iter != ConfMan.endGameDomains(); ++iter) { - Common::ConfigManager::Domain &dom = iter->_value; - Common::String path = dom.getVal("path"); - - if (path.hasPrefix(currentPath)) { - path.erase(0, currentPath.size() + 1); - if (path.equalsIgnoreCase("maniac")) { - maniacTarget = dom.getVal("gameid"); - break; + if (!ConfMan.hasKey("easter_egg")) { + // Look for a game with a game path pointing to a 'Maniac' directory + // as a subdirectory to the current game. + Common::ConfigManager::DomainMap::iterator iter = ConfMan.beginGameDomains(); + for (; iter != ConfMan.endGameDomains(); ++iter) { + Common::ConfigManager::Domain &dom = iter->_value; + Common::String path = dom.getVal("path"); + + if (path.hasPrefix(currentPath)) { + path.erase(0, currentPath.size() + 1); + if (path.equalsIgnoreCase("maniac")) { + maniacTarget = dom.getVal("gameid"); + break; + } } } + } else { + maniacTarget = ConfMan.get("easter_egg"); } if (!maniacTarget.empty()) { -- cgit v1.2.3