(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

This commit is contained in:
belugas
2006-04-12 20:01:52 +00:00
parent c26601eabd
commit b505564ee7
2 changed files with 47 additions and 50 deletions

View File

@@ -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);
}
}