=== modified file 'src/rail_gui.cpp' --- src/rail_gui.cpp 2008-04-20 16:43:46 +0000 +++ src/rail_gui.cpp 2008-04-20 16:50:42 +0000 @@ -50,7 +50,17 @@ static SignalVariant _cur_signal_variant; ///< set the signal variant (for signal GUI) static SignalType _cur_signal_type; ///< set the signal type (for signal GUI) -static struct { +/** + * Orientation of the rail station in the station builder GUI. + * Values match order of widgets relative to BRSW_PLATFORM_DIR_X + * @see BuildRailStationWidgets + */ +enum RailStationOrientation { + STATIONORIENT_X_AXIS = 0, ///< Rail station along the x-axis (south-west -- north-east) + STATIONORIENT_Y_AXIS = 1 ///< Rail station along the y-axis (north-west -- south-east) +}; + +struct RailStationGUISettings { byte orientation; ///< Currently selected rail station orientation byte numtracks; ///< Currently selected number of tracks in station (if not \c dragdrop ) byte platlength; ///< Currently selected platform length of station (if not \c dragdrop ) @@ -60,7 +70,8 @@ StationClassIDByte station_class; ///< Currently selected custom station class (if newstations is \c true ) byte station_type; ///< Station type within the currently selected custom station class (if newstations is \c true ) byte station_count; ///< Number of custom stations (if newstations is \c true ) -} _railstation; +}; +static RailStationGUISettings _railstation; ///< Settings of the station builder GUI static void HandleStationPlacement(TileIndex start, TileIndex end); @@ -911,7 +922,7 @@ if (sy > ey) Swap(sy, ey); w = ex - sx + 1; h = ey - sy + 1; - if (!_railstation.orientation) Swap(w, h); + if (_railstation.orientation == STATIONORIENT_X_AXIS) Swap(w, h); DoCommandP(TileXY(sx, sy), _railstation.orientation | (w << 8) | (h << 16) | (_ctrl_pressed << 24), @@ -996,7 +1007,7 @@ } else { int x = _railstation.numtracks; int y = _railstation.platlength; - if (_railstation.orientation == 0) Swap(x, y); + if (_railstation.orientation == STATIONORIENT_X_AXIS) Swap(x, y); if (!_remove_button_clicked) SetTileSelectSize(x, y); }