(svn r2558) Change the internal map format from 7 arrays to one array of structs, this doesn't change the saved format for now. It's a stepping stone for further changes.

This commit is contained in:
tron
2005-07-13 18:04:01 +00:00
parent 1a1dde7c8d
commit 8c1d74162f
44 changed files with 990 additions and 827 deletions

18
rail.c
View File

@@ -113,28 +113,28 @@ RailType GetTileRailType(TileIndex tile, Trackdir trackdir)
switch (GetTileType(tile)) {
case MP_RAILWAY:
/* railway track */
type = _map3_lo[tile] & RAILTYPE_MASK;
type = _m[tile].m3 & RAILTYPE_MASK;
break;
case MP_STREET:
/* rail/road crossing */
if (IsLevelCrossing(tile))
type = _map3_hi[tile] & RAILTYPE_MASK;
type = _m[tile].m4 & RAILTYPE_MASK;
break;
case MP_STATION:
if (IsTrainStationTile(tile))
type = _map3_lo[tile] & RAILTYPE_MASK;
type = _m[tile].m3 & RAILTYPE_MASK;
break;
case MP_TUNNELBRIDGE:
/* railway tunnel */
if ((_map5[tile] & 0xFC) == 0) type = _map3_lo[tile] & RAILTYPE_MASK;
if ((_m[tile].m5 & 0xFC) == 0) type = _m[tile].m3 & RAILTYPE_MASK;
/* railway bridge ending */
if ((_map5[tile] & 0xC6) == 0x80) type = _map3_lo[tile] & RAILTYPE_MASK;
if ((_m[tile].m5 & 0xC6) == 0x80) type = _m[tile].m3 & RAILTYPE_MASK;
/* on railway bridge */
if ((_map5[tile] & 0xC6) == 0xC0 && ((DiagDirection)(_map5[tile] & 0x1)) == (exitdir & 0x1))
type = (_map3_lo[tile] >> 4) & RAILTYPE_MASK;
if ((_m[tile].m5 & 0xC6) == 0xC0 && ((DiagDirection)(_m[tile].m5 & 0x1)) == (exitdir & 0x1))
type = (_m[tile].m3 >> 4) & RAILTYPE_MASK;
/* under bridge (any type) */
if ((_map5[tile] & 0xC0) == 0xC0 && ((uint)_map5[tile] & 0x1) != (exitdir & 0x1))
type = _map3_lo[tile] & RAILTYPE_MASK;
if ((_m[tile].m5 & 0xC0) == 0xC0 && ((uint)_m[tile].m5 & 0x1) != (exitdir & 0x1))
type = _m[tile].m3 & RAILTYPE_MASK;
break;
default:
break;