summaryrefslogtreecommitdiff
path: root/rail.c
diff options
context:
space:
mode:
authortron <tron@openttd.org>2005-07-13 18:04:01 +0000
committertron <tron@openttd.org>2005-07-13 18:04:01 +0000
commit8c1d74162f1544e351ae6308cbcca06f324c2c36 (patch)
treeb36523450a7bccf37ca126b6f857d1529d44c67b /rail.c
parent1a1dde7c8d0cf18e49b5af7fef1368216120eed1 (diff)
downloadopenttd-8c1d74162f1544e351ae6308cbcca06f324c2c36.tar.xz
(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.
Diffstat (limited to 'rail.c')
-rw-r--r--rail.c18
1 files changed, 9 insertions, 9 deletions
diff --git a/rail.c b/rail.c
index 5952dae57..a738ec344 100644
--- a/rail.c
+++ b/rail.c
@@ -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;