summaryrefslogtreecommitdiff
path: root/src/depot_gui.cpp
diff options
context:
space:
mode:
authorrubidium <rubidium@openttd.org>2007-08-29 20:50:58 +0000
committerrubidium <rubidium@openttd.org>2007-08-29 20:50:58 +0000
commit5d628e6135267c2f72af07fab15cbdadfca41d91 (patch)
tree90be9332cafc06c8d6987997a1cd3abd742a1118 /src/depot_gui.cpp
parente10361a0eb0e84554a6d519af5b2c1206cbbf242 (diff)
downloadopenttd-5d628e6135267c2f72af07fab15cbdadfca41d91.tar.xz
(svn r10997) -Codechange: unify the vehicle view window. Patch by PhilSophus.
Diffstat (limited to 'src/depot_gui.cpp')
-rw-r--r--src/depot_gui.cpp21
1 files changed, 2 insertions, 19 deletions
diff --git a/src/depot_gui.cpp b/src/depot_gui.cpp
index ec21d4069..7f47d54d0 100644
--- a/src/depot_gui.cpp
+++ b/src/depot_gui.cpp
@@ -143,24 +143,7 @@ void CcCloneVehicle(bool success, TileIndex tile, uint32 p1, uint32 p2)
Vehicle *v = GetVehicle(_new_vehicle_id);
- switch (v->type) {
- case VEH_TRAIN: ShowTrainViewWindow(v); break;
- case VEH_ROAD: ShowRoadVehViewWindow(v); break;
- case VEH_SHIP: ShowShipViewWindow(v); break;
- case VEH_AIRCRAFT: ShowAircraftViewWindow(v); break;
- default: NOT_REACHED();
- }
-}
-
-static inline void ShowVehicleViewWindow(const Vehicle *v)
-{
- switch (v->type) {
- case VEH_TRAIN: ShowTrainViewWindow(v); break;
- case VEH_ROAD: ShowRoadVehViewWindow(v); break;
- case VEH_SHIP: ShowShipViewWindow(v); break;
- case VEH_AIRCRAFT: ShowAircraftViewWindow(v); break;
- default: NOT_REACHED();
- }
+ ShowVehicleViewWindow(v);
}
static void DepotSellAllConfirmationCallback(Window *w, bool confirmed)
@@ -912,7 +895,7 @@ static void DepotWndProc(Window *w, WindowEvent *e)
} else if (gdvp.wagon == NULL || gdvp.wagon->index != sel) {
TrainDepotMoveVehicle(gdvp.wagon, sel, gdvp.head);
} else if (gdvp.head != NULL && IsFrontEngine(gdvp.head)) {
- ShowTrainViewWindow(gdvp.head);
+ ShowVehicleViewWindow(gdvp.head);
}
}
} else if (GetVehicleFromDepotWndPt(w, e->we.dragdrop.pt.x, e->we.dragdrop.pt.y, &v, NULL) == MODE_DRAG_VEHICLE &&