aboutsummaryrefslogtreecommitdiff
path: root/engines/engine.cpp
diff options
context:
space:
mode:
authorD G Turner2012-02-21 22:30:29 +0000
committerD G Turner2012-02-21 22:30:29 +0000
commitaa26d5def4265d496c03ef81fb2aa128020b08d4 (patch)
treeb84bb88c601c92c5bda73f37fba0ec0ebe0c1760 /engines/engine.cpp
parent7986f1709d77a84df92ba86ecf04a0cb1e88e0cf (diff)
downloadscummvm-rg350-aa26d5def4265d496c03ef81fb2aa128020b08d4.tar.gz
scummvm-rg350-aa26d5def4265d496c03ef81fb2aa128020b08d4.tar.bz2
scummvm-rg350-aa26d5def4265d496c03ef81fb2aa128020b08d4.zip
ENGINES: Add error handling for GMM Gamestate Load/Save Usage.
As indicated by wjp, the Global Main Menu (GMM) did not check or report on the returned error state from saveGameState() and loadGameState() usage. This corrects this and adds a MessageDialog report of any failure.
Diffstat (limited to 'engines/engine.cpp')
-rw-r--r--engines/engine.cpp16
1 files changed, 10 insertions, 6 deletions
diff --git a/engines/engine.cpp b/engines/engine.cpp
index 4811ba6917..2ef4ecab60 100644
--- a/engines/engine.cpp
+++ b/engines/engine.cpp
@@ -420,12 +420,16 @@ void Engine::openMainMenuDialog() {
// (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);
+ if (_saveSlotToLoad >= 0) {
+ Common::Error status = loadGameState(_saveSlotToLoad);
+ if (status.getCode() != Common::kNoError) {
+ Common::String failMessage = Common::String::format(_("Gamestate load failed (%s)! "
+ "Please consult the README for basic information, and for "
+ "instructions on how to obtain further assistance."), status.getDesc().c_str());
+ GUI::MessageDialog dialog(failMessage);
+ dialog.runModal();
+ }
+ }
syncSoundSettings();
}