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

Function ConvertKmhishSpeedToDisplaySpeed

src/strings.cpp:991–994  ·  view source on GitHub ↗

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

Source from the content-addressed store, hash-verified

989 * @return the converted speed.
990 */
991uint ConvertKmhishSpeedToDisplaySpeed(uint speed, VehicleType type)
992{
993 return GetVelocityUnits(type).c.ToDisplay(speed * 10, false) / 16;
994}
995
996/**
997 * Convert the given display speed to the km/h-ish speed.

Callers 2

FormatStringFunction · 0.85
OnClickMethod · 0.85

Calls 2

GetVelocityUnitsFunction · 0.85
ToDisplayMethod · 0.80

Tested by

no test coverage detected