mirror of https://github.com/OpenTTD/OpenTTD
(svn r17732) -Codechange: reorder some variables of cargo packets/cargo lists to get better alignment *and* smaller structs; both from 40 bytes to 32 bytes on 64 bits.
parent
d52fa73bb1
commit
80f0df17ba
|
@ -28,8 +28,8 @@ void InitializeCargoPackets()
|
||||||
|
|
||||||
CargoPacket::CargoPacket(StationID source, uint16 count, SourceType source_type, SourceID source_id) :
|
CargoPacket::CargoPacket(StationID source, uint16 count, SourceType source_type, SourceID source_id) :
|
||||||
count(count),
|
count(count),
|
||||||
source(source),
|
source_id(source_id),
|
||||||
source_id(source_id)
|
source(source)
|
||||||
{
|
{
|
||||||
this->source_type = source_type;
|
this->source_type = source_type;
|
||||||
|
|
||||||
|
|
|
@ -50,11 +50,11 @@ public:
|
||||||
/** Maximum number of items in a single cargo packet. */
|
/** Maximum number of items in a single cargo packet. */
|
||||||
static const uint16 MAX_COUNT = UINT16_MAX;
|
static const uint16 MAX_COUNT = UINT16_MAX;
|
||||||
|
|
||||||
TileIndex source_xy; ///< The origin of the cargo (first station in feeder chain)
|
|
||||||
TileIndex loaded_at_xy; ///< Location where this cargo has been loaded into the vehicle
|
|
||||||
StationID source; ///< The station where the cargo came from first
|
|
||||||
SourceTypeByte source_type; ///< Type of \c source_id
|
SourceTypeByte source_type; ///< Type of \c source_id
|
||||||
SourceID source_id; ///< Index of source, INVALID_SOURCE if unknown/invalid
|
SourceID source_id; ///< Index of source, INVALID_SOURCE if unknown/invalid
|
||||||
|
StationID source; ///< The station where the cargo came from first
|
||||||
|
TileIndex source_xy; ///< The origin of the cargo (first station in feeder chain)
|
||||||
|
TileIndex loaded_at_xy; ///< Location where this cargo has been loaded into the vehicle
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Creates a new cargo packet
|
* Creates a new cargo packet
|
||||||
|
@ -161,12 +161,12 @@ public:
|
||||||
};
|
};
|
||||||
|
|
||||||
private:
|
private:
|
||||||
List packets; ///< The cargo packets in this list
|
|
||||||
|
|
||||||
uint count; ///< Cache for the number of cargo entities
|
|
||||||
Money feeder_share; ///< Cache for the feeder share
|
Money feeder_share; ///< Cache for the feeder share
|
||||||
|
uint count; ///< Cache for the number of cargo entities
|
||||||
uint days_in_transit; ///< Cache for the number of days in transit
|
uint days_in_transit; ///< Cache for the number of days in transit
|
||||||
|
|
||||||
|
List packets; ///< The cargo packets in this list
|
||||||
|
|
||||||
public:
|
public:
|
||||||
/** The GoodsEntry has a CargoList. */
|
/** The GoodsEntry has a CargoList. */
|
||||||
friend const struct SaveLoad *GetGoodsDesc();
|
friend const struct SaveLoad *GetGoodsDesc();
|
||||||
|
|
Loading…
Reference in New Issue