summaryrefslogtreecommitdiff
path: root/saveload.h
diff options
context:
space:
mode:
authortruelight <truelight@openttd.org>2005-11-22 19:33:29 +0000
committertruelight <truelight@openttd.org>2005-11-22 19:33:29 +0000
commit4845ff063b6c83eabcd3c6ee5a3dcff7debf4ddc (patch)
tree8f15e8f51a08918d4f10f865ca89248468c85aab /saveload.h
parent6a4ba84320ae137793760b628dad23de29d0b633 (diff)
downloadopenttd-4845ff063b6c83eabcd3c6ee5a3dcff7debf4ddc.tar.xz
(svn r3227) -Codechange: [Savegame] removed 'minor' version, and renamed 'major' version to just: version.
Diffstat (limited to 'saveload.h')
-rw-r--r--saveload.h22
1 files changed, 18 insertions, 4 deletions
diff --git a/saveload.h b/saveload.h
index eb869f4e8..6a3d2e5e4 100644
--- a/saveload.h
+++ b/saveload.h
@@ -26,8 +26,8 @@ typedef void AutolengthProc(void *arg);
typedef struct SaveLoadGlobVarList {
void *address;
byte conv;
- byte from_version;
- byte to_version;
+ uint16 from_version;
+ uint16 to_version;
} SaveLoadGlobVarList;
typedef struct {
@@ -51,8 +51,8 @@ typedef enum SLRefType {
} SLRefType;
-extern byte _sl_version; /// the major savegame version identifier
-extern uint16 _sl_full_version; /// the full version of the savegame
+extern uint16 _sl_version; /// the major savegame version identifier
+extern byte _sl_minor_version; /// the minor savegame version, DO NOT USE!
enum {
@@ -161,6 +161,20 @@ typedef struct SaveLoad {
/* End marker */
#define SLE_END() {SL_END, 0, 0, 0, 0, 0}
+/** Checks if the savegame is below major.minor.
+ */
+static inline bool CheckSavegameVersionOldStyle(uint16 major, byte minor)
+{
+ return (_sl_version < major) || (_sl_version == major && _sl_minor_version < minor);
+}
+
+/** Checks if the savegame is below version.
+ */
+static inline bool CheckSavegameVersion(uint16 version)
+{
+ return _sl_version < version;
+}
+
void SlSetArrayIndex(uint index);
int SlIterateArray(void);
void SlArray(void *array, uint length, VarType conv);