Cache the last vehicle in a consist to have a visual effect
This commit is contained in:
@@ -130,12 +130,20 @@ enum GroundVehicleSubtypeFlags {
|
||||
GVSF_VIRTUAL = 6, ///< Used for virtual trains during template design, it is needed to skip checks for tile or depot status
|
||||
};
|
||||
|
||||
/**
|
||||
* Enum to handle vehicle cache flags.
|
||||
*/
|
||||
enum VehicleCacheFlags {
|
||||
VCF_LAST_VISUAL_EFFECT = 0, ///< Last vehicle in the consist with a visual effect.
|
||||
};
|
||||
|
||||
/** Cached often queried values common to all vehicles. */
|
||||
struct VehicleCache {
|
||||
uint16 cached_max_speed; ///< Maximum speed of the consist (minimum of the max speed of all vehicles in the consist).
|
||||
uint16 cached_cargo_age_period; ///< Number of ticks before carried cargo is aged.
|
||||
|
||||
byte cached_vis_effect; ///< Visual effect to show (see #VisualEffect)
|
||||
byte cached_veh_flags; ///< Vehicle cache flags (see #VehicleCacheFlags)
|
||||
};
|
||||
|
||||
/** Sprite sequence for a vehicle part. */
|
||||
|
Reference in New Issue
Block a user