diff options
author | alberth <alberth@openttd.org> | 2010-10-02 09:49:32 +0000 |
---|---|---|
committer | alberth <alberth@openttd.org> | 2010-10-02 09:49:32 +0000 |
commit | 8e5aaca6531c8048ff32878a4a2ecc98e5bad261 (patch) | |
tree | 50638962edc1fa2695fe4754ffc41fd8162a9ac2 /src/pathfinder/npf/aystar.cpp | |
parent | 2a796187efdaeb0050d0501ad7b468fdce84c2ee (diff) | |
download | openttd-8e5aaca6531c8048ff32878a4a2ecc98e5bad261.tar.xz |
(svn r20864) -Codechange: Make AyStar_Clear() a method.
Diffstat (limited to 'src/pathfinder/npf/aystar.cpp')
-rw-r--r-- | src/pathfinder/npf/aystar.cpp | 11 |
1 files changed, 5 insertions, 6 deletions
diff --git a/src/pathfinder/npf/aystar.cpp b/src/pathfinder/npf/aystar.cpp index 0facc358f..770fc3499 100644 --- a/src/pathfinder/npf/aystar.cpp +++ b/src/pathfinder/npf/aystar.cpp @@ -214,14 +214,14 @@ void AyStar::Free() * This function make the memory go back to zero * This function should be called when you are using the same instance again. */ -void AyStarMain_Clear(AyStar *aystar) +void AyStar::Clear() { /* Clean the Queue, but not the elements within. That will be done by * the hash. */ - aystar->OpenListQueue.Clear(false); + this->OpenListQueue.Clear(false); /* Clean the hashes */ - clear_Hash(&aystar->OpenListHash, true); - clear_Hash(&aystar->ClosedListHash, true); + clear_Hash(&this->OpenListHash, true); + clear_Hash(&this->ClosedListHash, true); #ifdef AYSTAR_DEBUG printf("[AyStar] Cleared AyStar\n"); @@ -254,7 +254,7 @@ int AyStarMain_Main(AyStar *aystar) #endif if (r != AYSTAR_STILL_BUSY) { /* We're done, clean up */ - aystar->clear(aystar); + aystar->Clear(); } switch (r) { @@ -295,6 +295,5 @@ void init_AyStar(AyStar *aystar, Hash_HashProc hash, uint num_buckets) aystar->addstart = AyStarMain_AddStartNode; aystar->main = AyStarMain_Main; - aystar->clear = AyStarMain_Clear; aystar->checktile = AyStarMain_CheckTile; } |