4 * This file is part of OpenTTD.
5 * OpenTTD is free software; you can redistribute it and/or modify it under the terms of the GNU General Public License as published by the Free Software Foundation, version 2.
6 * OpenTTD is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
7 * See the GNU General Public License for more details. You should have received a copy of the GNU General Public License along with OpenTTD. If not, see <http://www.gnu.org/licenses/>.
10 /** @file waypoint.cpp Handling of waypoints. */
14 #include "order_func.h"
15 #include "window_func.h"
16 #include "newgrf_station.h"
17 #include "waypoint_base.h"
19 #include "safeguards.h"
25 * @param stat_id station id
26 * @param railtype RailType to use for
28 void DrawWaypointSprite(int x
, int y
, int stat_id
, RailType railtype
)
30 if (!DrawStationTile(x
, y
, railtype
, AXIS_X
, STAT_CLASS_WAYP
, stat_id
)) {
31 StationPickerDrawSprite(x
, y
, STATION_WAYPOINT
, railtype
, INVALID_ROADTYPE
, AXIS_X
);
35 void Waypoint::GetTileArea(TileArea
*ta
, StationType type
) const
38 case STATION_WAYPOINT
:
39 *ta
= this->train_station
;
48 default: NOT_REACHED();
54 if (CleaningPool()) return;
55 DeleteWindowById(WC_WAYPOINT_VIEW
, this->index
);
56 RemoveOrderFromAllVehicles(OT_GOTO_WAYPOINT
, this->index
);