diff options
author | rubidium <rubidium@openttd.org> | 2007-07-16 23:55:22 +0000 |
---|---|---|
committer | rubidium <rubidium@openttd.org> | 2007-07-16 23:55:22 +0000 |
commit | 3dd6362bb8a07e36eaf621bdf5c256087fbbf8c8 (patch) | |
tree | 052fe05961ef6ef6913712ffee40515822018816 /src/road_gui.cpp | |
parent | 0f8e7e79bed67ccaa578b5d25ba250aa2051381e (diff) | |
download | openttd-3dd6362bb8a07e36eaf621bdf5c256087fbbf8c8.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.cpp | 18 |
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, |