From 37791c4bd3b33aa042fc966d4ed2b1f5369b0939 Mon Sep 17 00:00:00 2001 From: David Fioramonti Date: Sat, 19 May 2018 12:46:36 -0700 Subject: MOHAWK: RIVEN: Add Autosave Support The game will autosave to slot 0 using the save period given in the scummvm config file. Or when the user quits. Autosaves are only allowed when an autosave is in slot 0, there is no save in slot 0, or there is a save, but it is corrupt. This will not override any saves the player has previously put in save slot 0. If there is a save in slot 0 that is not an autosave then there will be no autosaving. --- engines/mohawk/riven_saveload.h | 9 +++++++-- 1 file changed, 7 insertions(+), 2 deletions(-) (limited to 'engines/mohawk/riven_saveload.h') diff --git a/engines/mohawk/riven_saveload.h b/engines/mohawk/riven_saveload.h index 34bfbdc434..1432505b02 100644 --- a/engines/mohawk/riven_saveload.h +++ b/engines/mohawk/riven_saveload.h @@ -49,6 +49,8 @@ struct RivenSaveMetadata { uint32 totalPlayTime; + bool autoSave; + Common::String saveDescription; RivenSaveMetadata(); @@ -57,11 +59,14 @@ struct RivenSaveMetadata { class RivenSaveLoad { public: + static const int kAutoSaveSlot; + RivenSaveLoad(MohawkEngine_Riven*, Common::SaveFileManager*); ~RivenSaveLoad(); Common::Error loadGame(const int slot); - Common::Error saveGame(const int slot, const Common::String &description); + Common::Error saveGame(const int slot, const Common::String &description, bool autoSave); + bool isAutoSaveAllowed(); static void deleteSave(const int slot); static SaveStateDescriptor querySaveMetaInfos(const int slot); @@ -74,7 +79,7 @@ private: static Common::String buildSaveFilename(const int slot); Common::MemoryWriteStreamDynamic *genNAMESection(); - Common::MemoryWriteStreamDynamic *genMETASection(const Common::String &desc) const; + Common::MemoryWriteStreamDynamic *genMETASection(const Common::String &desc, bool autoSave) const; Common::MemoryWriteStreamDynamic *genTHMBSection() const; Common::MemoryWriteStreamDynamic *genVARSSection(); Common::MemoryWriteStreamDynamic *genVERSSection(); -- cgit v1.2.3