summaryrefslogtreecommitdiff
path: root/src/road_gui.cpp
diff options
context:
space:
mode:
authorrubidium <rubidium@openttd.org>2007-07-16 23:55:22 +0000
committerrubidium <rubidium@openttd.org>2007-07-16 23:55:22 +0000
commit45b0b7755d54e94969466084eebc99811b7c2641 (patch)
tree052fe05961ef6ef6913712ffee40515822018816 /src/road_gui.cpp
parent210e3c7085ce77459ca186338c31fbd32948f68f (diff)
downloadopenttd-45b0b7755d54e94969466084eebc99811b7c2641.tar.xz
(svn r10601) -Codechange: store (and use) the type of stations instead of hardcoding station types by graphics IDs.
Diffstat (limited to 'src/road_gui.cpp')
-rw-r--r--src/road_gui.cpp18
1 files changed, 7 insertions, 11 deletions
diff --git a/src/road_gui.cpp b/src/road_gui.cpp
index 69c54dfeb..1300f45d4 100644
--- a/src/road_gui.cpp
+++ b/src/road_gui.cpp
@@ -554,8 +554,6 @@ static void RoadStationPickerWndProc(Window *w, WindowEvent *e)
break;
case WE_PAINT: {
- int image;
-
if (WP(w, def_d).close) return;
DrawWindowWidgets(w);
@@ -567,17 +565,15 @@ static void RoadStationPickerWndProc(Window *w, WindowEvent *e)
SetTileSelectSize(1, 1);
}
- image = (w->window_class == WC_BUS_STATION) ? GFX_BUS_BASE : GFX_TRUCK_BASE;
-
- StationPickerDrawSprite(103, 35, RAILTYPE_BEGIN, ROADTYPE_ROAD, image);
- StationPickerDrawSprite(103, 85, RAILTYPE_BEGIN, ROADTYPE_ROAD, image + 1);
- StationPickerDrawSprite(35, 85, RAILTYPE_BEGIN, ROADTYPE_ROAD, image + 2);
- StationPickerDrawSprite(35, 35, RAILTYPE_BEGIN, ROADTYPE_ROAD, image + 3);
+ StationType st = (w->window_class == WC_BUS_STATION) ? STATION_BUS : STATION_TRUCK;
- image = (w->window_class == WC_BUS_STATION) ? GFX_BUS_BASE_EXT : GFX_TRUCK_BASE_EXT;
+ StationPickerDrawSprite(103, 35, st, RAILTYPE_BEGIN, ROADTYPE_ROAD, 0);
+ StationPickerDrawSprite(103, 85, st, RAILTYPE_BEGIN, ROADTYPE_ROAD, 1);
+ StationPickerDrawSprite( 35, 85, st, RAILTYPE_BEGIN, ROADTYPE_ROAD, 2);
+ StationPickerDrawSprite( 35, 35, st, RAILTYPE_BEGIN, ROADTYPE_ROAD, 3);
- StationPickerDrawSprite(171, 35, RAILTYPE_BEGIN, _cur_roadtype, image);
- StationPickerDrawSprite(171, 85, RAILTYPE_BEGIN, _cur_roadtype, image + 1);
+ StationPickerDrawSprite(171, 35, st, RAILTYPE_BEGIN, _cur_roadtype, 4);
+ StationPickerDrawSprite(171, 85, st, RAILTYPE_BEGIN, _cur_roadtype, 5);
DrawStationCoverageAreaText(2, 146,
(w->window_class == WC_BUS_STATION) ? SCT_PASSENGERS_ONLY : SCT_NON_PASSENGERS_ONLY,