saveload.h
changeset 3045 0364fedfd355
parent 3044 fbaef2401476
child 3046 baa216f9911a
equal deleted inserted replaced
3044:fbaef2401476 3045:0364fedfd355
    50 	REF_ROADSTOPS   = 5,
    50 	REF_ROADSTOPS   = 5,
    51 	REF_ENGINE_RENEWS = 6,
    51 	REF_ENGINE_RENEWS = 6,
    52 } SLRefType;
    52 } SLRefType;
    53 
    53 
    54 #define SL_MAX_VERSION 255
    54 #define SL_MAX_VERSION 255
    55 
       
    56 extern uint16 _sl_version;       /// the major savegame version identifier
       
    57 extern byte   _sl_minor_version; /// the minor savegame version, DO NOT USE!
       
    58 
       
    59 
    55 
    60 enum {
    56 enum {
    61 	INC_VEHICLE_COMMON = 0,
    57 	INC_VEHICLE_COMMON = 0,
    62 };
    58 };
    63 
    59 
   170 
   166 
   171 /** Checks if the savegame is below major.minor.
   167 /** Checks if the savegame is below major.minor.
   172  */
   168  */
   173 static inline bool CheckSavegameVersionOldStyle(uint16 major, byte minor)
   169 static inline bool CheckSavegameVersionOldStyle(uint16 major, byte minor)
   174 {
   170 {
       
   171 	extern uint16 _sl_version;
       
   172 	extern byte   _sl_minor_version;
   175 	return (_sl_version < major) || (_sl_version == major && _sl_minor_version < minor);
   173 	return (_sl_version < major) || (_sl_version == major && _sl_minor_version < minor);
   176 }
   174 }
   177 
   175 
   178 /** Checks if the savegame is below version.
   176 /** Checks if the savegame is below version.
   179  */
   177  */
   180 static inline bool CheckSavegameVersion(uint16 version)
   178 static inline bool CheckSavegameVersion(uint16 version)
   181 {
   179 {
       
   180 	extern uint16 _sl_version;
   182 	return _sl_version < version;
   181 	return _sl_version < version;
   183 }
   182 }
   184 
   183 
   185 void SlSetArrayIndex(uint index);
   184 void SlSetArrayIndex(uint index);
   186 int SlIterateArray(void);
   185 int SlIterateArray(void);