From d24165ea712a5a4f482e767fbb59af65caf3315a Mon Sep 17 00:00:00 2001 From: Darkvater Date: Sat, 20 May 2006 20:56:31 +0000 Subject: [PATCH] (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). --- tile.c | 16 ++++++++++++++++ tile.h | 1 + tunnelbridge_cmd.c | 17 ----------------- 3 files changed, 17 insertions(+), 17 deletions(-) diff --git a/tile.c b/tile.c index f18932c3f3..5d5056a95d 100644 --- a/tile.c +++ b/tile.c @@ -68,3 +68,19 @@ uint GetTileZ(TileIndex tile) 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 --git a/tile.h b/tile.h index 90a2941063..65d2c31f2d 100644 --- a/tile.h +++ b/tile.h @@ -50,6 +50,7 @@ uint GetMapExtraBits(TileIndex tile); 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 --git a/tunnelbridge_cmd.c b/tunnelbridge_cmd.c index aba652c0c7..d8ee7d9277 100644 --- a/tunnelbridge_cmd.c +++ b/tunnelbridge_cmd.c @@ -1208,23 +1208,6 @@ static inline DiagDirection GetBridgeRampDirection(TileIndex t) {return (DiagDir 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;