summaryrefslogtreecommitdiff
path: root/src/station_cmd.cpp
diff options
context:
space:
mode:
authoryexo <yexo@openttd.org>2010-02-22 14:16:57 +0000
committeryexo <yexo@openttd.org>2010-02-22 14:16:57 +0000
commit7ca4c31cf558ff29b3cbe14cd348bcf649445dfc (patch)
tree7577f2eda50659c477bdfd9bfbc8068bb47261e5 /src/station_cmd.cpp
parent61fe40ba73e84931d22f015783ce3c1817293b96 (diff)
downloadopenttd-7ca4c31cf558ff29b3cbe14cd348bcf649445dfc.tar.xz
(svn r19197) -Codechange: introduce animation callbacks for airport tiles
Diffstat (limited to 'src/station_cmd.cpp')
-rw-r--r--src/station_cmd.cpp15
1 files changed, 12 insertions, 3 deletions
diff --git a/src/station_cmd.cpp b/src/station_cmd.cpp
index 0851eea61..e0f23202a 100644
--- a/src/station_cmd.cpp
+++ b/src/station_cmd.cpp
@@ -2079,6 +2079,15 @@ CommandCost CmdBuildAirport(TileIndex tile, DoCommandFlag flags, uint32 p1, uint
do {
TileIndex cur_tile = tile + ToTileIndexDiff(it->ti);
MakeAirport(cur_tile, st->owner, st->index, it->gfx);
+
+ if (AirportTileSpec::Get(GetTranslatedAirportTileID(it->gfx))->animation_info != 0xFFFF) AddAnimatedTile(cur_tile);
+ } while ((++it)->ti.x != -0x80);
+
+ /* Only call the animation trigger after all tiles have been built */
+ it = as->table[0];
+ do {
+ TileIndex cur_tile = tile + ToTileIndexDiff(it->ti);
+ AirportTileAnimationTrigger(st, cur_tile, AAT_BUILT);
} while ((++it)->ti.x != -0x80);
st->UpdateVirtCoord();
@@ -2703,9 +2712,7 @@ static void TileLoop_Station(TileIndex tile)
* hardcoded.....not good */
switch (GetStationType(tile)) {
case STATION_AIRPORT:
- if (AirportTileSpec::Get(GetStationGfx(tile))->animation_info != 0xFFFF) {
- AddAnimatedTile(tile);
- }
+ AirportTileAnimationTrigger(Station::GetByTile(tile), tile, AAT_TILELOOP);
break;
case STATION_DOCK:
@@ -2982,6 +2989,7 @@ void OnTick_Station()
/* Stop processing this station if it was deleted */
if (!StationHandleBigTick(st)) continue;
StationAnimationTrigger(st, st->xy, STAT_ANIM_250_TICKS);
+ if (Station::IsExpected(st)) AirportAnimationTrigger(Station::From(st), AAT_STATION_250_ticks);
}
}
}
@@ -3016,6 +3024,7 @@ static void UpdateStationWaiting(Station *st, CargoID type, uint amount, SourceT
SetBit(st->goods[type].acceptance_pickup, GoodsEntry::PICKUP);
StationAnimationTrigger(st, st->xy, STAT_ANIM_NEW_CARGO, type);
+ AirportAnimationTrigger(st, AAT_STATION_NEW_CARGO, type);
SetWindowDirty(WC_STATION_VIEW, st->index);
st->MarkTilesDirty(true);