diff options
author | rubidium <rubidium@openttd.org> | 2014-09-20 15:31:26 +0000 |
---|---|---|
committer | rubidium <rubidium@openttd.org> | 2014-09-20 15:31:26 +0000 |
commit | 6c2abf0930c23e7da82a892fb37c97786c245c00 (patch) | |
tree | 13db191cf49b57df14fdbf2c71ce558bbda57f6a /src/vehicle_base.h | |
parent | c4311903b71345a9c5ad0e5271ed722d71994c9e (diff) | |
download | openttd-6c2abf0930c23e7da82a892fb37c97786c245c00.tar.xz |
(svn r26863) -Codechange: move a number of Vehicle* functions into the Vehicle class
Diffstat (limited to 'src/vehicle_base.h')
-rw-r--r-- | src/vehicle_base.h | 9 |
1 files changed, 6 insertions, 3 deletions
diff --git a/src/vehicle_base.h b/src/vehicle_base.h index 6c2d16dfc..26a76dc85 100644 --- a/src/vehicle_base.h +++ b/src/vehicle_base.h @@ -696,6 +696,11 @@ public: void UpdateVisualEffect(bool allow_power_change = true); void ShowVisualEffect() const; + void UpdatePosition(); + void UpdateViewport(bool dirty); + void UpdatePositionAndViewport(); + void MarkAllViewportsDirty() const; + inline uint16 GetServiceInterval() const { return this->service_interval; } inline void SetServiceInterval(uint16 interval) { this->service_interval = interval; } @@ -1067,14 +1072,12 @@ struct SpecializedVehicle : public Vehicle { */ inline void UpdateViewport(bool force_update, bool update_delta) { - extern void VehicleUpdateViewport(Vehicle *v, bool dirty); - /* Explicitly choose method to call to prevent vtable dereference - * it gives ~3% runtime improvements in games with many vehicles */ if (update_delta) ((T *)this)->T::UpdateDeltaXY(this->direction); SpriteID old_image = this->cur_image; this->cur_image = ((T *)this)->T::GetImage(this->direction, EIT_ON_MAP); - if (force_update || this->cur_image != old_image) VehicleUpdateViewport(this, true); + if (force_update || this->cur_image != old_image) this->Vehicle::UpdateViewport(true); } }; |