summaryrefslogtreecommitdiff
path: root/vehicle_gui.h
diff options
context:
space:
mode:
authorbjarni <bjarni@openttd.org>2006-10-05 08:15:51 +0000
committerbjarni <bjarni@openttd.org>2006-10-05 08:15:51 +0000
commitb0cc6f40225838bbb1663635e85416a830343e70 (patch)
tree09af992dd594d5b616ba90411c39a8baa3fb6380 /vehicle_gui.h
parentc0ff23c8c58adad57e436c8419c2c831c9d3fd69 (diff)
downloadopenttd-b0cc6f40225838bbb1663635e85416a830343e70.tar.xz
(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.
Diffstat (limited to 'vehicle_gui.h')
-rw-r--r--vehicle_gui.h15
1 files changed, 13 insertions, 2 deletions
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 */