summaryrefslogtreecommitdiff
path: root/pathfind.h
diff options
context:
space:
mode:
authorludde <ludde@openttd.org>2005-07-19 11:42:40 +0000
committerludde <ludde@openttd.org>2005-07-19 11:42:40 +0000
commit08725cd6dfa1bc06adf3f3909e811e7abef64538 (patch)
tree4d3f43a36f40b9b8d244fda8f0cdb2bba4bc64ec /pathfind.h
parent857a3a1ffce4ac4a150a042e45af9513d516adaf (diff)
downloadopenttd-08725cd6dfa1bc06adf3f3909e811e7abef64538.tar.xz
(svn r2635) Fix: [ntp/misc] Improve the old pathfinder. Changed it to A* instead of Dijkstra.
- Benchmark shows that NTP is now around 10x faster than NPF. - Made IsTunnelTile macro to determine if a tile is a tunnel. - Added some useful debugging functions for making tiles red / getting accurate timestamps. - Remove old depot finding algorithm. - Disable warning for signed/unsigned comparisons.
Diffstat (limited to 'pathfind.h')
-rw-r--r--pathfind.h3
1 files changed, 2 insertions, 1 deletions
diff --git a/pathfind.h b/pathfind.h
index 0543df461..583836693 100644
--- a/pathfind.h
+++ b/pathfind.h
@@ -8,6 +8,7 @@ typedef struct TrackPathFinder TrackPathFinder;
typedef bool TPFEnumProc(TileIndex tile, void *data, int track, uint length, byte *state);
typedef void TPFAfterProc(TrackPathFinder *tpf);
+typedef bool NTPEnumProc(TileIndex tile, void *data, int track, uint length);
#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))
@@ -63,6 +64,6 @@ typedef struct {
} FindLengthOfTunnelResult;
FindLengthOfTunnelResult FindLengthOfTunnel(TileIndex tile, int direction);
-void NewTrainPathfind(TileIndex tile, byte direction, TPFEnumProc *enum_proc, void *data, byte *cache);
+void NewTrainPathfind(TileIndex tile, TileIndex dest, byte direction, NTPEnumProc *enum_proc, void *data);
#endif /* PATHFIND_H */