summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorterkhen <terkhen@openttd.org>2010-11-06 12:40:38 +0000
committerterkhen <terkhen@openttd.org>2010-11-06 12:40:38 +0000
commit766bf140db3f8a69b46234711c653ee1aba94341 (patch)
tree166e83f4bcaa4f9e650e8d02804c4ba63c8d2b40
parentd699c4a345503df0147de80c7462376f7ff130da (diff)
downloadopenttd-766bf140db3f8a69b46234711c653ee1aba94341.tar.xz
(svn r21092) -Codechange: Merge max speed functions.
-rw-r--r--src/ground_vehicle.cpp2
-rw-r--r--src/ground_vehicle.hpp2
-rw-r--r--src/roadveh.h10
-rw-r--r--src/train.h9
4 files changed, 2 insertions, 21 deletions
diff --git a/src/ground_vehicle.cpp b/src/ground_vehicle.cpp
index b3f200200..f3ba7d775 100644
--- a/src/ground_vehicle.cpp
+++ b/src/ground_vehicle.cpp
@@ -27,7 +27,7 @@ void GroundVehicle<T, Type>::PowerChanged()
uint32 total_power = 0;
uint32 max_te = 0;
uint32 number_of_parts = 0;
- uint16 max_track_speed = v->GetInitialMaxSpeed();
+ uint16 max_track_speed = v->GetDisplayMaxSpeed();
for (const T *u = v; u != NULL; u = u->Next()) {
uint32 current_power = u->GetPower();
diff --git a/src/ground_vehicle.hpp b/src/ground_vehicle.hpp
index 2e748bda4..77822abc9 100644
--- a/src/ground_vehicle.hpp
+++ b/src/ground_vehicle.hpp
@@ -61,7 +61,7 @@ enum GroundVehicleFlags {
* virtual uint32 GetRollingFriction() const = 0;
* virtual int GetAccelerationType() const = 0;
* virtual int32 GetSlopeSteepness() const = 0;
- * virtual uint16 GetInitialMaxSpeed() const = 0;
+ * virtual int GetDisplayMaxSpeed() const = 0;
* virtual uint16 GetMaxTrackSpeed() const = 0;
* virtual bool TileMayHaveSlopedTrack() const = 0;
*/
diff --git a/src/roadveh.h b/src/roadveh.h
index 8a424dd34..a8fcccd00 100644
--- a/src/roadveh.h
+++ b/src/roadveh.h
@@ -280,16 +280,6 @@ protected: // These functions should not be called outside acceleration code.
}
/**
- * Gets the maximum speed of the vehicle, ignoring the limitations of the kind of track the vehicle is on.
- * @return Maximum speed of the vehicle.
- */
- FORCEINLINE uint16 GetInitialMaxSpeed() const
- {
- /* Road vehicles use a *2 conversion factor. */
- return this->max_speed / 2;
- }
-
- /**
* Gets the maximum speed allowed by the track for this vehicle.
* @return Since roads don't limit road vehicle speed, it returns always zero.
*/
diff --git a/src/train.h b/src/train.h
index 8b2d619ac..c1dd3af24 100644
--- a/src/train.h
+++ b/src/train.h
@@ -501,15 +501,6 @@ protected: // These functions should not be called outside acceleration code.
}
/**
- * Gets the maximum speed of the vehicle, ignoring the limitations of the kind of track the vehicle is on.
- * @return Maximum speed of the vehicle.
- */
- FORCEINLINE uint16 GetInitialMaxSpeed() const
- {
- return this->tcache.cached_max_speed;
- }
-
- /**
* Gets the maximum speed allowed by the track for this vehicle.
* @return Maximum speed allowed.
*/