12 #include "../stdafx.h" 13 #include "../economy_func.h" 14 #include "../economy_base.h" 18 #include "../safeguards.h" 38 static const SaveLoad _economy_desc[] = {
67 static const SaveLoad _cargopayment_desc[] = {
75 static void Save_CAPY()
79 SlSetArrayIndex(cp->
index);
84 static void Load_CAPY()
94 static void Ptrs_CAPY()
104 {
'CAPY', Save_CAPY, Load_CAPY, Ptrs_CAPY, NULL, CH_ARRAY},
105 {
'PRIC', NULL,
Load_PRIC, NULL, NULL, CH_RIFF | CH_AUTO_LENGTH},
106 {
'CAPR', NULL,
Load_CAPR, NULL, NULL, CH_RIFF | CH_AUTO_LENGTH},
#define SLE_CONDNULL(length, from, to)
Empty space in some savegame versions.
static void Load_ECMY()
Economy variables.
static void Load_CAPR()
Cargo payment rates in pre 126 savegames.
#define SLE_REF(base, variable, type)
Storage of a reference in every version of a savegame.
Tindex index
Index of this pool item.
static void Save_ECMY()
Economy variables.
#define FOR_ALL_CARGO_PAYMENTS(var)
Iterate over all cargo payments.
void SlArray(void *array, size_t length, VarType conv)
Save/Load an array.
Functions/types related to saving and loading games.
#define SLE_CONDVAR(base, variable, type, from, to)
Storage of a variable in some savegame versions.
#define SL_MAX_VERSION
Highest possible savegame version.
static bool IsSavegameVersionBefore(uint16 major, byte minor=0)
Checks whether the savegame is below major.
Helper class to perform the cargo payment.
int SlIterateArray()
Iterate through the elements of an array and read the whole thing.
Load/save a reference to a vehicle.
Handlers and description of chunk.
Maximal number of cargo types in a game.
#define SLE_END()
End marker of a struct/class save or load.
useful to write zeros in savegame.
static void Load_PRIC()
Prices in pre 126 savegames.
void SlObject(void *object, const SaveLoad *sld)
Main SaveLoad function.
void StartupIndustryDailyChanges(bool init_counter)
Initialize the variables that will maintain the daily industry change system.
#define SLE_VAR(base, variable, type)
Storage of a variable in every version of a savegame.
Last chunk in this array.