diff options
author | alberth <alberth@openttd.org> | 2010-08-29 13:42:38 +0000 |
---|---|---|
committer | alberth <alberth@openttd.org> | 2010-08-29 13:42:38 +0000 |
commit | bc6a5a5e645ac44415e5c94bb12fa24cfa0724cd (patch) | |
tree | 7465e7ffd19b99e576643417400a0c1876b7a81c /src/pathfinder/npf/queue.h | |
parent | 2c962548e52e6334db0c2457eedb40710b23bbad (diff) | |
download | openttd-bc6a5a5e645ac44415e5c94bb12fa24cfa0724cd.tar.xz |
(svn r20686) -Codechange: Make init_BinaryHeap() a method.
Diffstat (limited to 'src/pathfinder/npf/queue.h')
-rw-r--r-- | src/pathfinder/npf/queue.h | 20 |
1 files changed, 7 insertions, 13 deletions
diff --git a/src/pathfinder/npf/queue.h b/src/pathfinder/npf/queue.h index 317ec1b71..4a939b61d 100644 --- a/src/pathfinder/npf/queue.h +++ b/src/pathfinder/npf/queue.h @@ -24,7 +24,14 @@ struct BinaryHeapNode { }; +/* + * Binary Heap + * For information, see: + * http://www.policyalmanac.org/games/binaryHeaps.htm + */ struct Queue { + void Init(uint max_size); + bool Push(void *item, int priority); void *Pop(); bool Delete(void *item, int priority); @@ -37,22 +44,9 @@ struct Queue { BinaryHeapNode **elements; }; - -/* - * Binary Heap - * For information, see: - * http://www.policyalmanac.org/games/binaryHeaps.htm - */ - /* The amount of elements that will be malloc'd at a time */ #define BINARY_HEAP_BLOCKSIZE_BITS 10 -/** - * Initializes a binary heap and allocates internal memory for maximum of - * max_size elements - */ -void init_BinaryHeap(Queue *q, uint max_size); - /* * Hash |