mirror of https://github.com/OpenTTD/OpenTTD
(svn r5352) -Fix: Return accurate slope information for tunnels and bridges to fix several foundation graphics glitches
parent
7f444dde30
commit
20ee056b9f
|
@ -1146,8 +1146,29 @@ static uint GetSlopeZ_TunnelBridge(const TileInfo* ti)
|
||||||
|
|
||||||
static Slope GetSlopeTileh_TunnelBridge(TileIndex tile, Slope tileh)
|
static Slope GetSlopeTileh_TunnelBridge(TileIndex tile, Slope tileh)
|
||||||
{
|
{
|
||||||
// not accurate, but good enough for slope graphics drawing
|
uint f;
|
||||||
return SLOPE_FLAT;
|
|
||||||
|
if (IsTunnel(tile)) {
|
||||||
|
return tileh;
|
||||||
|
} else {
|
||||||
|
if (IsBridgeRamp(tile)) {
|
||||||
|
if (HASBIT(BRIDGE_NO_FOUNDATION, tileh)) {
|
||||||
|
return tileh;
|
||||||
|
} else {
|
||||||
|
f = GetBridgeFoundation(tileh, DiagDirToAxis(GetBridgeRampDirection(tile)));
|
||||||
|
}
|
||||||
|
} else {
|
||||||
|
if (IsTransportUnderBridge(tile)) {
|
||||||
|
f = _bridge_foundations[GetBridgeAxis(tile)][tileh];
|
||||||
|
} else {
|
||||||
|
return tileh;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
if (f == 0) return tileh;
|
||||||
|
if (f < 15) return SLOPE_FLAT;
|
||||||
|
return _inclined_tileh[f - 15];
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
|
Loading…
Reference in New Issue