summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorpeter1138 <peter1138@openttd.org>2010-01-01 18:19:26 +0000
committerpeter1138 <peter1138@openttd.org>2010-01-01 18:19:26 +0000
commit81dc77ee23cc1bafe809a6223e48991aaeb3e109 (patch)
tree095557f1a820736c38e044710d7b4b6b58b8382d
parentf77d88c0aa9413b6434fd6a8c0522e8d1a6d4f41 (diff)
downloadopenttd-81dc77ee23cc1bafe809a6223e48991aaeb3e109.tar.xz
(svn r18681) -Codechange: Use existing TILE_LOOP method for iterating trigger area.
-rw-r--r--src/newgrf_station.cpp24
1 files changed, 10 insertions, 14 deletions
diff --git a/src/newgrf_station.cpp b/src/newgrf_station.cpp
index 35d76423e..0a0c711f5 100644
--- a/src/newgrf_station.cpp
+++ b/src/newgrf_station.cpp
@@ -1062,23 +1062,19 @@ void StationAnimationTrigger(const BaseStation *st, TileIndex tile, StatAnimTrig
ETileArea area = ETileArea(st, tile, tas[trigger]);
/* Check all tiles over the station to check if the specindex is still in use */
- for (uint y = 0; y < area.h; y++) {
- for (uint x = 0; x < area.w; x++) {
- if (st->TileBelongsToRailStation(area.tile)) {
- const StationSpec *ss = GetStationSpec(area.tile);
- if (ss != NULL && HasBit(ss->anim_triggers, trigger)) {
- CargoID cargo;
- if (cargo_type == CT_INVALID) {
- cargo = CT_INVALID;
- } else {
- cargo = GetReverseCargoTranslation(cargo_type, ss->grffile);
- }
- ChangeStationAnimationFrame(ss, st, area.tile, random_bits, trigger, cargo);
+ TILE_LOOP(tile, area.w, area.h, area.tile) {
+ if (st->TileBelongsToRailStation(tile)) {
+ const StationSpec *ss = GetStationSpec(tile);
+ if (ss != NULL && HasBit(ss->anim_triggers, trigger)) {
+ CargoID cargo;
+ if (cargo_type == CT_INVALID) {
+ cargo = CT_INVALID;
+ } else {
+ cargo = GetReverseCargoTranslation(cargo_type, ss->grffile);
}
+ ChangeStationAnimationFrame(ss, st, tile, random_bits, trigger, cargo);
}
- area.tile += TileDiffXY(1, 0);
}
- area.tile += TileDiffXY(-area.w, 1);
}
}