From 3dd6362bb8a07e36eaf621bdf5c256087fbbf8c8 Mon Sep 17 00:00:00 2001 From: rubidium Date: Mon, 16 Jul 2007 23:55:22 +0000 Subject: (svn r10601) -Codechange: store (and use) the type of stations instead of hardcoding station types by graphics IDs. --- src/road_gui.cpp | 18 +++++++----------- 1 file changed, 7 insertions(+), 11 deletions(-) (limited to 'src/road_gui.cpp') 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, -- cgit v1.2.3-54-g00ecf