(svn r2165) - Codechange: [NPF] Properly enummed NPF hash size, it is easily changable now.

- Codechange: [NPF] Improved the NPF hash calculation slightly.
- Codechange: [NPF] Increased hash size, should speed up somewhat.
This commit is contained in:
matthijs
2005-04-07 19:19:16 +00:00
parent 1ba3d4ea9f
commit ad5c6a1ecd
4 changed files with 69 additions and 5 deletions

7
npf.h
View File

@@ -8,6 +8,13 @@
//#define NPF_DEBUG
//#define NPF_MARKROUTE //Mark the routes considered by the pathfinder by
//mowing grass
enum {
NPF_HASH_BITS = 12, /* The size of the hash used in pathfinding. Just changing this value should be sufficient to change the hash size. Should be an even value. */
/* Do no change below values */
NPF_HASH_SIZE = 1 << NPF_HASH_BITS,
NPF_HASH_HALFBITS = NPF_HASH_BITS / 2,
NPF_HASH_HALFMASK = (1 << NPF_HASH_HALFBITS) - 1
};
typedef struct NPFFindStationOrTileData { /* Meant to be stored in AyStar.targetdata */
TileIndex dest_coords; /* An indication of where the station is, for heuristic purposes, or the target tile */