summaryrefslogtreecommitdiff
path: root/src/station_cmd.cpp
diff options
context:
space:
mode:
authorrubidium <rubidium@openttd.org>2009-07-21 11:11:05 +0000
committerrubidium <rubidium@openttd.org>2009-07-21 11:11:05 +0000
commit43eda3dfbf45a8f5060aaca3da9b8cad59a1aad8 (patch)
treef679af938cac59410e256882dfa0f5845b47b71e /src/station_cmd.cpp
parentc63338cd8158fa8a60afe74395d4f5e659317581 (diff)
downloadopenttd-43eda3dfbf45a8f5060aaca3da9b8cad59a1aad8.tar.xz
(svn r16896) -Codechange: make station spec allocation and station animation functions work for both stations and waypoints
Diffstat (limited to 'src/station_cmd.cpp')
-rw-r--r--src/station_cmd.cpp36
1 files changed, 36 insertions, 0 deletions
diff --git a/src/station_cmd.cpp b/src/station_cmd.cpp
index 877e705b6..f21a2e1e1 100644
--- a/src/station_cmd.cpp
+++ b/src/station_cmd.cpp
@@ -368,6 +368,42 @@ static Station *GetClosestDeletedStation(TileIndex tile)
return best_station;
}
+
+void Station::GetTileArea(TileArea *ta, StationType type) const
+{
+ switch (type) {
+ case STATION_RAIL:
+ ta->tile = this->train_tile;
+ ta->w = this->trainst_w;
+ ta->h = this->trainst_h;
+ return;
+
+ case STATION_AIRPORT:
+ ta->tile = this->airport_tile;
+ ta->w = this->Airport()->size_x;
+ ta->h = this->Airport()->size_y;
+
+ case STATION_TRUCK:
+ ta->tile = this->truck_stops != NULL ? this->truck_stops->xy : INVALID_TILE;
+ break;
+
+ case STATION_BUS:
+ ta->tile = this->bus_stops != NULL ? this->bus_stops->xy : INVALID_TILE;
+ break;
+
+ case STATION_DOCK:
+ case STATION_OILRIG:
+ case STATION_BUOY:
+ ta->tile = this->dock_tile;
+ break;
+
+ default: NOT_REACHED();
+ }
+
+ ta->w = 1;
+ ta->h = 1;
+}
+
/**
* Update the virtual coords needed to draw the station sign.
*/