summaryrefslogtreecommitdiff
path: root/src/depot_gui.cpp
diff options
context:
space:
mode:
authorrubidium <rubidium@openttd.org>2007-07-01 19:11:47 +0000
committerrubidium <rubidium@openttd.org>2007-07-01 19:11:47 +0000
commit83a880c882992efb1b949b26ac881abc3825964f (patch)
tree2e6180dd4e262fcc66cf94a5d26c4c6fb7df642f /src/depot_gui.cpp
parentc49fd0957d9e0fbecd365b2c86e82a1a37625921 (diff)
downloadopenttd-83a880c882992efb1b949b26ac881abc3825964f.tar.xz
(svn r10408) -Codechange: make GetImage a class method of Vehicle instead of Get(Aircraft|RoadVeh|Ship|Train)Image.
Diffstat (limited to 'src/depot_gui.cpp')
-rw-r--r--src/depot_gui.cpp12
1 files changed, 2 insertions, 10 deletions
diff --git a/src/depot_gui.cpp b/src/depot_gui.cpp
index 59f97f4c8..2f63a0945 100644
--- a/src/depot_gui.cpp
+++ b/src/depot_gui.cpp
@@ -187,7 +187,7 @@ static void DrawVehicleInDepot(Window *w, const Vehicle *v, int x, int y)
case VEH_ROAD: DrawRoadVehImage( v, x + 24, sprite_y, 1, WP(w, depot_d).sel); break;
case VEH_SHIP: DrawShipImage( v, x + 19, sprite_y - 1, WP(w, depot_d).sel); break;
case VEH_AIRCRAFT: {
- const Sprite *spr = GetSprite(GetAircraftImage(v, DIR_W));
+ const Sprite *spr = GetSprite(v->GetImage(DIR_W));
DrawAircraftImage(v, x + 12,
y + max(spr->height + spr->y_offs - 14, 0), // tall sprites needs an y offset
WP(w, depot_d).sel);
@@ -438,15 +438,7 @@ static void DepotClick(Window *w, int x, int y)
WP(w,depot_d).sel = INVALID_VEHICLE;
TrainDepotMoveVehicle(v, sel, gdvp.head);
} else if (v != NULL) {
- int image;
-
- switch (WP(w, depot_d).type) {
- case VEH_TRAIN: image = GetTrainImage(v, DIR_W); break;
- case VEH_ROAD: image = GetRoadVehImage(v, DIR_W); break;
- case VEH_SHIP: image = GetShipImage(v, DIR_W); break;
- case VEH_AIRCRAFT: image = GetAircraftImage(v, DIR_W); break;
- default: NOT_REACHED(); image = 0;
- }
+ int image = v->GetImage(DIR_W);
WP(w, depot_d).sel = v->index;
SetWindowDirty(w);