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