12 #include "../stdafx.h" 13 #include "../cargomonitor.h" 17 #include "../safeguards.h" 41 SB(number, 25, 4,
GB(number, 24, 4));
55 storage.number = iter->first;
56 storage.amount = iter->second;
59 SlObject(&storage, _cargomonitor_pair_desc);
75 SlObject(&storage, _cargomonitor_pair_desc);
77 if (fix) storage.number = FixupCargoMonitor(storage.number);
79 std::pair<CargoMonitorID, uint32> p(storage.number, storage.amount);
93 storage.number = iter->first;
94 storage.amount = iter->second;
97 SlObject(&storage, _cargomonitor_pair_desc);
113 SlObject(&storage, _cargomonitor_pair_desc);
115 if (fix) storage.number = FixupCargoMonitor(storage.number);
117 std::pair<CargoMonitorID, uint32> p(storage.number, storage.amount);
static bool IsSavegameVersionBefore(SaveLoadVersion major, byte minor=0)
Checks whether the savegame is below major.
Temporary storage of cargo monitoring data for loading or saving it.
static T SB(T &x, const uint8 s, const uint8 n, const U d)
Set n bits in x starting at bit s to d.
207 PR#7175 Cargo monitor data packing fix to support 64 cargotypes.
Functions/types related to saving and loading games.
static const SaveLoad _cargomonitor_pair_desc[]
Description of the TempStorage structure for the purpose of load and save.
CargoMonitorMap _cargo_deliveries
Map of monitored deliveries to the amount since last query/activation.
static void SavePickup()
Save the _cargo_pickups monitoring map.
void ClearCargoPickupMonitoring(CompanyID company)
Clear all pick-up cargo monitors.
static void SaveDelivery()
Save the _cargo_deliveries monitoring map.
int SlIterateArray()
Iterate through the elements of an array and read the whole thing.
void ClearCargoDeliveryMonitoring(CompanyID company)
Clear all delivery cargo monitors.
Handlers and description of chunk.
uint32 CargoMonitorID
Unique number for a company / cargo type / (town or industry).
#define SLE_END()
End marker of a struct/class save or load.
CargoMonitorMap _cargo_pickups
Map of monitored pick-ups to the amount since last query/activation.
static T ClrBit(T &x, const uint8 y)
Clears a bit in a variable.
const ChunkHandler _cargomonitor_chunk_handlers[]
Chunk definition of the cargomonitoring maps.
static void LoadDelivery()
Load the _cargo_deliveries monitoring map.
static uint GB(const T x, const uint8 s, const uint8 n)
Fetch n bits from x, started at bit s.
void SlObject(void *object, const SaveLoad *sld)
Main SaveLoad function.
#define SLE_VAR(base, variable, type)
Storage of a variable in every version of a savegame.
static void LoadPickup()
Load the _cargo_pickups monitoring map.
Last chunk in this array.