diff options
author | Colin Snover | 2017-02-15 12:32:50 -0600 |
---|---|---|
committer | Colin Snover | 2017-04-22 19:28:35 -0500 |
commit | 2ccef4a4768c7f7574a7be0637e3791dc0e9d6ff (patch) | |
tree | efa62ec6229720e6a5c2b4de4867947fee4d86bb /engines/sci/engine | |
parent | 6c441060830b62eb6a151240adc53433dc02ef03 (diff) | |
download | scummvm-rg350-2ccef4a4768c7f7574a7be0637e3791dc0e9d6ff.tar.gz scummvm-rg350-2ccef4a4768c7f7574a7be0637e3791dc0e9d6ff.tar.bz2 scummvm-rg350-2ccef4a4768c7f7574a7be0637e3791dc0e9d6ff.zip |
SCI32: Implement support for QFG4 autosave
Diffstat (limited to 'engines/sci/engine')
-rw-r--r-- | engines/sci/engine/kfile.cpp | 15 |
1 files changed, 15 insertions, 0 deletions
diff --git a/engines/sci/engine/kfile.cpp b/engines/sci/engine/kfile.cpp index 9de6cf840d..2ef2d76a62 100644 --- a/engines/sci/engine/kfile.cpp +++ b/engines/sci/engine/kfile.cpp @@ -42,6 +42,7 @@ #include "sci/console.h" #ifdef ENABLE_SCI32 #include "sci/engine/guest_additions.h" +#include "sci/engine/message.h" #include "sci/resource.h" #endif @@ -1199,6 +1200,20 @@ reg_t kSaveGame32(EngineState *s, int argc, reg_t *argv) { saveNo += kSaveIdShift; } + // Auto-save system used by QFG4 + if (g_sci->getGameId() == GID_QFG4) { + reg_t autoSaveNameId; + SciArray &autoSaveName = *s->_segMan->allocateArray(kArrayTypeString, 0, &autoSaveNameId); + MessageTuple autoSaveNameTuple(0, 0, 16, 1); + s->_msgState->getMessage(0, autoSaveNameTuple, autoSaveNameId); + + if (saveDescription == autoSaveName.toString()) { + saveNo = 0; + } + + s->_segMan->freeArray(autoSaveNameId); + } + Common::SaveFileManager *saveFileMan = g_sci->getSaveFileManager(); const Common::String filename = g_sci->getSavegameName(saveNo); Common::OutSaveFile *saveStream = saveFileMan->openForSaving(filename); |