summaryrefslogtreecommitdiff
path: root/src/pathfinder/npf/aystar.cpp
diff options
context:
space:
mode:
authoralberth <alberth@openttd.org>2010-10-02 09:58:32 +0000
committeralberth <alberth@openttd.org>2010-10-02 09:58:32 +0000
commit49ba3539b5971535476110cba85dbf13f9b02bd6 (patch)
tree930187e3386008ff12b70efd588b399433004140 /src/pathfinder/npf/aystar.cpp
parent92f0bdec2cb46b8defa6a82a9ff608ce7a2d1392 (diff)
downloadopenttd-49ba3539b5971535476110cba85dbf13f9b02bd6.tar.xz
(svn r20867) -Codechange: Make AyStarMain_AddStartNode() a method.
Diffstat (limited to 'src/pathfinder/npf/aystar.cpp')
-rw-r--r--src/pathfinder/npf/aystar.cpp5
1 files changed, 2 insertions, 3 deletions
diff --git a/src/pathfinder/npf/aystar.cpp b/src/pathfinder/npf/aystar.cpp
index 956f81a83..2910f2c1c 100644
--- a/src/pathfinder/npf/aystar.cpp
+++ b/src/pathfinder/npf/aystar.cpp
@@ -268,13 +268,13 @@ int AyStarMain_Main(AyStar *aystar)
* clear() automatically when the algorithm finishes
* g is the cost for starting with this node.
*/
-static void AyStarMain_AddStartNode(AyStar *aystar, AyStarNode *start_node, uint g)
+void AyStar::AddStartNode(AyStarNode *start_node, uint g)
{
#ifdef AYSTAR_DEBUG
printf("[AyStar] Starting A* Algorithm from node (%d, %d, %d)\n",
TileX(start_node->tile), TileY(start_node->tile), start_node->direction);
#endif
- AyStarMain_OpenList_Add(aystar, NULL, start_node, 0, g);
+ AyStarMain_OpenList_Add(this, NULL, start_node, 0, g);
}
void init_AyStar(AyStar *aystar, Hash_HashProc hash, uint num_buckets)
@@ -289,6 +289,5 @@ void init_AyStar(AyStar *aystar, Hash_HashProc hash, uint num_buckets)
* That is why it can stay this high */
aystar->OpenListQueue.Init(102400);
- aystar->addstart = AyStarMain_AddStartNode;
aystar->main = AyStarMain_Main;
}