diff options
author | truebrain <truebrain@openttd.org> | 2012-01-02 13:44:30 +0000 |
---|---|---|
committer | truebrain <truebrain@openttd.org> | 2012-01-02 13:44:30 +0000 |
commit | 0d929e877faf9572a80803db382ab973702e02c0 (patch) | |
tree | f19cea6421726b0719b1cfc7c403a8ac6262bc60 /src/vehicle_base.h | |
parent | 19004a77f843fccd0850cc980dd2c80de6d81462 (diff) | |
download | openttd-0d929e877faf9572a80803db382ab973702e02c0.tar.xz |
(svn r23713) -Codechange: split VehicleMove() into two functions, to minimalize the work done where possible
Diffstat (limited to 'src/vehicle_base.h')
-rw-r--r-- | src/vehicle_base.h | 4 |
1 files changed, 2 insertions, 2 deletions
diff --git a/src/vehicle_base.h b/src/vehicle_base.h index 1427d8004..31b8332d4 100644 --- a/src/vehicle_base.h +++ b/src/vehicle_base.h @@ -991,14 +991,14 @@ struct SpecializedVehicle : public Vehicle { */ inline void UpdateViewport(bool moved, bool turned) { - extern void VehicleMove(Vehicle *v, bool update_viewport); + extern void VehicleUpdatePositionAndViewport(Vehicle *v); /* Explicitly choose method to call to prevent vtable dereference - * it gives ~3% runtime improvements in games with many vehicles */ if (turned) ((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 (moved || this->cur_image != old_image) VehicleMove(this, true); + if (moved || this->cur_image != old_image) VehicleUpdatePositionAndViewport(this); } }; |