diff options
author | celestar <celestar@openttd.org> | 2006-04-04 11:35:52 +0000 |
---|---|---|
committer | celestar <celestar@openttd.org> | 2006-04-04 11:35:52 +0000 |
commit | 8b151d8faa1c059ec874427c1d25f5783eeee6d4 (patch) | |
tree | e6e0b22a7932338beafa21c661c109ec9a1de75b /station_map.h | |
parent | cc0ffe658224ca45262affab3df0c5900f084d05 (diff) | |
download | openttd-8b151d8faa1c059ec874427c1d25f5783eeee6d4.tar.xz |
(svn r4272) -Codechange: Moved the map-accessing stuff from station.h into station_map.h
Diffstat (limited to 'station_map.h')
-rw-r--r-- | station_map.h | 19 |
1 files changed, 19 insertions, 0 deletions
diff --git a/station_map.h b/station_map.h index e0ed3def0..c60a69b39 100644 --- a/station_map.h +++ b/station_map.h @@ -71,6 +71,20 @@ static inline bool IsRailwayStation(TileIndex t) return _m[t].m5 < RAILWAY_BASE + RAILWAY_SIZE; } +static inline bool IsRailwayStationTile(TileIndex t) +{ + return IsTileType(t, MP_STATION) && IsRailwayStation(t); +} + +static inline bool IsCompatibleTrainStationTile(TileIndex t1, TileIndex t2) +{ + assert(IsRailwayStationTile(t2)); + return + IsRailwayStationTile(t1) && + GB(_m[t1].m3, 0, 4) == GB(_m[t2].m3, 0, 4) && // same rail type? + GB(_m[t1].m5, 0, 1) == GB(_m[t2].m5, 0, 1); // same direction? +} + static inline bool IsHangar(TileIndex t) { assert(IsTileType(t, MP_STATION)); @@ -137,6 +151,11 @@ static inline bool IsBuoy_(TileIndex t) // XXX _ due to naming conflict return _m[t].m5 == BUOY_BASE; } +static inline bool IsBuoyTile(TileIndex t) +{ + return IsTileType(t, MP_STATION) && IsBuoy_(t); +} + static inline bool IsHangarTile(TileIndex t) { |