summaryrefslogtreecommitdiff
path: root/src/saveload.h
diff options
context:
space:
mode:
authorrubidium <rubidium@openttd.org>2007-08-30 13:09:44 +0000
committerrubidium <rubidium@openttd.org>2007-08-30 13:09:44 +0000
commitf8306999712ddfd98ee342962ff446ccadcd8d1a (patch)
tree6e679af8466e541ec086d1aba2cb7f6f89e4ad69 /src/saveload.h
parent235ad4ab6bf3133517a7a779c398e30f51bdbbad (diff)
downloadopenttd-f8306999712ddfd98ee342962ff446ccadcd8d1a.tar.xz
(svn r11004) -Codechange: some reworks of the saveload mechanism to be able to save and load private and protected variables in the vehicle struct.
Diffstat (limited to 'src/saveload.h')
-rw-r--r--src/saveload.h20
1 files changed, 9 insertions, 11 deletions
diff --git a/src/saveload.h b/src/saveload.h
index c215a83ef..793b63dba 100644
--- a/src/saveload.h
+++ b/src/saveload.h
@@ -160,15 +160,15 @@ enum VarTypes {
typedef uint32 VarType;
enum SaveLoadTypes {
- SL_VAR = 0,
- SL_REF = 1,
- SL_ARR = 2,
- SL_STR = 3,
- SL_LST = 4,
+ SL_VAR = 0,
+ SL_REF = 1,
+ SL_ARR = 2,
+ SL_STR = 3,
+ SL_LST = 4,
// non-normal save-load types
- SL_WRITEBYTE = 8,
- SL_INCLUDE = 9,
- SL_END = 15
+ SL_WRITEBYTE = 8,
+ SL_VEH_INCLUDE = 9,
+ SL_END = 15
};
typedef byte SaveLoadType;
@@ -209,8 +209,6 @@ typedef SaveLoad SaveLoadGlobVarList;
/* Translate values ingame to different values in the savegame and vv */
#define SLE_WRITEBYTE(base, variable, value) SLE_GENERAL(SL_WRITEBYTE, base, variable, 0, 0, value, value)
-/* Load common code and put it into each struct (currently only for vehicles */
-#define SLE_INCLUDE(base, variable, include_index) SLE_GENERAL(SL_INCLUDE, base, variable, 0, 0, include_index, 0)
/* The same as the ones at the top, only the offset is given directly; used for unions */
#define SLE_GENERALX(cmd, offset, type, param1, param2) {false, cmd, type, 0, param1, param2, (void*)(offset)}
@@ -221,7 +219,7 @@ typedef SaveLoad SaveLoadGlobVarList;
#define SLE_REFX(offset, type) SLE_CONDREFX(offset, type, 0, SL_MAX_VERSION)
#define SLE_WRITEBYTEX(offset, something) SLE_GENERALX(SL_WRITEBYTE, offset, 0, something, 0)
-#define SLE_INCLUDEX(offset, type) SLE_GENERALX(SL_INCLUDE, offset, type, 0, SL_MAX_VERSION)
+#define SLE_VEH_INCLUDEX() SLE_GENERALX(SL_VEH_INCLUDE, 0, 0, 0, SL_MAX_VERSION)
/* End marker */
#define SLE_END() {false, SL_END, 0, 0, 0, 0, NULL}