src/saveload.h
branchnoai
changeset 9703 d2a6acdbd665
parent 9701 d1ac22c62f64
child 9724 b39bc69bb2f2
equal deleted inserted replaced
9702:e782b59f1f6a 9703:d2a6acdbd665
   210 
   210 
   211 /* Translate values ingame to different values in the savegame and vv */
   211 /* Translate values ingame to different values in the savegame and vv */
   212 #define SLE_WRITEBYTE(base, variable, value) SLE_GENERAL(SL_WRITEBYTE, base, variable, 0, 0, value, value)
   212 #define SLE_WRITEBYTE(base, variable, value) SLE_GENERAL(SL_WRITEBYTE, base, variable, 0, 0, value, value)
   213 
   213 
   214 /* The same as the ones at the top, only the offset is given directly; used for unions */
   214 /* The same as the ones at the top, only the offset is given directly; used for unions */
   215 #define SLE_GENERALX(cmd, offset, type, param1, param2) {false, cmd, type, 0, param1, param2, (void*)(offset)}
   215 #define SLE_GENERALX(cmd, offset, type, length, param1, param2) {false, cmd, type, length, param1, param2, (void*)(offset)}
   216 #define SLE_CONDVARX(offset, type, from, to) SLE_GENERALX(SL_VAR, offset, type, from, to)
   216 #define SLE_CONDVARX(offset, type, from, to) SLE_GENERALX(SL_VAR, offset, type, 0, from, to)
   217 #define SLE_CONDREFX(offset, type, from, to) SLE_GENERALX(SL_REF, offset, type, from, to)
   217 #define SLE_CONDARRX(offset, type, length, from, to) SLE_GENERALX(SL_ARR, offset, type, length, from, to)
       
   218 #define SLE_CONDREFX(offset, type, from, to) SLE_GENERALX(SL_REF, offset, type, 0, from, to)
   218 
   219 
   219 #define SLE_VARX(offset, type) SLE_CONDVARX(offset, type, 0, SL_MAX_VERSION)
   220 #define SLE_VARX(offset, type) SLE_CONDVARX(offset, type, 0, SL_MAX_VERSION)
   220 #define SLE_REFX(offset, type) SLE_CONDREFX(offset, type, 0, SL_MAX_VERSION)
   221 #define SLE_REFX(offset, type) SLE_CONDREFX(offset, type, 0, SL_MAX_VERSION)
   221 
   222 
   222 #define SLE_WRITEBYTEX(offset, something) SLE_GENERALX(SL_WRITEBYTE, offset, 0, something, 0)
   223 #define SLE_WRITEBYTEX(offset, something) SLE_GENERALX(SL_WRITEBYTE, offset, 0, 0, something, 0)
   223 #define SLE_VEH_INCLUDEX() SLE_GENERALX(SL_VEH_INCLUDE, 0, 0, 0, SL_MAX_VERSION)
   224 #define SLE_VEH_INCLUDEX() SLE_GENERALX(SL_VEH_INCLUDE, 0, 0, 0, 0, SL_MAX_VERSION)
   224 
   225 
   225 /* End marker */
   226 /* End marker */
   226 #define SLE_END() {false, SL_END, 0, 0, 0, 0, NULL}
   227 #define SLE_END() {false, SL_END, 0, 0, 0, 0, NULL}
   227 
   228 
   228 /* Simple variables, references (pointers) and arrays, but for global variables */
   229 /* Simple variables, references (pointers) and arrays, but for global variables */