waypoint.cpp

Go to the documentation of this file.
00001 /* $Id$ */
00002 
00003 /*
00004  * This file is part of OpenTTD.
00005  * 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.
00006  * 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.
00007  * 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/>.
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 }

Generated on Wed Dec 30 20:40:09 2009 for OpenTTD by  doxygen 1.5.6