pathfind.h File Reference

The oldest pathfinder that's supported. More...

#include "direction_type.h"

Go to the source code of this file.

Data Structures

struct  TrackPathFinderLink
struct  RememberData
struct  TrackPathFinder

Defines

#define PATHFIND_GET_LINK_OFFS(tpf, link)   ((byte*)(link) - (byte*)tpf->links)
#define PATHFIND_GET_LINK_PTR(tpf, link_offs)   (TrackPathFinderLink*)((byte*)tpf->links + (link_offs))
#define PATHFIND_HASH_TILE(tile)   (TileX(tile) & 0x1F) + ((TileY(tile) & 0x1F) << 5)

Typedefs

typedef bool TPFEnumProc (TileIndex tile, void *data, Trackdir trackdir, uint length)
typedef void TPFAfterProc (TrackPathFinder *tpf)
typedef bool NTPEnumProc (TileIndex tile, void *data, int track, uint length)

Enumerations

enum  { STR_FACTOR = 2, DIAG_FACTOR = 3 }
enum  PathfindFlags { PATHFIND_FLAGS_NONE = 0, PATHFIND_FLAGS_SHIP_MODE = 0x0800, PATHFIND_FLAGS_DISABLE_TILE_HASH = 0x1000 }
 Some flags to modify the behaviour of original pathfinder. More...

Functions

void FollowTrack (TileIndex tile, PathfindFlags flags, TransportType tt, uint sub_type, DiagDirection direction, TPFEnumProc *enum_proc, TPFAfterProc *after_proc, void *data)
void NewTrainPathfind (TileIndex tile, TileIndex dest, RailTypes railtypes, DiagDirection direction, NTPEnumProc *enum_proc, void *data)
 new pathfinder for trains.


Detailed Description

The oldest pathfinder that's supported.

Definition in file pathfind.h.


Enumeration Type Documentation

Some flags to modify the behaviour of original pathfinder.

Enumerator:
PATHFIND_FLAGS_SHIP_MODE  pathfinder with some optimizations for ships, but does not work for other types.
PATHFIND_FLAGS_DISABLE_TILE_HASH  do not check for searching in circles

Definition at line 70 of file pathfind.h.


Function Documentation

void NewTrainPathfind ( TileIndex  tile,
TileIndex  dest,
RailTypes  railtypes,
DiagDirection  direction,
NTPEnumProc *  enum_proc,
void *  data 
)

new pathfinder for trains.

better and faster.

Definition at line 785 of file pathfind.cpp.

References _settings_game, lengthof, min(), PathfinderSettings::opf, GameSettings::pf, OPFSettings::pf_maxlength, and TRANSPORT_RAIL.

Referenced by DoTrainPathfind(), and FindClosestTrainDepot().


Generated on Mon Feb 16 23:12:17 2009 for openttd by  doxygen 1.5.6