aboutsummaryrefslogtreecommitdiff
path: root/engines/gob
diff options
context:
space:
mode:
authorSven Hesse2009-08-02 13:54:06 +0000
committerSven Hesse2009-08-02 13:54:06 +0000
commitb9263e172f8fe0aaca54d238818c6e01f00ddf17 (patch)
tree71be268e13238a97a3eb2f497cf69b3db19e0e86 /engines/gob
parent836c9a37f3576942be39bb66d1be4d67044ae505 (diff)
downloadscummvm-rg350-b9263e172f8fe0aaca54d238818c6e01f00ddf17.tar.gz
scummvm-rg350-b9263e172f8fe0aaca54d238818c6e01f00ddf17.tar.bz2
scummvm-rg350-b9263e172f8fe0aaca54d238818c6e01f00ddf17.zip
Show a message if saving or loading a game fails.
svn-id: r43001
Diffstat (limited to 'engines/gob')
-rw-r--r--engines/gob/inter_v2.cpp22
1 files changed, 20 insertions, 2 deletions
diff --git a/engines/gob/inter_v2.cpp b/engines/gob/inter_v2.cpp
index 09bb212bbf..19cac86465 100644
--- a/engines/gob/inter_v2.cpp
+++ b/engines/gob/inter_v2.cpp
@@ -25,6 +25,8 @@
#include "common/endian.h"
+#include "gui/message.h"
+
#include "sound/mixer.h"
#include "sound/mods/infogrames.h"
@@ -1357,10 +1359,19 @@ bool Inter_v2::o2_readData(OpFuncParams &params) {
mode = _vm->_saveLoad->getSaveMode(file);
if (mode == SaveLoad::kSaveModeSave) {
+
WRITE_VAR(1, 1);
- if (_vm->_saveLoad->load(file, dataVar, size, offset))
+
+ if (!_vm->_saveLoad->load(file, dataVar, size, offset)) {
+
+ GUI::MessageDialog dialog("Failed to load game state from file.");
+ dialog.runModal();
+
+ } else
WRITE_VAR(1, 0);
+
return false;
+
} else if (mode == SaveLoad::kSaveModeIgnore)
return false;
@@ -1431,8 +1442,15 @@ bool Inter_v2::o2_writeData(OpFuncParams &params) {
mode = _vm->_saveLoad->getSaveMode(file);
if (mode == SaveLoad::kSaveModeSave) {
- if (_vm->_saveLoad->save(file, dataVar, size, offset))
+
+ if (!_vm->_saveLoad->save(file, dataVar, size, offset)) {
+
+ GUI::MessageDialog dialog("Failed to save game state to file.");
+ dialog.runModal();
+
+ } else
WRITE_VAR(1, 0);
+
} else if (mode == SaveLoad::kSaveModeNone)
warning("Attempted to write to file \"%s\"", file);