diff options
author | peter1138 <peter1138@openttd.org> | 2006-04-08 12:04:23 +0000 |
---|---|---|
committer | peter1138 <peter1138@openttd.org> | 2006-04-08 12:04:23 +0000 |
commit | ffadd91ca9fc5de831eb68a4303852790efa6d41 (patch) | |
tree | ae74d349c3ffaa93a6e05ea9dabd121e4daf8e43 /train_gui.c | |
parent | 5be2aa3e9953c0904852c29e3fe88fb2a753b025 (diff) | |
download | openttd-ffadd91ca9fc5de831eb68a4303852790efa6d41.tar.xz |
(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.
Diffstat (limited to 'train_gui.c')
-rw-r--r-- | train_gui.c | 16 |
1 files changed, 8 insertions, 8 deletions
diff --git a/train_gui.c b/train_gui.c index c65b899ff..dc6e0f7da 100644 --- a/train_gui.c +++ b/train_gui.c @@ -43,7 +43,7 @@ void DrawTrainEnginePurchaseInfo(int x, int y, EngineID engine_number) y += 10; /* Max speed - Engine power */ - SetDParam(0, rvi->max_speed * 10 >> 4); + SetDParam(0, rvi->max_speed); SetDParam(1, rvi->power << multihead); DrawString(x,y, STR_PURCHASE_INFO_SPEED_POWER, 0); y += 10; @@ -114,7 +114,7 @@ void DrawTrainWagonPurchaseInfo(int x, int y, EngineID engine_number) /* Wagon speed limit, displayed if above zero */ if (rvi->max_speed > 0 && _patches.wagon_speed_limits) { - SetDParam(0, rvi->max_speed * 10 >> 4); + SetDParam(0, rvi->max_speed); DrawString(x,y, STR_PURCHASE_INFO_SPEED, 0); y += 10; } @@ -932,7 +932,7 @@ static void TrainViewWndProc(Window *w, WindowEvent *e) if (v->u.rail.last_speed == 0) { str = STR_8861_STOPPED; } else { - SetDParam(0, v->u.rail.last_speed * 10 >> 4); + SetDParam(0, v->u.rail.last_speed); str = STR_TRAIN_STOPPING + _patches.vehicle_speed; } } else { @@ -940,14 +940,14 @@ static void TrainViewWndProc(Window *w, WindowEvent *e) case OT_GOTO_STATION: { str = STR_HEADING_FOR_STATION + _patches.vehicle_speed; SetDParam(0, v->current_order.station); - SetDParam(1, v->u.rail.last_speed * 10 >> 4); + SetDParam(1, v->u.rail.last_speed); } break; case OT_GOTO_DEPOT: { Depot *dep = GetDepot(v->current_order.station); SetDParam(0, dep->town_index); str = STR_HEADING_FOR_TRAIN_DEPOT + _patches.vehicle_speed; - SetDParam(1, v->u.rail.last_speed * 10 >> 4); + SetDParam(1, v->u.rail.last_speed); } break; case OT_LOADING: @@ -958,14 +958,14 @@ static void TrainViewWndProc(Window *w, WindowEvent *e) case OT_GOTO_WAYPOINT: { SetDParam(0, v->current_order.station); str = STR_HEADING_FOR_WAYPOINT + _patches.vehicle_speed; - SetDParam(1, v->u.rail.last_speed * 10 >> 4); + SetDParam(1, v->u.rail.last_speed); break; } default: if (v->num_orders == 0) { str = STR_NO_ORDERS + _patches.vehicle_speed; - SetDParam(0, v->u.rail.last_speed * 10 >> 4); + SetDParam(0, v->u.rail.last_speed); } else str = STR_EMPTY; break; @@ -1171,7 +1171,7 @@ static void DrawTrainDetailsWindow(Window *w) SetDParam(3, GetTrainRunningCost(v) >> 8); DrawString(x, 15, STR_885D_AGE_RUNNING_COST_YR, 0); - SetDParam(2, v->u.rail.cached_max_speed * 10 >> 4); + SetDParam(2, v->u.rail.cached_max_speed); SetDParam(1, v->u.rail.cached_power); SetDParam(0, v->u.rail.cached_weight); DrawString(x, 25, STR_VEHICLE_INFO_WEIGHT_POWER_MAX_SPEED, 0); |