diff options
author | Filippos Karapetis | 2014-12-26 18:22:18 +0200 |
---|---|---|
committer | Filippos Karapetis | 2014-12-26 18:22:18 +0200 |
commit | e5f0ee2271f4a43ff05b82380ab22eade9763702 (patch) | |
tree | 532f71c8140cf5d98375330b2198c72998ac9695 /engines/zvision/file/save_manager.cpp | |
parent | eea1ee445fcac7ecc53e31d258aac697d6b242f1 (diff) | |
download | scummvm-rg350-e5f0ee2271f4a43ff05b82380ab22eade9763702.tar.gz scummvm-rg350-e5f0ee2271f4a43ff05b82380ab22eade9763702.tar.bz2 scummvm-rg350-e5f0ee2271f4a43ff05b82380ab22eade9763702.zip |
ZVISION: Implement auto-saving
Diffstat (limited to 'engines/zvision/file/save_manager.cpp')
-rw-r--r-- | engines/zvision/file/save_manager.cpp | 14 |
1 files changed, 5 insertions, 9 deletions
diff --git a/engines/zvision/file/save_manager.cpp b/engines/zvision/file/save_manager.cpp index 05df834497..042fafd38e 100644 --- a/engines/zvision/file/save_manager.cpp +++ b/engines/zvision/file/save_manager.cpp @@ -87,6 +87,8 @@ void SaveManager::saveGame(uint slot, const Common::String &saveName) { file->finalize(); delete file; + + _lastSaveTime = g_system->getMillis(); } void SaveManager::saveGame(uint slot, const Common::String &saveName, Common::MemoryWriteStreamDynamic *stream) { @@ -99,6 +101,8 @@ void SaveManager::saveGame(uint slot, const Common::String &saveName, Common::Me file->finalize(); delete file; + + _lastSaveTime = g_system->getMillis(); } void SaveManager::saveGameBuffered(uint slot, const Common::String &saveName) { @@ -109,15 +113,7 @@ void SaveManager::saveGameBuffered(uint slot, const Common::String &saveName) { } void SaveManager::autoSave() { - Common::OutSaveFile *file = g_system->getSavefileManager()->openForSaving(_engine->generateAutoSaveFileName()); - - writeSaveGameHeader(file, "auto"); - - _engine->getScriptManager()->serialize(file); - - // Cleanup - file->finalize(); - delete file; + saveGame(0, "Auto save"); } void SaveManager::writeSaveGameHeader(Common::OutSaveFile *file, const Common::String &saveName) { |