(svn r4322) - Codechange: Remove conversion of kmh to mph from gui code to within the units conversion system, in string.c. This means displaying kmh requires no conversion, instead of being convert from kmh to mph, and then back to kmh again.

This commit is contained in:
peter1138
2006-04-08 12:04:23 +00:00
parent 5be2aa3e99
commit ffadd91ca9
7 changed files with 31 additions and 31 deletions

View File

@@ -33,7 +33,7 @@ void DrawShipPurchaseInfo(int x, int y, EngineID engine_number)
/* Purchase cost - Max speed */
SetDParam(0, svi->base_cost * (_price.ship_base>>3)>>5);
SetDParam(1, svi->max_speed * 10 >> 5);
SetDParam(1, svi->max_speed / 2);
DrawString(x,y, STR_PURCHASE_INFO_COST_SPEED, 0);
y += 10;
@@ -179,7 +179,7 @@ static void ShipDetailsWndProc(Window *w, WindowEvent *e)
/* Draw max speed */
{
SetDParam(0, v->max_speed * 10 >> 5);
SetDParam(0, v->max_speed / 2);
DrawString(2, 25, STR_9813_MAX_SPEED, 0);
}
@@ -489,14 +489,14 @@ static void ShipViewWndProc(Window *w, WindowEvent *e) {
switch (v->current_order.type) {
case OT_GOTO_STATION: {
SetDParam(0, v->current_order.station);
SetDParam(1, v->cur_speed * 10 >> 5);
SetDParam(1, v->cur_speed / 2);
str = STR_HEADING_FOR_STATION + _patches.vehicle_speed;
} break;
case OT_GOTO_DEPOT: {
Depot *depot = GetDepot(v->current_order.station);
SetDParam(0, depot->town_index);
SetDParam(1, v->cur_speed * 10 >> 5);
SetDParam(1, v->cur_speed / 2);
str = STR_HEADING_FOR_SHIP_DEPOT + _patches.vehicle_speed;
} break;
@@ -508,7 +508,7 @@ static void ShipViewWndProc(Window *w, WindowEvent *e) {
default:
if (v->num_orders == 0) {
str = STR_NO_ORDERS + _patches.vehicle_speed;
SetDParam(0, v->cur_speed * 10 >> 5);
SetDParam(0, v->cur_speed / 2);
} else
str = STR_EMPTY;
break;