mirror of https://github.com/OpenTTD/OpenTTD.git
(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:
parent
c2e9eb7d7b
commit
d24165ea71
16
tile.c
16
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;
|
||||
}
|
||||
|
|
1
tile.h
1
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)
|
||||
{
|
||||
|
|
|
@ -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;
|
||||
|
|
Loading…
Reference in New Issue