Files
@ r5388:b83fe4735739
Branch filter:
Location: cpp/openttd-patchpack/source/bridge_map.c - annotation
r5388:b83fe4735739
1.0 KiB
text/x-c
(svn r7577) -Fix (r7565): Missed out some OSX files (Bjarni)
r3214:30243f5df9c0 r3214:30243f5df9c0 r3214:30243f5df9c0 r3214:30243f5df9c0 r3214:30243f5df9c0 r5385:1c8ef6521bf2 r3214:30243f5df9c0 r3214:30243f5df9c0 r3225:c5b1dafc46ed r3225:c5b1dafc46ed r4559:2222e3ea9700 r3225:c5b1dafc46ed r5385:1c8ef6521bf2 r3977:63d936e7e5a8 r3977:63d936e7e5a8 r5385:1c8ef6521bf2 r3225:c5b1dafc46ed r3225:c5b1dafc46ed r3225:c5b1dafc46ed r3225:c5b1dafc46ed r3225:c5b1dafc46ed r5385:1c8ef6521bf2 r5385:1c8ef6521bf2 r5385:1c8ef6521bf2 r5385:1c8ef6521bf2 r5385:1c8ef6521bf2 r5385:1c8ef6521bf2 r3225:c5b1dafc46ed r3225:c5b1dafc46ed r3225:c5b1dafc46ed r3225:c5b1dafc46ed r3225:c5b1dafc46ed r3225:c5b1dafc46ed r3214:30243f5df9c0 r3214:30243f5df9c0 r5385:1c8ef6521bf2 r5385:1c8ef6521bf2 r5385:1c8ef6521bf2 r3214:30243f5df9c0 r5385:1c8ef6521bf2 r5385:1c8ef6521bf2 r5385:1c8ef6521bf2 r5385:1c8ef6521bf2 r5385:1c8ef6521bf2 r3214:30243f5df9c0 r5385:1c8ef6521bf2 r5385:1c8ef6521bf2 r5385:1c8ef6521bf2 r5385:1c8ef6521bf2 r5385:1c8ef6521bf2 r3214:30243f5df9c0 | /* $Id$ */
#include "stdafx.h"
#include "openttd.h"
#include "bridge_map.h"
#include "variables.h"
TileIndex GetBridgeEnd(TileIndex tile, DiagDirection dir)
{
TileIndexDiff delta = TileOffsByDiagDir(dir);
dir = ReverseDiagDir(dir);
do {
tile += delta;
} while (!IsBridgeTile(tile) || GetBridgeRampDirection(tile) != dir);
return tile;
}
TileIndex GetNorthernBridgeEnd(TileIndex t)
{
return GetBridgeEnd(t, ReverseDiagDir(AxisToDiagDir(GetBridgeAxis(t))));
}
TileIndex GetSouthernBridgeEnd(TileIndex t)
{
return GetBridgeEnd(t, AxisToDiagDir(GetBridgeAxis(t)));
}
TileIndex GetOtherBridgeEnd(TileIndex tile)
{
assert(IsBridgeTile(tile));
return GetBridgeEnd(tile, GetBridgeRampDirection(tile));
}
uint GetBridgeHeight(TileIndex t)
{
uint h;
uint tileh = GetTileSlope(t, &h);
uint f = GetBridgeFoundation(tileh, DiagDirToAxis(GetBridgeRampDirection(t)));
// one height level extra if the ramp is on a flat foundation
return
h + TILE_HEIGHT +
(IS_INT_INSIDE(f, 1, 15) ? TILE_HEIGHT : 0) +
(IsSteepSlope(tileh) ? TILE_HEIGHT : 0);
}
|