# HG changeset patch # User Darkvater # Date 1148158591 0 # Node ID 4a72310c9cf545accc7970c7246001e4a9d04dea # Parent 9cb1a8fd915549d57a98a95b0c38cbb0fd8e3f91 (svn r4932) - Codechange: (r4931): move GetTileMaxZ to tile.[ch] instead of lingering it in tunnelbridge_cmd.c. Might be needed some day for some other backport commit (Tron). diff -r 9cb1a8fd9155 -r 4a72310c9cf5 tile.c --- a/tile.c Sat May 20 20:16:08 2006 +0000 +++ b/tile.c Sat May 20 20:56:31 2006 +0000 @@ -68,3 +68,19 @@ GetTileSlope(tile, &h); return h; } + +uint GetTileMaxZ(TileIndex t) +{ + uint max; + uint h; + + h = TileHeight(t); + max = h; + h = TileHeight(t + TileDiffXY(1, 0)); + if (h > max) max = h; + h = TileHeight(t + TileDiffXY(0, 1)); + if (h > max) max = h; + h = TileHeight(t + TileDiffXY(1, 1)); + if (h > max) max = h; + return max * 8; +} diff -r 9cb1a8fd9155 -r 4a72310c9cf5 tile.h --- a/tile.h Sat May 20 20:16:08 2006 +0000 +++ b/tile.h Sat May 20 20:56:31 2006 +0000 @@ -50,6 +50,7 @@ uint GetTileh(uint n, uint w, uint e, uint s, uint *h); uint GetTileSlope(TileIndex tile, uint *h); uint GetTileZ(TileIndex tile); +uint GetTileMaxZ(TileIndex tile); static inline bool CorrectZ(uint tileh) { diff -r 9cb1a8fd9155 -r 4a72310c9cf5 tunnelbridge_cmd.c --- a/tunnelbridge_cmd.c Sat May 20 20:16:08 2006 +0000 +++ b/tunnelbridge_cmd.c Sat May 20 20:56:31 2006 +0000 @@ -1208,23 +1208,6 @@ static inline bool IsTransportUnderBridge(TileIndex t) {return HASBIT(_m[t].m5, 5);} static inline uint GetBridgeAxis(TileIndex t) {return GB(_m[t].m5, 0, 1);} -static uint GetTileMaxZ(TileIndex t) -{ - uint max; - uint h; - - h = TileHeight(t); - max = h; - h = TileHeight(t + TileDiffXY(1, 0)); - if (h > max) max = h; - h = TileHeight(t + TileDiffXY(0, 1)); - if (h > max) max = h; - h = TileHeight(t + TileDiffXY(1, 1)); - if (h > max) max = h; - return max * 8; -} - - static uint GetSlopeZ_TunnelBridge(const TileInfo* ti) { TileIndex tile = ti->tile;