File diff r25600:a0060616e61f → r25601:747c128b2f85
src/saveload/saveload.h
Show inline comments
 
@@ -482,17 +482,14 @@ enum VarTypes {
 
	SLE_STRB  = SLE_STRINGBUF,
 
	SLE_STR   = SLE_STRING,
 
	SLE_STRQ  = SLE_STRINGQUOTE,
 

	
 
	/* 8 bits allocated for a maximum of 8 flags
 
	 * Flags directing saving/loading of a variable */
 
	SLF_NOT_IN_SAVE     = 1 <<  8, ///< do not save with savegame, basically client-based
 
	SLF_NOT_IN_CONFIG   = 1 <<  9, ///< do not save to config file
 
	SLF_NO_NETWORK_SYNC = 1 << 10, ///< do not synchronize over network (but it is saved if SLF_NOT_IN_SAVE is not set)
 
	SLF_ALLOW_CONTROL   = 1 << 11, ///< allow control codes in the strings
 
	SLF_ALLOW_NEWLINE   = 1 << 12, ///< allow new lines in the strings
 
	SLF_ALLOW_CONTROL   = 1 << 8, ///< Allow control codes in the strings.
 
	SLF_ALLOW_NEWLINE   = 1 << 9, ///< Allow new lines in the strings.
 
};
 

	
 
typedef uint32 VarType;
 

	
 
/** Type of data saved. */
 
enum SaveLoadType : byte {
 
@@ -670,13 +667,13 @@ using SaveLoadTable = span<const SaveLoa
 
/**
 
 * Empty space in some savegame versions.
 
 * @param length Length of the empty space.
 
 * @param from   First savegame version that has the empty space.
 
 * @param to     Last savegame version that has the empty space.
 
 */
 
#define SLE_CONDNULL(length, from, to) {SL_ARR, SLE_FILE_U8 | SLE_VAR_NULL | SLF_NOT_IN_CONFIG, length, from, to, 0, nullptr, 0}
 
#define SLE_CONDNULL(length, from, to) {SL_ARR, SLE_FILE_U8 | SLE_VAR_NULL, length, from, to, 0, nullptr, 0}
 

	
 
/** Translate values ingame to different values in the savegame and vv. */
 
#define SLE_WRITEBYTE(base, variable) SLE_GENERAL(SL_WRITEBYTE, base, variable, 0, 0, SL_MIN_VERSION, SL_MAX_VERSION, 0)
 

	
 
#define SLE_VEH_INCLUDE() {SL_VEH_INCLUDE, 0, 0, SL_MIN_VERSION, SL_MAX_VERSION, 0, [] (void *b, size_t) { return b; }, 0}
 
#define SLE_ST_INCLUDE() {SL_ST_INCLUDE, 0, 0, SL_MIN_VERSION, SL_MAX_VERSION, 0, [] (void *b, size_t) { return b; }, 0}
 
@@ -794,13 +791,13 @@ using SaveLoadTable = span<const SaveLoa
 
/**
 
 * Empty global space in some savegame versions.
 
 * @param length Length of the empty space.
 
 * @param from   First savegame version that has the empty space.
 
 * @param to     Last savegame version that has the empty space.
 
 */
 
#define SLEG_CONDNULL(length, from, to) {SL_ARR, SLE_FILE_U8 | SLE_VAR_NULL | SLF_NOT_IN_CONFIG, length, from, to, 0, nullptr, 0}
 
#define SLEG_CONDNULL(length, from, to) {SL_ARR, SLE_FILE_U8 | SLE_VAR_NULL, length, from, to, 0, nullptr, 0}
 

	
 
/**
 
 * Checks whether the savegame is below \a major.\a minor.
 
 * @param major Major number of the version to check against.
 
 * @param minor Minor number of the version to check against. If \a minor is 0 or not specified, only the major number is checked.
 
 * @return Savegame version is earlier than the specified version.