(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).

This commit is contained in:
Darkvater 2006-05-20 20:56:31 +00:00
parent c2e9eb7d7b
commit d24165ea71
3 changed files with 17 additions and 17 deletions

16
tile.c
View File

@ -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;
}

1
tile.h
View File

@ -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)
{

View File

@ -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;