waypoint.cpp
Go to the documentation of this file.00001
00002
00003
00004
00005
00006
00007
00008
00009
00012 #include "stdafx.h"
00013
00014 #include "order_func.h"
00015 #include "window_func.h"
00016 #include "newgrf_station.h"
00017 #include "waypoint_base.h"
00018
00026 void DrawWaypointSprite(int x, int y, int stat_id, RailType railtype)
00027 {
00028 if (!DrawStationTile(x, y, railtype, AXIS_X, STAT_CLASS_WAYP, stat_id)) {
00029 StationPickerDrawSprite(x, y, STATION_WAYPOINT, railtype, INVALID_ROADTYPE, AXIS_X);
00030 }
00031 }
00032
00033 void Waypoint::GetTileArea(TileArea *ta, StationType type) const
00034 {
00035 switch (type) {
00036 case STATION_BUOY:
00037 case STATION_WAYPOINT:
00038 break;
00039
00040 default: NOT_REACHED();
00041 }
00042
00043 ta->tile = this->xy;
00044 ta->w = 1;
00045 ta->h = 1;
00046 }
00047
00048 Waypoint::~Waypoint()
00049 {
00050 if (CleaningPool()) return;
00051 DeleteWindowById(WC_WAYPOINT_VIEW, this->index);
00052 RemoveOrderFromAllVehicles(OT_GOTO_WAYPOINT, this->index);
00053
00054 this->sign.MarkDirty();
00055 }