From b0cc6f40225838bbb1663635e85416a830343e70 Mon Sep 17 00:00:00 2001 From: bjarni Date: Thu, 5 Oct 2006 08:15:51 +0000 Subject: (svn r6646) -Codechange: [vehicle list window] Cleaned up the drawing code This moved a few of the strings and sprites a few pixels. Hopefully this will work out ok. --- vehicle_gui.h | 15 +++++++++++++-- 1 file changed, 13 insertions(+), 2 deletions(-) (limited to 'vehicle_gui.h') diff --git a/vehicle_gui.h b/vehicle_gui.h index 564850648..e13a95677 100644 --- a/vehicle_gui.h +++ b/vehicle_gui.h @@ -4,6 +4,7 @@ #define VEHICLE_GUI_H #include "window.h" +#include "vehicle.h" void DrawVehicleProfitButton(const Vehicle *v, int x, int y); void ShowVehicleRefitWindow(const Vehicle *v, VehicleOrderID order); @@ -40,9 +41,7 @@ void DrawShipPurchaseInfo(int x, int y, EngineID engine_number); void DrawTrainImage(const Vehicle *v, int x, int y, int count, int skip, VehicleID selection); void DrawRoadVehImage(const Vehicle *v, int x, int y, VehicleID selection); void DrawShipImage(const Vehicle *v, int x, int y, VehicleID selection); -void DrawSmallOrderListShip(const Vehicle *v, int x, int y); void DrawAircraftImage(const Vehicle *v, int x, int y, VehicleID selection); -void DrawSmallOrderListAircraft(const Vehicle *v, int x, int y); void ShowBuildTrainWindow(TileIndex tile); void ShowBuildRoadVehWindow(TileIndex tile); @@ -57,4 +56,16 @@ void ShowVehicleListWindow(PlayerID player, StationID station, byte vehicle_type void ShowVehWithSharedOrders(Vehicle *v, byte vehicle_type); void ShowVehDepotOrders(PlayerID player, byte vehicle_type, TileIndex depot_tile); + +static inline void DrawVehicleImage(const Vehicle *v, int x, int y, int count, int skip, VehicleID selection) +{ + switch (v->type) { + case VEH_Train: DrawTrainImage(v, x, y, count, skip, selection); break; + case VEH_Road: DrawRoadVehImage(v, x, y, selection); break; + case VEH_Ship: DrawShipImage(v, x, y, selection); break; + case VEH_Aircraft: DrawAircraftImage(v, x, y, selection); break; + default: NOT_REACHED(); + } +} + #endif /* VEHICLE_GUI_H */ -- cgit v1.2.3-54-g00ecf