273 32,40,40,42,40,44,44,46, |
273 32,40,40,42,40,44,44,46, |
274 32,48,48,50,48,52,52,54, |
274 32,48,48,50,48,52,52,54, |
275 48,56,56,58,56,60,60,62, |
275 48,56,56,58,56,60,60,62, |
276 }; |
276 }; |
277 |
277 |
278 static void TPFMode1(TrackPathFinder *tpf, TileIndex tile, uint direction) |
278 static void TPFMode1(TrackPathFinder* tpf, TileIndex tile, DiagDirection direction) |
279 { |
279 { |
280 uint bits; |
280 uint bits; |
281 int i; |
281 int i; |
282 RememberData rd; |
282 RememberData rd; |
283 TileIndex tile_org = tile; |
283 TileIndex tile_org = tile; |
504 } |
504 } |
505 |
505 |
506 // mark a tile as visited and store the length of the path. |
506 // mark a tile as visited and store the length of the path. |
507 // if we already had a better path to this tile, return false. |
507 // if we already had a better path to this tile, return false. |
508 // otherwise return true. |
508 // otherwise return true. |
509 static bool NtpVisit(NewTrackPathFinder *tpf, TileIndex tile, uint dir, uint length) |
509 static bool NtpVisit(NewTrackPathFinder* tpf, TileIndex tile, DiagDirection dir, uint length) |
510 { |
510 { |
511 uint hash,head; |
511 uint hash,head; |
512 HashLink *link, *new_link; |
512 HashLink *link, *new_link; |
513 |
513 |
514 assert(length < 16384-1); |
514 assert(length < 16384-1); |
669 |
669 |
670 // new more optimized pathfinder for trains... |
670 // new more optimized pathfinder for trains... |
671 // Tile is the tile the train is at. |
671 // Tile is the tile the train is at. |
672 // direction is the tile the train is moving towards. |
672 // direction is the tile the train is moving towards. |
673 |
673 |
674 static void NTPEnum(NewTrackPathFinder *tpf, TileIndex tile, uint direction) |
674 static void NTPEnum(NewTrackPathFinder* tpf, TileIndex tile, DiagDirection direction) |
675 { |
675 { |
676 TrackBits bits, allbits; |
676 TrackBits bits, allbits; |
677 uint track; |
677 uint track; |
678 TileIndex tile_org; |
678 TileIndex tile_org; |
679 StackedItem si; |
679 StackedItem si; |
910 } |
910 } |
911 } |
911 } |
912 |
912 |
913 |
913 |
914 // new pathfinder for trains. better and faster. |
914 // new pathfinder for trains. better and faster. |
915 void NewTrainPathfind(TileIndex tile, TileIndex dest, byte direction, NTPEnumProc *enum_proc, void *data) |
915 void NewTrainPathfind(TileIndex tile, TileIndex dest, DiagDirection direction, NTPEnumProc* enum_proc, void* data) |
916 { |
916 { |
917 NewTrackPathFinder tpf; |
917 NewTrackPathFinder tpf; |
918 |
918 |
919 tpf.dest = dest; |
919 tpf.dest = dest; |
920 tpf.userdata = data; |
920 tpf.userdata = data; |