diff -r 6310a0f98734 src/strings.cpp --- a/src/strings.cpp Sun Feb 26 18:46:36 2012 +0000 +++ b/src/strings.cpp Mon Feb 27 03:58:35 2012 -0700 @@ -689,7 +689,9 @@ */ uint ConvertKmhishSpeedToDisplaySpeed(uint speed) { - return _units[_settings_game.locale.units].c_velocity.ToDisplay(speed * 10, false) / 16; + const uint64 A = 16 * (1 << _units[_settings_game.locale.units].c_velocity.shift); + const uint64 B = 10 * _units[_settings_game.locale.units].c_velocity.multiplier; + return speed * B / A; // Rounds down } /** @@ -699,7 +701,9 @@ */ uint ConvertDisplaySpeedToKmhishSpeed(uint speed) { - return _units[_settings_game.locale.units].c_velocity.FromDisplay(speed * 16) / 10; + const uint64 A = 16 * (1 << _units[_settings_game.locale.units].c_velocity.shift); + const uint64 B = 10 * _units[_settings_game.locale.units].c_velocity.multiplier; + return (speed * A + B-1) / B; // Rounds up } /** * Parse most format codes within a string and write the result to a buffer.