diff options
author | Marcus Comstedt | 2002-12-06 01:30:57 +0000 |
---|---|---|
committer | Marcus Comstedt | 2002-12-06 01:30:57 +0000 |
commit | bc36f7144a5ac41202108367f0e29b08f1eebb21 (patch) | |
tree | 1bee4fec4ec9b6d0bab6a33f9dedb70976a2f8fc | |
parent | 05ff6451fc4b25de9bc01f572959b356ec9cf282 (diff) | |
download | scummvm-rg350-bc36f7144a5ac41202108367f0e29b08f1eebb21.tar.gz scummvm-rg350-bc36f7144a5ac41202108367f0e29b08f1eebb21.tar.bz2 scummvm-rg350-bc36f7144a5ac41202108367f0e29b08f1eebb21.zip |
Display status after saving.
svn-id: r5850
-rw-r--r-- | backends/dc/vmsave.cpp | 34 |
1 files changed, 32 insertions, 2 deletions
diff --git a/backends/dc/vmsave.cpp b/backends/dc/vmsave.cpp index cbfc3785e6..2bfd2278dd 100644 --- a/backends/dc/vmsave.cpp +++ b/backends/dc/vmsave.cpp @@ -26,6 +26,8 @@ #include "dc.h" #include "icon.h" #include <scumm/saveload.h> +#include <gui/newgui.h> +#include <gui/message.h> #include <ronin/zlib.h> @@ -44,6 +46,34 @@ enum vmsaveResult { static int lastvm=-1; +static void displaySaveResult(vmsaveResult res) +{ + extern NewGui *g_gui; + char buf[1024]; + + switch(res) { + case VMSAVE_OK: + sprintf(buf, "Game saved on unit %c%d", 'A'+(lastvm/6), lastvm%6); + break; + case VMSAVE_NOVM: + strcpy(buf, "No memory card present!"); + break; + case VMSAVE_NOSPACE: + strcpy(buf, "Not enough space available!"); + break; + case VMSAVE_WRITEERROR: + strcpy(buf, "Write error!!!"); + break; + default: + strcpy(buf, "Unknown error!!!"); + break; + } + + Dialog *dialog = new MessageDialog(g_gui, buf); + dialog->runModal(); + delete dialog; +} + static vmsaveResult trySave(const char *gamename, const char *data, int size, const char *filename, class Icon &icon, int vm) { @@ -216,8 +246,8 @@ void SerializerStream::fclose() c->pos = destlen; } else delete compbuf; } - writeSaveGame(gGameName, c->buffer, c->pos, - c->filename, icon); + displaySaveResult(writeSaveGame(gGameName, c->buffer, + c->pos, c->filename, icon)); } delete c->buffer; delete c; |