diff options
author | terkhen <terkhen@openttd.org> | 2010-12-14 21:28:45 +0000 |
---|---|---|
committer | terkhen <terkhen@openttd.org> | 2010-12-14 21:28:45 +0000 |
commit | 12c86a139193ab88edb998844c2685b569430a57 (patch) | |
tree | aaed0f6452dd7cc0898caa795d24b1b2ac498490 /src/ground_vehicle.hpp | |
parent | d6959dcc6be6a6c6cdc94c9c249a636a2781c8e5 (diff) | |
download | openttd-12c86a139193ab88edb998844c2685b569430a57.tar.xz |
(svn r21518) -Codechange: Rename AccelerationCache to GroundVehicleCache.
Diffstat (limited to 'src/ground_vehicle.hpp')
-rw-r--r-- | src/ground_vehicle.hpp | 16 |
1 files changed, 8 insertions, 8 deletions
diff --git a/src/ground_vehicle.hpp b/src/ground_vehicle.hpp index e518e183f..d71eb7334 100644 --- a/src/ground_vehicle.hpp +++ b/src/ground_vehicle.hpp @@ -22,17 +22,17 @@ enum AccelStatus { }; /** - * Cached acceleration values. + * Cached values. * All of these values except cached_slope_resistance are set only for the first part of a vehicle. */ -struct AccelerationCache { - /* Cached values, recalculated when the cargo on a vehicle changes (in addition to the conditions below) */ +struct GroundVehicleCache { + /* Cached acceleration values, recalculated when the cargo on a vehicle changes (in addition to the conditions below) */ uint32 cached_weight; ///< Total weight of the consist. uint32 cached_slope_resistance; ///< Resistance caused by weight when this vehicle part is at a slope. uint32 cached_max_te; ///< Maximum tractive effort of consist. uint16 cached_axle_resistance; ///< Resistance caused by the axles of the vehicle. - /* Cached values, recalculated on load and each time a vehicle is added to/removed from the consist. */ + /* Cached acceleration values, recalculated on load and each time a vehicle is added to/removed from the consist. */ uint16 cached_max_track_speed; ///< Maximum consist speed limited by track type. uint32 cached_power; ///< Total power of the consist. uint32 cached_air_drag; ///< Air drag coefficient of the vehicle. @@ -67,8 +67,8 @@ enum GroundVehicleFlags { */ template <class T, VehicleType Type> struct GroundVehicle : public SpecializedVehicle<T, Type> { - AccelerationCache acc_cache; - uint16 gv_flags; ///< @see GroundVehicleFlags + GroundVehicleCache gcache; ///< Cache of often calculated values. + uint16 gv_flags; ///< @see GroundVehicleFlags. /** * The constructor at SpecializedVehicle must be called. @@ -89,9 +89,9 @@ struct GroundVehicle : public SpecializedVehicle<T, Type> { for (const T *u = T::From(this); u != NULL; u = u->Next()) { if (HasBit(u->gv_flags, GVF_GOINGUP_BIT)) { - incl += u->acc_cache.cached_slope_resistance; + incl += u->gcache.cached_slope_resistance; } else if (HasBit(u->gv_flags, GVF_GOINGDOWN_BIT)) { - incl -= u->acc_cache.cached_slope_resistance; + incl -= u->gcache.cached_slope_resistance; } } |