equal
deleted
inserted
replaced
2 |
2 |
3 #ifndef PATHFIND_H |
3 #ifndef PATHFIND_H |
4 #define PATHFIND_H |
4 #define PATHFIND_H |
5 |
5 |
6 #include "direction.h" |
6 #include "direction.h" |
|
7 #include "openttd.h" |
7 |
8 |
8 enum { |
9 enum { |
9 STR_FACTOR = 2, |
10 STR_FACTOR = 2, |
10 DIAG_FACTOR = 3 |
11 DIAG_FACTOR = 3 |
11 }; |
12 }; |
12 |
13 |
13 //#define PF_BENCH // perform simple benchmarks on the train pathfinder (not |
14 //#define PF_BENCH // perform simple benchmarks on the train pathfinder (not |
14 //supported on all archs) |
15 //supported on all archs) |
15 |
16 |
16 typedef struct TrackPathFinder TrackPathFinder; |
17 typedef struct TrackPathFinder TrackPathFinder; |
17 typedef bool TPFEnumProc(TileIndex tile, void *data, int track, uint length, byte *state); |
18 typedef bool TPFEnumProc(TileIndex tile, void *data, Trackdir trackdir, uint length, byte *state); |
18 typedef void TPFAfterProc(TrackPathFinder *tpf); |
19 typedef void TPFAfterProc(TrackPathFinder *tpf); |
19 |
20 |
20 typedef bool NTPEnumProc(TileIndex tile, void *data, int track, uint length); |
21 typedef bool NTPEnumProc(TileIndex tile, void *data, int track, uint length); |
21 |
22 |
22 #define PATHFIND_GET_LINK_OFFS(tpf, link) ((byte*)(link) - (byte*)tpf->links) |
23 #define PATHFIND_GET_LINK_OFFS(tpf, link) ((byte*)(link) - (byte*)tpf->links) |
49 |
50 |
50 void *userdata; |
51 void *userdata; |
51 |
52 |
52 RememberData rd; |
53 RememberData rd; |
53 |
54 |
54 int the_dir; |
55 TrackdirByte the_dir; |
55 |
56 |
56 byte tracktype; |
57 TransportTypeByte tracktype; |
57 byte var2; |
58 byte var2; |
58 bool disable_tile_hash; |
59 bool disable_tile_hash; |
59 bool hasbit_13; |
60 bool hasbit_13; |
60 |
61 |
61 uint16 hash_head[0x400]; |
62 uint16 hash_head[0x400]; |