summaryrefslogtreecommitdiff
path: root/npf.h
diff options
context:
space:
mode:
authormatthijs <matthijs@openttd.org>2005-04-07 19:19:16 +0000
committermatthijs <matthijs@openttd.org>2005-04-07 19:19:16 +0000
commitda3621c1804e6da9cefd712da9d0dd48fff61add (patch)
tree034da873c7ef2d41762a674839ff36339133a41e /npf.h
parent9c3813e21374c71da7c1c49cf52d68546815c1b0 (diff)
downloadopenttd-da3621c1804e6da9cefd712da9d0dd48fff61add.tar.xz
(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.
Diffstat (limited to 'npf.h')
-rw-r--r--npf.h7
1 files changed, 7 insertions, 0 deletions
diff --git a/npf.h b/npf.h
index be2fb95c1..6f665ec7e 100644
--- a/npf.h
+++ b/npf.h
@@ -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 */