MCPcopy Create free account
hub / github.com/OpenTTD/OpenTTD / ConvertDisplaySpeedToSpeed

Function ConvertDisplaySpeedToSpeed

src/strings.cpp:981–984  ·  view source on GitHub ↗

* Convert the given display speed to the (internal) speed. * @param speed the speed to convert * @return the converted speed. */

Source from the content-addressed store, hash-verified

979 * @return the converted speed.
980 */
981uint ConvertDisplaySpeedToSpeed(uint speed, VehicleType type)
982{
983 return GetVelocityUnits(type).c.FromDisplay(speed);
984}
985
986/**
987 * Convert the given km/h-ish speed to the display speed.

Callers 1

OnQueryTextFinishedMethod · 0.85

Calls 2

GetVelocityUnitsFunction · 0.85
FromDisplayMethod · 0.80

Tested by

no test coverage detected