Changeset - r2416:b78db7ce4fdc
[Not reviewed]
master
0 1 0
tron - 19 years ago 2005-09-11 15:01:00
tron@openttd.org
(svn r2942) Staticise some functions
1 file changed with 3 insertions and 3 deletions:
npf.c
3
3
0 comments (0 inline, 0 general)
npf.c
Show inline comments
 
@@ -27,13 +27,13 @@ static const uint _trackdir_length[TRACK
 
/**
 
 * Calculates the minimum distance traveled to get from t0 to t1 when only
 
 * using tracks (ie, only making 45 degree turns). Returns the distance in the
 
 * NPF scale, ie the number of full tiles multiplied by NPF_TILE_LENGTH to
 
 * prevent rounding.
 
 */
 
uint NPFDistanceTrack(TileIndex t0, TileIndex t1)
 
static uint NPFDistanceTrack(TileIndex t0, TileIndex t1)
 
{
 
	const uint dx = abs(TileX(t0) - TileX(t1));
 
	const uint dy = abs(TileY(t0) - TileY(t1));
 

	
 
	const uint straightTracks = 2 * min(dx, dy); /* The number of straight (not full length) tracks */
 
	/* OPTIMISATION:
 
@@ -50,13 +50,13 @@ uint NPFDistanceTrack(TileIndex t0, Tile
 
/**
 
 * Check if a rail track is the end of the line. Will also consider 1-way signals to be the end of a line.
 
 * @param tile The tile on which the current track is.
 
 * @param trackdir The (track)direction in which you want to look.
 
 * @param enginetype The type of the engine for which we are checking this.
 
 */
 
bool IsEndOfLine(TileIndex tile, Trackdir trackdir, RailType enginetype)
 
static bool IsEndOfLine(TileIndex tile, Trackdir trackdir, RailType enginetype)
 
{
 
	byte exitdir = TrackdirToExitdir(trackdir);
 
	TileIndex dst_tile;
 
	uint32 ts;
 

	
 
	/* Can always go into a tunnel */
 
@@ -158,13 +158,13 @@ static TileIndex CalcClosestStationTile(
 
	// return the tile of our target coordinates
 
	return TileXY(x, y);
 
}
 

	
 
/* On PBS pathfinding runs, this is called before pathfinding ends (BeforeExit aystar callback), and will
 
 * reserve the appropriate tracks, if needed. */
 
void NPFReservePBSPath(AyStar *as)
 
static void NPFReservePBSPath(AyStar *as)
 
{
 
	NPFFoundTargetData* ftd = (NPFFoundTargetData*)as->user_path;
 
	bool eol_end = false;
 

	
 
	if (ftd->best_trackdir == 0xFF)
 
		return;
0 comments (0 inline, 0 general)