Cache the last vehicle in a consist to have a visual effect

This commit is contained in:
Jonathan G Rennison
2019-01-26 01:22:36 +00:00
parent e5b61e0b6c
commit 37adf9be4a
4 changed files with 21 additions and 0 deletions

View File

@@ -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. */