diff options
author | Paul Gilbert | 2007-12-10 09:40:49 +0000 |
---|---|---|
committer | Paul Gilbert | 2007-12-10 09:40:49 +0000 |
commit | 1af72d09712fe3a6f3f1cec6f5b98d12b59882ce (patch) | |
tree | b8d8ae36b8fa8f94660255d8eda22df4c9cac17a /engines/lure | |
parent | 2b3d1663da2187f8728cd53352b1e56792bcd2a8 (diff) | |
download | scummvm-rg350-1af72d09712fe3a6f3f1cec6f5b98d12b59882ce.tar.gz scummvm-rg350-1af72d09712fe3a6f3f1cec6f5b98d12b59882ce.tar.bz2 scummvm-rg350-1af72d09712fe3a6f3f1cec6f5b98d12b59882ce.zip |
Changed over warning messages for save/load errors from the debug console to their own dialog
svn-id: r29814
Diffstat (limited to 'engines/lure')
-rw-r--r-- | engines/lure/lure.cpp | 8 | ||||
-rw-r--r-- | engines/lure/surface.cpp | 20 |
2 files changed, 20 insertions, 8 deletions
diff --git a/engines/lure/lure.cpp b/engines/lure/lure.cpp index e65855420b..8a139ddd5a 100644 --- a/engines/lure/lure.cpp +++ b/engines/lure/lure.cpp @@ -167,10 +167,8 @@ const char *LureEngine::generateSaveName(int slotNumber) { bool LureEngine::saveGame(uint8 slotNumber, Common::String &caption) { Common::WriteStream *f = this->_saveFileMan->openForSaving( generateSaveName(slotNumber)); - if (f == NULL) { - warning("saveGame: Failed to save slot %d", slotNumber); + if (f == NULL) return false; - } f->write("lure", 5); f->writeByte(getLanguage()); @@ -193,10 +191,8 @@ bool LureEngine::saveGame(uint8 slotNumber, Common::String &caption) { bool LureEngine::loadGame(uint8 slotNumber) { Common::ReadStream *f = this->_saveFileMan->openForLoading( generateSaveName(slotNumber)); - if (f == NULL) { - warning(FAILED_MSG, slotNumber); + if (f == NULL) return false; - } // Check for header char buffer[5]; diff --git a/engines/lure/surface.cpp b/engines/lure/surface.cpp index 99e6256821..a5ee93dd09 100644 --- a/engines/lure/surface.cpp +++ b/engines/lure/surface.cpp @@ -852,12 +852,18 @@ bool SaveRestoreDialog::show(bool saveDialog) { delete s; Sound.resume(); + int errorFlag = 0; if (doneFlag) { // Handle save or restore - if (saveDialog) + if (saveDialog) { doneFlag = engine.saveGame(selectedLine + 1, *saveNames[selectedLine]); - else + if (!doneFlag) + errorFlag = 1; + } else { doneFlag = engine.loadGame(selectedLine + 1); + if (!doneFlag) + errorFlag = 2; + } } mouse.popCursor(); @@ -866,6 +872,16 @@ bool SaveRestoreDialog::show(bool saveDialog) { for (index = 0; index < numSaves; ++index) delete saveNames[index]; Memory::dealloc(saveNames); + if (errorFlag != 0) { + Room::getReference().update(); + screen.update(); + + if (errorFlag == 1) + Dialog::show("Error occurred saving the game"); + else if (errorFlag == 2) + Dialog::show("Error occurred loading the savegame"); + } + return doneFlag; } |