summaryrefslogtreecommitdiff
path: root/aystar.c
diff options
context:
space:
mode:
authortron <tron@openttd.org>2005-01-22 22:47:58 +0000
committertron <tron@openttd.org>2005-01-22 22:47:58 +0000
commite5cd6b61933537888b1be19af437415861cca57f (patch)
tree078e42c5f2a6e1d8ef465541334a5c00039419e1 /aystar.c
parente75c48ec7a8920c475e515fa13c7629f19cf1a14 (diff)
downloadopenttd-e5cd6b61933537888b1be19af437415861cca57f.tar.xz
(svn r1596) Add some more statics
Diffstat (limited to 'aystar.c')
-rw-r--r--aystar.c15
1 files changed, 10 insertions, 5 deletions
diff --git a/aystar.c b/aystar.c
index 704922030..22d4ba813 100644
--- a/aystar.c
+++ b/aystar.c
@@ -19,13 +19,15 @@
#include "aystar.h"
// This looks in the Hash if a node exists in ClosedList
// If so, it returns the PathNode, else NULL
-PathNode *AyStarMain_ClosedList_IsInList(AyStar *aystar, AyStarNode *node) {
+static PathNode *AyStarMain_ClosedList_IsInList(AyStar *aystar, AyStarNode *node)
+{
return (PathNode*)Hash_Get(&aystar->ClosedListHash, node->tile, node->direction);
}
// This adds a node to the ClosedList
// It makes a copy of the data
-void AyStarMain_ClosedList_Add(AyStar *aystar, PathNode *node) {
+static void AyStarMain_ClosedList_Add(AyStar *aystar, PathNode *node)
+{
// Add a node to the ClosedList
PathNode *new_node = malloc(sizeof(PathNode));
*new_node = *node;
@@ -34,14 +36,16 @@ void AyStarMain_ClosedList_Add(AyStar *aystar, PathNode *node) {
// Checks if a node is in the OpenList
// If so, it returns the OpenListNode, else NULL
-OpenListNode *AyStarMain_OpenList_IsInList(AyStar *aystar, AyStarNode *node) {
+static OpenListNode *AyStarMain_OpenList_IsInList(AyStar *aystar, AyStarNode *node)
+{
return (OpenListNode*)Hash_Get(&aystar->OpenListHash, node->tile, node->direction);
}
// Gets the best node from OpenList
// returns the best node, or NULL of none is found
// Also it deletes the node from the OpenList
-OpenListNode *AyStarMain_OpenList_Pop(AyStar *aystar) {
+static OpenListNode *AyStarMain_OpenList_Pop(AyStar *aystar)
+{
// Return the item the Queue returns.. the best next OpenList item.
OpenListNode* res = (OpenListNode*)aystar->OpenListQueue.pop(&aystar->OpenListQueue);
if (res != NULL)
@@ -52,7 +56,8 @@ OpenListNode *AyStarMain_OpenList_Pop(AyStar *aystar) {
// Adds a node to the OpenList
// It makes a copy of node, and puts the pointer of parent in the struct
-void AyStarMain_OpenList_Add(AyStar *aystar, PathNode *parent, AyStarNode *node, int f, int g, int userdata) {
+static void AyStarMain_OpenList_Add(AyStar *aystar, PathNode *parent, AyStarNode *node, int f, int g, int userdata)
+{
// Add a new Node to the OpenList
OpenListNode* new_node = malloc(sizeof(OpenListNode));
new_node->g = g;