diff options
author | David Corrales | 2007-08-05 19:34:20 +0000 |
---|---|---|
committer | David Corrales | 2007-08-05 19:34:20 +0000 |
commit | 6856535010bd2fa4449bcfde1c88dc06cd46e26f (patch) | |
tree | b81a2234c2beff0312c93e039d6cafda4babeca6 /engines/agi/saveload.cpp | |
parent | 1400d28bfb37fc94f3c44dec0a4d0cef65fb8fb7 (diff) | |
parent | ec1803f838d5efc7decf75c05a1fb4a9633751e5 (diff) | |
download | scummvm-rg350-6856535010bd2fa4449bcfde1c88dc06cd46e26f.tar.gz scummvm-rg350-6856535010bd2fa4449bcfde1c88dc06cd46e26f.tar.bz2 scummvm-rg350-6856535010bd2fa4449bcfde1c88dc06cd46e26f.zip |
Merged fsnode with trunk: r27971:28460
svn-id: r28462
Diffstat (limited to 'engines/agi/saveload.cpp')
-rw-r--r-- | engines/agi/saveload.cpp | 26 |
1 files changed, 16 insertions, 10 deletions
diff --git a/engines/agi/saveload.cpp b/engines/agi/saveload.cpp index 9144dae96c..05ce80b1a3 100644 --- a/engines/agi/saveload.cpp +++ b/engines/agi/saveload.cpp @@ -55,6 +55,7 @@ int AgiEngine::saveGame(const char *fileName, const char *description) { int i; struct ImageStackElement *ptr = _imageStack; Common::OutSaveFile *out; + int result = errOK; debugC(3, kDebugLevelMain | kDebugLevelSavegame, "AgiEngine::saveGame(%s, %s)", fileName, description); if (!(out = _saveFileMan->openForSaving(fileName))) { @@ -206,14 +207,15 @@ int AgiEngine::saveGame(const char *fileName, const char *description) { out->writeSint16BE(_gfx->getAGIPalFileNum()); out->finalize(); - if (out->ioFailed()) + if (out->ioFailed()) { warning("Can't write file '%s'. (Disk full?)", fileName); - else + result = errIOError; + } else debugC(1, kDebugLevelMain | kDebugLevelSavegame, "Saved game %s in file %s", description, fileName); delete out; debugC(3, kDebugLevelMain | kDebugLevelSavegame, "Closed %s", fileName); - return errOK; + return result; } int AgiEngine::loadGame(const char *fileName, bool checkId) { @@ -516,7 +518,7 @@ int AgiEngine::selectSlot() { buttonY = (vm + 17) * CHAR_LINES; for (i = 0; i < 2; i++) - _gfx->drawButton(buttonX[i], buttonY, buttonText[i], 0, 0, MSG_BOX_TEXT, MSG_BOX_COLOUR); + _gfx->drawCurrentStyleButton(buttonX[i], buttonY, buttonText[i], false, false, i == 0); AllowSyntheticEvents on(this); int oldFirstSlot = _firstSlot + 1; @@ -751,20 +753,24 @@ int AgiEngine::saveGameDialog() { sprintf(fileName, "%s", getSavegameFilename(slot)); debugC(8, kDebugLevelMain | kDebugLevelResources, "file is [%s]", fileName); - saveGame(fileName, desc); + int result = saveGame(fileName, desc); - messageBox("Game saved."); + if (result == errOK) + messageBox("Game saved."); + else + messageBox("Error saving game."); - return errOK; + return result; } int AgiEngine::saveGameSimple() { char fileName[MAX_PATH]; sprintf(fileName, "%s", getSavegameFilename(0)); - saveGame(fileName, "Default savegame"); - - return errOK; + int result = saveGame(fileName, "Default savegame"); + if (result != errOK) + messageBox("Error saving game."); + return result; } int AgiEngine::loadGameDialog() { |