1
0
forked from 0ad/0ad

Add pathfinders to new profiler

This was SVN commit r10633.
This commit is contained in:
Ykkrosh 2011-11-29 20:29:50 +00:00
parent 2d017698e1
commit 4da8bf001f
2 changed files with 7 additions and 2 deletions

View File

@ -366,7 +366,7 @@ void CCmpPathfinder::ComputePath(entity_pos_t x0, entity_pos_t z0, const Goal& g
{
UpdateGrid();
PROFILE("ComputePath");
PROFILE3("ComputePath");
PathfinderState state = { 0 };
@ -490,6 +490,11 @@ void CCmpPathfinder::ComputePath(entity_pos_t x0, entity_pos_t z0, const Goal& g
m_DebugGrid = state.tiles;
m_DebugSteps = state.steps;
PROFILE2_ATTR("from: (%d, %d)", i0, j0);
PROFILE2_ATTR("to: (%d, %d)", state.iGoal, state.jGoal);
PROFILE2_ATTR("reached: (%d, %d)", state.iBest, state.jBest);
PROFILE2_ATTR("steps: %d", state.steps);
#if PATHFIND_STATS
printf("PATHFINDER: steps=%d avgo=%d proc=%d impc=%d impo=%d addo=%d\n", state.steps, state.sumOpenSize/state.steps, state.numProcessed, state.numImproveClosed, state.numImproveOpen, state.numAddToOpen);
#endif

View File

@ -499,7 +499,7 @@ void CCmpPathfinder::ComputeShortPath(const IObstructionTestFilter& filter,
{
UpdateGrid(); // TODO: only need to bother updating if the terrain changed
PROFILE("ComputeShortPath");
PROFILE3("ComputeShortPath");
// ScopeTimer UID__(L"ComputeShortPath");
m_DebugOverlayShortPathLines.clear();