Revert "improve astar cleanup performance. thanks @Andrettin"
This reverts commit c81abe99a2
.
This commit is contained in:
parent
e4f2898b91
commit
740701089f
1 changed files with 1 additions and 3 deletions
|
@ -307,19 +307,16 @@ static void AStarPrepare()
|
|||
/**
|
||||
** Clean up A*
|
||||
*/
|
||||
static void CostMoveToCacheCleanUp();
|
||||
static void AStarCleanUp()
|
||||
{
|
||||
ProfileBegin("AStarCleanUp");
|
||||
|
||||
if (CloseSetSize >= Threshold) {
|
||||
AStarPrepare();
|
||||
CostMoveToCacheCleanUp();
|
||||
} else {
|
||||
for (int i = 0; i < CloseSetSize; ++i) {
|
||||
AStarMatrix[CloseSet[i]].CostFromStart = 0;
|
||||
AStarMatrix[CloseSet[i]].InGoal = 0;
|
||||
CostMoveToCache[CloseSet[i]] = CacheNotSet;
|
||||
}
|
||||
}
|
||||
ProfileEnd("AStarCleanUp");
|
||||
|
@ -939,6 +936,7 @@ int AStarFindPath(const Vec2i &startPos, const Vec2i &goalPos, int gw, int gh,
|
|||
|
||||
// Initialize
|
||||
AStarCleanUp();
|
||||
CostMoveToCacheCleanUp();
|
||||
|
||||
OpenSetSize = 0;
|
||||
CloseSetSize = 0;
|
||||
|
|
Loading…
Add table
Reference in a new issue