diff options
author | yexo <yexo@openttd.org> | 2010-01-17 14:22:07 +0000 |
---|---|---|
committer | yexo <yexo@openttd.org> | 2010-01-17 14:22:07 +0000 |
commit | 830af8ee77bbbedb23f4caa53c8b47c20235f1b2 (patch) | |
tree | c1ff6197676c450a2487b608dc646bcb3df7b3ae /src/airport.h | |
parent | f920415752e3b9e4e18dcd602e535d0c9b49e5d8 (diff) | |
download | openttd-830af8ee77bbbedb23f4caa53c8b47c20235f1b2.tar.xz |
(svn r18845) -Codechange: introduce AirportTileSpec and use it for animation
Diffstat (limited to 'src/airport.h')
-rw-r--r-- | src/airport.h | 23 |
1 files changed, 16 insertions, 7 deletions
diff --git a/src/airport.h b/src/airport.h index 20c8c8787..99e262e37 100644 --- a/src/airport.h +++ b/src/airport.h @@ -21,6 +21,11 @@ enum { MAX_TERMINALS = 10, ///< maximum number of terminals per airport MAX_HELIPADS = 4, ///< maximum number of helipads per airport MAX_ELEMENTS = 255, ///< maximum number of aircraft positions at airport + NUM_AIRPORTTILES = 144, ///< total number of airport tiles +}; + +enum { + AIRPORTTILE_NOANIM = 0xFF, ///< flag to mark airport tiles as having no animation }; /** Airport types */ @@ -61,13 +66,7 @@ struct AirportSpec { Year min_year; ///< first year the airport is available Year max_year; ///< last year the airport is available - static AirportSpec *Get(byte type) - { - if (type == AT_OILRIG) return &oilrig; - assert(type < NUM_AIRPORTS); - extern AirportSpec _origin_airport_specs[NUM_AIRPORTS]; - return &_origin_airport_specs[type]; - } + static const AirportSpec *Get(byte type); bool IsAvailable() const; @@ -76,6 +75,16 @@ struct AirportSpec { }; +/** + * Defines the data structure of each indivudual tile of an airport. + */ +struct AirportTileSpec { + StationGfx anim_next; ///< Next StationGfx in an animation + uint8 animation_speed; ///< The speed of the animation + + static const AirportTileSpec *Get(StationGfx gfx); +}; + enum { AMED_NOSPDCLAMP = 1 << 0, AMED_TAKEOFF = 1 << 1, |