Changeset - r16156:aa205d601010
[Not reviewed]
master
0 2 0
alberth - 14 years ago 2010-10-02 09:46:40
alberth@openttd.org
(svn r20862) -Codechange: Make AyStar_Free() a method.
2 files changed with 5 insertions and 7 deletions:
0 comments (0 inline, 0 general)
src/pathfinder/npf/aystar.cpp
Show inline comments
 
@@ -198,13 +198,13 @@ static int AyStarMain_Loop(AyStar *aysta
 
/*
 
 * This function frees the memory it allocated
 
 */
 
static void AyStarMain_Free(AyStar *aystar)
 
void AyStar::Free()
 
{
 
	aystar->OpenListQueue.Free(false);
 
	this->OpenListQueue.Free(false);
 
	/* 2nd argument above is false, below is true, to free the values only
 
	 * once */
 
	delete_Hash(&aystar->OpenListHash, true);
 
	delete_Hash(&aystar->ClosedListHash, true);
 
	delete_Hash(&this->OpenListHash, true);
 
	delete_Hash(&this->ClosedListHash, true);
 
#ifdef AYSTAR_DEBUG
 
	printf("[AyStar] Memory free'd\n");
 
#endif
 
@@ -296,7 +296,6 @@ void init_AyStar(AyStar *aystar, Hash_Ha
 
	aystar->addstart  = AyStarMain_AddStartNode;
 
	aystar->main      = AyStarMain_Main;
 
	aystar->loop      = AyStarMain_Loop;
 
	aystar->free      = AyStarMain_Free;
 
	aystar->clear     = AyStarMain_Clear;
 
	aystar->checktile = AyStarMain_CheckTile;
 
}
src/pathfinder/npf/aystar.h
Show inline comments
 
@@ -108,7 +108,6 @@ typedef void AyStar_AddStartNode(AyStar 
 
typedef int AyStar_Main(AyStar *aystar);
 
typedef int AyStar_Loop(AyStar *aystar);
 
typedef int AyStar_CheckTile(AyStar *aystar, AyStarNode *current, OpenListNode *parent);
 
typedef void AyStar_Free(AyStar *aystar);
 
typedef void AyStar_Clear(AyStar *aystar);
 

	
 
struct AyStar {
 
@@ -152,7 +151,7 @@ struct AyStar {
 
	AyStar_AddStartNode *addstart;
 
	AyStar_Main *main;
 
	AyStar_Loop *loop;
 
	AyStar_Free *free;
 
	void Free();
 
	AyStar_Clear *clear;
 
	AyStar_CheckTile *checktile;
 

	
0 comments (0 inline, 0 general)