aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorRichieSams2013-09-16 22:10:26 -0500
committerRichieSams2013-09-16 22:10:26 -0500
commit5ec472ae2fc5d391714617457ec01c24d67057c2 (patch)
tree1a914e46f1937ef61633660ffd8de8d41bb42f7c
parentb5c762168edd83a6c5e1b442aee728150b447d98 (diff)
downloadscummvm-rg350-5ec472ae2fc5d391714617457ec01c24d67057c2.tar.gz
scummvm-rg350-5ec472ae2fc5d391714617457ec01c24d67057c2.tar.bz2
scummvm-rg350-5ec472ae2fc5d391714617457ec01c24d67057c2.zip
ZVISION: Add version support for save files
-rw-r--r--engines/zvision/save_manager.cpp10
-rw-r--r--engines/zvision/save_manager.h1
2 files changed, 11 insertions, 0 deletions
diff --git a/engines/zvision/save_manager.cpp b/engines/zvision/save_manager.cpp
index 4f8bfeb836..ff6e1c36fa 100644
--- a/engines/zvision/save_manager.cpp
+++ b/engines/zvision/save_manager.cpp
@@ -44,6 +44,9 @@ void SaveManager::saveGame(uint slot, const Common::String &saveName) {
// Write out the savegame header
file->writeUint32BE(SAVEGAME_ID);
+ // Write version
+ file->writeByte(1);
+
// Write savegame name
file->writeString(saveName);
file->writeByte(0);
@@ -58,6 +61,7 @@ void SaveManager::saveGame(uint slot, const Common::String &saveName) {
// Skip over the header info
autoSaveFile->readSint32BE(); // SAVEGAME_ID
+ autoSaveFile->readByte(); // Version
autoSaveFile->seek(5, SEEK_CUR); // The string "auto" with terminating NULL
// Read the rest to a buffer
@@ -79,6 +83,9 @@ void SaveManager::autoSave() {
// Write out the savegame header
file->writeUint32BE(SAVEGAME_ID);
+ // Version
+ file->writeByte(1);
+
file->writeString("auto");
file->writeByte(0);
@@ -153,6 +160,9 @@ bool SaveManager::readSaveGameHeader(Common::InSaveFile *in, SaveGameHeader &hea
return false;
}
+ // Read in the version
+ header.version = in->readByte();
+
// Read in the save name
header.saveName.clear();
char ch;
diff --git a/engines/zvision/save_manager.h b/engines/zvision/save_manager.h
index 219a8e7715..864f176e10 100644
--- a/engines/zvision/save_manager.h
+++ b/engines/zvision/save_manager.h
@@ -36,6 +36,7 @@ namespace ZVision {
class ZVision;
struct SaveGameHeader {
+ byte version;
Common::String saveName;
Graphics::Surface *thumbnail;
int saveYear, saveMonth, saveDay;