summaryrefslogtreecommitdiff
path: root/src/airport.cpp
diff options
context:
space:
mode:
authoryexo <yexo@openttd.org>2010-01-17 14:22:07 +0000
committeryexo <yexo@openttd.org>2010-01-17 14:22:07 +0000
commit830af8ee77bbbedb23f4caa53c8b47c20235f1b2 (patch)
treec1ff6197676c450a2487b608dc646bcb3df7b3ae /src/airport.cpp
parentf920415752e3b9e4e18dcd602e535d0c9b49e5d8 (diff)
downloadopenttd-830af8ee77bbbedb23f4caa53c8b47c20235f1b2.tar.xz
(svn r18845) -Codechange: introduce AirportTileSpec and use it for animation
Diffstat (limited to 'src/airport.cpp')
-rw-r--r--src/airport.cpp27
1 files changed, 27 insertions, 0 deletions
diff --git a/src/airport.cpp b/src/airport.cpp
index 0de1033ff..351cb709d 100644
--- a/src/airport.cpp
+++ b/src/airport.cpp
@@ -123,10 +123,37 @@ enum AirportTiles {
};
#include "table/airport_defaults.h"
+#include "table/airporttiles.h"
AirportSpec AirportSpec::dummy = {NULL, NULL, 0, 0, 0, 0, 0, MIN_YEAR, MIN_YEAR};
AirportSpec AirportSpec::oilrig = {NULL, NULL, 0, 1, 1, 0, 4, MIN_YEAR, MIN_YEAR};
+
+/**
+ * Retrieve airport spec for the given airport
+ * @param type index of airport
+ * @return A pointer to the corresponding AirportSpec
+ */
+/* static */ const AirportSpec *AirportSpec::Get(byte type)
+{
+ if (type == AT_OILRIG) return &oilrig;
+ assert(type < NUM_AIRPORTS);
+ extern const AirportSpec _origin_airport_specs[];
+ return &_origin_airport_specs[type];
+}
+
+/**
+ * Retrieve airport tile spec for the given airport tile
+ * @param gfx index of airport tile
+ * @return A pointer to the corresponding AirportTileSpec
+ */
+/* static */ const AirportTileSpec *AirportTileSpec::Get(StationGfx gfx)
+{
+ assert(gfx < NUM_AIRPORTTILES);
+ extern const AirportTileSpec _origin_airporttile_specs[];
+ return &_origin_airporttile_specs[gfx];
+}
+
/* Uncomment this to print out a full report of the airport-structure
* You should either use
* - true: full-report, print out every state and choice with string-names