From b9263e172f8fe0aaca54d238818c6e01f00ddf17 Mon Sep 17 00:00:00 2001 From: Sven Hesse Date: Sun, 2 Aug 2009 13:54:06 +0000 Subject: Show a message if saving or loading a game fails. svn-id: r43001 --- engines/gob/inter_v2.cpp | 22 ++++++++++++++++++++-- 1 file changed, 20 insertions(+), 2 deletions(-) (limited to 'engines/gob') 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 ¶ms) { 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 ¶ms) { 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); -- cgit v1.2.3