Change: Remove direction parameter from Vehicle::UpdateDeltaXY. (#6792)

The value is either unused or always the same as this->direction.
This commit is contained in:
PeterN
2018-05-22 18:43:34 +01:00
committed by GitHub
parent 4cebebcf68
commit a07394a63a
14 changed files with 33 additions and 34 deletions

View File

@@ -366,9 +366,8 @@ public:
/**
* Updates the x and y offsets and the size of the sprite used
* for this vehicle.
* @param direction the direction the vehicle is facing
*/
virtual void UpdateDeltaXY(Direction direction) {}
virtual void UpdateDeltaXY() {}
/**
* Determines the effective direction-specific vehicle movement speed.
@@ -1139,7 +1138,7 @@ struct SpecializedVehicle : public Vehicle {
/* 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);
if (update_delta) ((T *)this)->T::UpdateDeltaXY();
VehicleSpriteSeq seq;
((T *)this)->T::GetImage(this->direction, EIT_ON_MAP, &seq);
if (force_update || this->sprite_seq != seq) {