summaryrefslogtreecommitdiff
path: root/src/saveload.h
diff options
context:
space:
mode:
authorrubidium <rubidium@openttd.org>2007-06-07 12:37:48 +0000
committerrubidium <rubidium@openttd.org>2007-06-07 12:37:48 +0000
commit622a4d10b92e5ab843a9f9989cc36b8e2705e492 (patch)
treeead0e50ca3c1bb5247c4dfc6369a2016562e7867 /src/saveload.h
parent9a81f009a0171de66dcd4e7fb8e177d48b00b2b2 (diff)
downloadopenttd-622a4d10b92e5ab843a9f9989cc36b8e2705e492.tar.xz
(svn r10056) -Revert (r10049): removing SLE_WRITEBYTE didn't work as expected :(. Somehow SlIterateArray and SlObject depend on eachother and adding a some arbitrary data before the SlObject makes it go crazy.
Diffstat (limited to 'src/saveload.h')
-rw-r--r--src/saveload.h4
1 files changed, 4 insertions, 0 deletions
diff --git a/src/saveload.h b/src/saveload.h
index 24dc9f231..78d560217 100644
--- a/src/saveload.h
+++ b/src/saveload.h
@@ -161,6 +161,7 @@ enum SaveLoadTypes {
SL_STR = 3,
SL_LST = 4,
// non-normal save-load types
+ SL_WRITEBYTE = 8,
SL_INCLUDE = 9,
SL_END = 15
};
@@ -200,6 +201,8 @@ typedef SaveLoad SaveLoadGlobVarList;
#define SLE_CONDNULL(length, from, to) SLE_CONDARR(NullStruct, null, SLE_FILE_U8 | SLE_VAR_NULL | SLF_CONFIG_NO, length, from, to)
+/* 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)
@@ -211,6 +214,7 @@ typedef SaveLoad SaveLoadGlobVarList;
#define SLE_VARX(offset, type) SLE_CONDVARX(offset, type, 0, SL_MAX_VERSION)
#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)
/* End marker */