aboutsummaryrefslogtreecommitdiff
path: root/engines/engine.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'engines/engine.cpp')
-rw-r--r--engines/engine.cpp31
1 files changed, 31 insertions, 0 deletions
diff --git a/engines/engine.cpp b/engines/engine.cpp
index dc30b4bd0d..b19daa2611 100644
--- a/engines/engine.cpp
+++ b/engines/engine.cpp
@@ -96,6 +96,7 @@ Engine::Engine(OSystem *syst)
_targetName(ConfMan.getActiveDomainName()),
_pauseLevel(0),
_pauseStartTime(0),
+ _saveSlotToLoad(-1),
_engineStartTime(_system->getMillis()),
_mainMenuDialog(NULL) {
@@ -396,10 +397,36 @@ void Engine::pauseEngineIntern(bool pause) {
void Engine::openMainMenuDialog() {
if (!_mainMenuDialog)
_mainMenuDialog = new MainMenuDialog(this);
+
+ setGameToLoadSlot(-1);
+
runDialog(*_mainMenuDialog);
+
+ // Load savegame after main menu execution
+ // (not from inside the menu loop to avoid
+ // mouse cursor glitches and simliar bugs,
+ // e.g. #2822778).
+ // FIXME: For now we just ignore the return
+ // value, which is quite bad since it could
+ // be a fatal loading error, which renders
+ // the engine unusable.
+ if (_saveSlotToLoad >= 0)
+ loadGameState(_saveSlotToLoad);
+
syncSoundSettings();
}
+bool Engine::warnUserAboutUnsupportedGame() {
+ if (ConfMan.getBool("enable_unsupported_game_warning")) {
+ GUI::MessageDialog alert(_("WARNING: The game you are about to start is"
+ " not yet fully supported by ScummVM. As such, it is likely to be"
+ " unstable, and any saves you make might not work in future"
+ " versions of ScummVM."), _("Start anyway"), _("Cancel"));
+ return alert.runModal() == GUI::kMessageOK;
+ }
+ return true;
+}
+
uint32 Engine::getTotalPlayTime() const {
if (!_pauseLevel)
return _system->getMillis() - _engineStartTime;
@@ -426,6 +453,10 @@ int Engine::runDialog(GUI::Dialog &dialog) {
return result;
}
+void Engine::setGameToLoadSlot(int slot) {
+ _saveSlotToLoad = slot;
+}
+
void Engine::syncSoundSettings() {
// Sync the engine with the config manager
int soundVolumeMusic = ConfMan.getInt("music_volume");