saveload.h
changeset 5141 05a806850445
parent 5140 3d58647a202a
child 5142 d423c895a5b4
equal deleted inserted replaced
5140:3d58647a202a 5141:05a806850445
   269 static inline VarType GetVarFileType(VarType type)
   269 static inline VarType GetVarFileType(VarType type)
   270 {
   270 {
   271 	return type & 0xF; // GB(type, 0, 4);
   271 	return type & 0xF; // GB(type, 0, 4);
   272 }
   272 }
   273 
   273 
       
   274 /** Get the address of the variable. Which one to pick depends on the object
       
   275  * pointer. If it is NULL we are dealing with global variables so the address
       
   276  * is taken. If non-null only the offset is stored in the union and we need
       
   277  * to add this to the address of the object */
       
   278 static inline void *GetVariableAddress(const void *object, const SaveLoad *sld)
       
   279 {
       
   280 	return (byte*)object + (ptrdiff_t)sld->address;
       
   281 }
       
   282 
   274 int64 ReadValue(const void *ptr, VarType conv);
   283 int64 ReadValue(const void *ptr, VarType conv);
   275 void WriteValue(void *ptr, VarType conv, int64 val);
   284 void WriteValue(void *ptr, VarType conv, int64 val);
   276 
   285 
   277 void SlSetArrayIndex(uint index);
   286 void SlSetArrayIndex(uint index);
   278 int SlIterateArray(void);
   287 int SlIterateArray(void);