(svn r21911) -Codechange: move tcache.last_speed to gcache.last_speed and make SetLastSpeed a function of GroundVehicle

This commit is contained in:
rubidium
2011-01-26 17:31:07 +00:00
parent 12b64a12b0
commit b11f1bd4ed
4 changed files with 26 additions and 19 deletions

View File

@@ -65,8 +65,6 @@ struct TrainCache {
/* Cached wagon override spritegroup */
const struct SpriteGroup *cached_override;
uint16 last_speed; // NOSAVE: only used in UI
/* cached values, recalculated on load and each time a vehicle is added to/removed from the consist. */
bool cached_tilt; ///< train can tilt; feature provides a bonus in curves
@@ -110,7 +108,7 @@ struct Train : public GroundVehicle<Train, VEH_TRAIN> {
void PlayLeaveStationSound() const;
bool IsPrimaryVehicle() const { return this->IsFrontEngine(); }
SpriteID GetImage(Direction direction) const;
int GetDisplaySpeed() const { return this->tcache.last_speed; }
int GetDisplaySpeed() const { return this->gcache.last_speed; }
int GetDisplayMaxSpeed() const { return this->vcache.cached_max_speed; }
Money GetRunningCost() const;
int GetDisplayImageWidth(Point *offset = NULL) const;