diff options
author | Torbjörn Andersson | 2009-08-02 12:49:57 +0000 |
---|---|---|
committer | Torbjörn Andersson | 2009-08-02 12:49:57 +0000 |
commit | 836c9a37f3576942be39bb66d1be4d67044ae505 (patch) | |
tree | 5cd18643a9b0877d9463f4a9875f54f8f8456d12 /engines | |
parent | 87124b1d388ff1294a7f13c0cecc4bee01cf7427 (diff) | |
download | scummvm-rg350-836c9a37f3576942be39bb66d1be4d67044ae505.tar.gz scummvm-rg350-836c9a37f3576942be39bb66d1be4d67044ae505.tar.bz2 scummvm-rg350-836c9a37f3576942be39bb66d1be4d67044ae505.zip |
Show a message if saving or loading a game fails.
svn-id: r42999
Diffstat (limited to 'engines')
-rw-r--r-- | engines/tinsel/saveload.cpp | 21 |
1 files changed, 16 insertions, 5 deletions
diff --git a/engines/tinsel/saveload.cpp b/engines/tinsel/saveload.cpp index efa6e0c8a8..0069778531 100644 --- a/engines/tinsel/saveload.cpp +++ b/engines/tinsel/saveload.cpp @@ -37,6 +37,8 @@ #include "common/serializer.h" #include "common/savefile.h" +#include "gui/message.h" + namespace Tinsel { @@ -452,6 +454,11 @@ static bool DoRestore() { delete f; + if (failed) { + GUI::MessageDialog dialog("Failed to load game state from file."); + dialog.runModal(); + } + return !failed; } @@ -473,11 +480,11 @@ static void DoSave(void) { fname = SaveSceneName; f = _vm->getSaveFileMan()->openForSaving(fname); - if (f == NULL) - return; - Common::Serializer s(0, f); + if (f == NULL) + goto save_failure; + // Write out a savegame header SaveGameHeader hdr; hdr.id = SAVEGAME_ID; @@ -502,8 +509,12 @@ static void DoSave(void) { return; save_failure: - delete f; - _vm->getSaveFileMan()->removeSavefile(fname); + if (f) { + delete f; + _vm->getSaveFileMan()->removeSavefile(fname); + } + GUI::MessageDialog dialog("Failed to save game state to file."); + dialog.runModal(); } /** |