aboutsummaryrefslogtreecommitdiff
path: root/engines/scumm
diff options
context:
space:
mode:
authorTorbjörn Andersson2014-12-30 10:54:49 +0100
committerTorbjörn Andersson2014-12-30 10:54:49 +0100
commit7dc316cced4c7a45a376d76a6ca0c84bd563132f (patch)
treed56061a9d0a554f8da1d33465a64895271060598 /engines/scumm
parentcc916625d9025ffaa898854c4de19da5dc2e2925 (diff)
downloadscummvm-rg350-7dc316cced4c7a45a376d76a6ca0c84bd563132f.tar.gz
scummvm-rg350-7dc316cced4c7a45a376d76a6ca0c84bd563132f.tar.bz2
scummvm-rg350-7dc316cced4c7a45a376d76a6ca0c84bd563132f.zip
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...
Diffstat (limited to 'engines/scumm')
-rw-r--r--engines/scumm/scumm.cpp28
1 files 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()) {