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

Function ConvertDisplaySpeedToKmhishSpeed

src/strings.cpp:1001–1004  ·  view source on GitHub ↗

* Convert the given display speed to the km/h-ish speed. * @param speed the speed to convert * @return the converted speed. */

Source from the content-addressed store, hash-verified

999 * @return the converted speed.
1000 */
1001uint ConvertDisplaySpeedToKmhishSpeed(uint speed, VehicleType type)
1002{
1003 return GetVelocityUnits(type).c.FromDisplay(speed * 16, true, 10);
1004}
1005
1006/**
1007 * Decodes an encoded string during FormatString.

Callers 1

OnQueryTextFinishedMethod · 0.85

Calls 2

GetVelocityUnitsFunction · 0.85
FromDisplayMethod · 0.80

Tested by

no test coverage detected