aboutsummaryrefslogtreecommitdiff
path: root/base
diff options
context:
space:
mode:
authorWillem Jan Palenstijn2015-07-22 22:37:40 +0200
committerWillem Jan Palenstijn2015-07-22 22:43:42 +0200
commit6ec9c81b575f13b2c4b30aeac592ebf2557b5890 (patch)
tree503d50902bad2d800165593039d08d5ccf0c98ab /base
parent5ec05f6b647c5ea41418be7ed19ad381f97cabd8 (diff)
parent4e5c8d35f7e133e2e72a846fdbd54900c91eeb73 (diff)
downloadscummvm-rg350-6ec9c81b575f13b2c4b30aeac592ebf2557b5890.tar.gz
scummvm-rg350-6ec9c81b575f13b2c4b30aeac592ebf2557b5890.tar.bz2
scummvm-rg350-6ec9c81b575f13b2c4b30aeac592ebf2557b5890.zip
Merge branch 'master' into mm
Conflicts: engines/access/access.cpp engines/access/asurface.h engines/access/bubble_box.cpp engines/access/bubble_box.h engines/access/martian/martian_game.cpp engines/access/player.cpp engines/access/player.h engines/access/resources.cpp engines/access/screen.cpp engines/access/screen.h engines/access/sound.cpp engines/access/sound.h
Diffstat (limited to 'base')
-rw-r--r--base/main.cpp31
1 files changed, 27 insertions, 4 deletions
diff --git a/base/main.cpp b/base/main.cpp
index b5de7d94d2..3ea38b547a 100644
--- a/base/main.cpp
+++ b/base/main.cpp
@@ -523,22 +523,45 @@ extern "C" int scummvm_main(int argc, const char * const argv[]) {
}
#endif
+ // At this point, we usually return to the launcher. However, the
+ // game may have requested that one or more other games be "chained"
+ // to the current one, with optional save slots to start the games
+ // at. At the time of writing, this is used for the Maniac Mansion
+ // easter egg in Day of the Tentacle.
+
+ Common::String chainedGame;
+ int saveSlot = -1;
+
+ ChainedGamesMan.pop(chainedGame, saveSlot);
+
// Discard any command line options. It's unlikely that the user
// wanted to apply them to *all* games ever launched.
ConfMan.getDomain(Common::ConfigManager::kTransientDomain)->clear();
- // Clear the active config domain
- ConfMan.setActiveDomain("");
+ if (!chainedGame.empty()) {
+ if (saveSlot != -1) {
+ ConfMan.setInt("save_slot", saveSlot, Common::ConfigManager::kTransientDomain);
+ }
+ // Start the chained game
+ ConfMan.setActiveDomain(chainedGame);
+ } else {
+ // Clear the active config domain
+ ConfMan.setActiveDomain("");
+ }
PluginManager::instance().loadAllPlugins(); // only for cached manager
-
} else {
GUI::displayErrorDialog(_("Could not find any engine capable of running the selected game"));
+
+ // Clear the active domain
+ ConfMan.setActiveDomain("");
}
// reset the graphics to default
setupGraphics(system);
- launcherDialog();
+ if (0 == ConfMan.getActiveDomain()) {
+ launcherDialog();
+ }
}
PluginManager::instance().unloadAllPlugins();
PluginManager::destroy();