Changeset View
Changeset View
Standalone View
Standalone View
ps/trunk/source/simulation2/helpers/HierarchicalPathfinder.cpp
Show All 15 Lines | |||||
*/ | */ | ||||
#include "precompiled.h" | #include "precompiled.h" | ||||
#include "HierarchicalPathfinder.h" | #include "HierarchicalPathfinder.h" | ||||
#include "graphics/Overlay.h" | #include "graphics/Overlay.h" | ||||
#include "ps/Profile.h" | #include "ps/Profile.h" | ||||
#include "renderer/Scene.h" | |||||
// Find the root ID of a region, used by InitRegions | // Find the root ID of a region, used by InitRegions | ||||
inline u16 RootID(u16 x, const std::vector<u16>& v) | inline u16 RootID(u16 x, const std::vector<u16>& v) | ||||
{ | { | ||||
while (v[x] < x) | while (v[x] < x) | ||||
x = v[x]; | x = v[x]; | ||||
return x; | return x; | ||||
▲ Show 20 Lines • Show All 310 Lines • ▼ Show 20 Lines | void HierarchicalPathfinder::SetDebugOverlay(bool enabled, const CSimContext* simContext) | ||||
else if (!enabled && m_DebugOverlay) | else if (!enabled && m_DebugOverlay) | ||||
{ | { | ||||
SAFE_DELETE(m_DebugOverlay); | SAFE_DELETE(m_DebugOverlay); | ||||
m_DebugOverlayLines.clear(); | m_DebugOverlayLines.clear(); | ||||
m_SimContext = NULL; | m_SimContext = NULL; | ||||
} | } | ||||
} | } | ||||
void HierarchicalPathfinder::RenderSubmit(SceneCollector& collector) | |||||
{ | |||||
if (!m_DebugOverlay) | |||||
return; | |||||
for (size_t i = 0; i < m_DebugOverlayLines.size(); ++i) | |||||
collector.Submit(&m_DebugOverlayLines[i]); | |||||
} | |||||
void HierarchicalPathfinder::Recompute(Grid<NavcellData>* grid, | void HierarchicalPathfinder::Recompute(Grid<NavcellData>* grid, | ||||
const std::map<std::string, pass_class_t>& nonPathfindingPassClassMasks, | const std::map<std::string, pass_class_t>& nonPathfindingPassClassMasks, | ||||
const std::map<std::string, pass_class_t>& pathfindingPassClassMasks) | const std::map<std::string, pass_class_t>& pathfindingPassClassMasks) | ||||
{ | { | ||||
PROFILE2("Hierarchical Recompute"); | PROFILE2("Hierarchical Recompute"); | ||||
m_PassClassMasks = pathfindingPassClassMasks; | m_PassClassMasks = pathfindingPassClassMasks; | ||||
▲ Show 20 Lines • Show All 420 Lines • Show Last 20 Lines |
Wildfire Games · Phabricator