diff options
author | belugas <belugas@openttd.org> | 2006-04-12 20:01:52 +0000 |
---|---|---|
committer | belugas <belugas@openttd.org> | 2006-04-12 20:01:52 +0000 |
commit | b505564ee7ceb253bf5ff53d52ce38bb952a70c3 (patch) | |
tree | c21755754658acd47d65351b220f3769bae863e3 /station_cmd.c | |
parent | c26601eabd3fdec8d6a32c4b8d3f0c1c6b26223e (diff) | |
download | openttd-b505564ee7ceb253bf5ff53d52ce38bb952a70c3.tar.xz |
(svn r4403) CodeChange : Add GetStationGfx and make use of [G|S]etStationGfx accessors. Also, use GetStationGfx instead of directly accessing the map for functions in station_map.h
Diffstat (limited to 'station_cmd.c')
-rw-r--r-- | station_cmd.c | 30 |
1 files changed, 15 insertions, 15 deletions
diff --git a/station_cmd.c b/station_cmd.c index 7e60b7d4c..4ae6e5533 100644 --- a/station_cmd.c +++ b/station_cmd.c @@ -2066,7 +2066,7 @@ static void TileLoop_Station(TileIndex tile) { // FIXME -- GetTileTrackStatus_Station -> animated stationtiles // hardcoded.....not good - switch (_m[tile].m5) { + switch (GetStationGfx(tile)) { case 0x27: // large big airport case 0x3A: // flag small airport case 0x5A: // radar international airport @@ -2086,41 +2086,41 @@ static void TileLoop_Station(TileIndex tile) static void AnimateTile_Station(TileIndex tile) { - byte m5 = _m[tile].m5; + byte gfx = GetStationGfx(tile); //FIXME -- AnimateTile_Station -> not nice code, lots of things double // again hardcoded...was a quick hack // turning radar / windsack on airport - if (m5 >= 39 && m5 <= 50) { // turning radar (39 - 50) + if (gfx >= 39 && gfx <= 50) { // turning radar (39 - 50) if (_tick_counter & 3) return; - if (++m5 == 50+1) - m5 = 39; + if (++gfx == 50+1) + gfx = 39; - _m[tile].m5 = m5; + SetStationGfx(tile, gfx); MarkTileDirtyByTile(tile); //added - begin - } else if (m5 >= 90 && m5 <= 113) { // turning radar with ground under it (different fences) (90 - 101 | 102 - 113) + } else if (gfx >= 90 && gfx <= 113) { // turning radar with ground under it (different fences) (90 - 101 | 102 - 113) if (_tick_counter & 3) return; - m5++; + gfx++; - if (m5 == 101+1) {m5 = 90;} // radar with fences in south - else if (m5 == 113+1) {m5 = 102;} // radar with fences in north + if (gfx == 101+1) {gfx = 90;} // radar with fences in south + else if (gfx == 113+1) {gfx = 102;} // radar with fences in north - _m[tile].m5 = m5; + SetStationGfx(tile, gfx); MarkTileDirtyByTile(tile); //added - end - } else if (m5 >= 0x3A && m5 <= 0x3D) { // windsack (58 - 61) + } else if (gfx >= 0x3A && gfx <= 0x3D) { // windsack (58 - 61) if (_tick_counter & 1) return; - if (++m5 == 0x3D+1) - m5 = 0x3A; + if (++gfx == 0x3D+1) + gfx = 0x3A; - _m[tile].m5 = m5; + SetStationGfx(tile, gfx); MarkTileDirtyByTile(tile); } } |