OpenTTD
|
Helper for unit conversion. More...
Public Member Functions | |
int64 | ToDisplay (int64 input, bool round=true) const |
Convert value from OpenTTD's internal unit into the displayed value. More... | |
int64 | FromDisplay (int64 input, bool round=true, int64 divider=1) const |
Convert the displayed value back into a value of OpenTTD's internal unit. More... | |
Data Fields | |
int | multiplier |
Amount to multiply upon conversion. | |
int | shift |
Amount to shift upon conversion. | |
Helper for unit conversion.
Definition at line 634 of file strings.cpp.
|
inline |
Convert the displayed value back into a value of OpenTTD's internal unit.
input | The input to convert. |
round | Whether to round the value up or not. |
divider | Divide the return value by this. |
Definition at line 656 of file strings.cpp.
Referenced by ConvertDisplaySpeedToKmhishSpeed(), and ConvertDisplaySpeedToSpeed().
|
inline |
Convert value from OpenTTD's internal unit into the displayed value.
input | The input to convert. |
round | Whether to round the value or not. |
Definition at line 644 of file strings.cpp.
Referenced by ConvertKmhishSpeedToDisplaySpeed(), and ConvertSpeedToDisplaySpeed().