Changeset View
Changeset View
Standalone View
Standalone View
source/simulation2/helpers/LongPathfinder.cpp
Show First 20 Lines • Show All 713 Lines • ▼ Show 20 Lines | |||||
} | } | ||||
void LongPathfinder::ComputeJPSPath(const HierarchicalPathfinder& hierPath, entity_pos_t x0, entity_pos_t z0, const PathGoal& origGoal, pass_class_t passClass, WaypointPath& path) const | void LongPathfinder::ComputeJPSPath(const HierarchicalPathfinder& hierPath, entity_pos_t x0, entity_pos_t z0, const PathGoal& origGoal, pass_class_t passClass, WaypointPath& path) const | ||||
{ | { | ||||
PROFILE("ComputePathJPS"); | PROFILE("ComputePathJPS"); | ||||
PROFILE2_IFSPIKE("ComputePathJPS", 0.0002); | PROFILE2_IFSPIKE("ComputePathJPS", 0.0002); | ||||
PathfinderState state = { 0 }; | PathfinderState state = { 0 }; | ||||
if (m_UseJPSCache && m_JumpPointCache.find(passClass) == m_JumpPointCache.end()) | std::map<pass_class_t, shared_ptr<JumpPointCache> >::const_iterator it = m_JumpPointCache.find(passClass); | ||||
state.jpc = it->second.get(); | |||||
if (m_UseJPSCache && !state.jpc) | |||||
Stan: Use the explicit type, see comment on the commit :) | |||||
Not Done Inline ActionsAdd a space between the two closing >. Sub-par compilers (can't remember which ones) sometimes mistake that for a >> operator. Itms: Add a space between the two closing `>`. Sub-par compilers (can't remember which ones)… | |||||
Not Done Inline ActionsThat's... Retarded... Stan: That's... Retarded... | |||||
Done Inline Actions(2019 and this is still an issue -_-) Are these compilers actually supported nowadays? Does VS2013 exhibit this? wraitii: (2019 and this is still an issue -_-)
Are these compilers actually supported nowadays? Does… | |||||
Not Done Inline ActionsI actually think splitting them helps with readability, so I'd push for doing it anyway. But yes IIRC the issue still exists with 2013 and is fixed in 2015. Itms: I actually think splitting them helps with readability, so I'd push for doing it anyway. But… | |||||
{ | { | ||||
state.jpc = new JumpPointCache; | state.jpc = new JumpPointCache; | ||||
state.jpc->reset(m_Grid, passClass); | state.jpc->reset(m_Grid, passClass); | ||||
debug_printf("PATHFINDER: JPC memory: %d kB\n", (int)state.jpc->GetMemoryUsage() / 1024); | debug_printf("PATHFINDER: JPC memory: %d kB\n", (int)state.jpc->GetMemoryUsage() / 1024); | ||||
m_JumpPointCache[passClass] = shared_ptr<JumpPointCache>(state.jpc); | m_JumpPointCache[passClass] = shared_ptr<JumpPointCache>(state.jpc); | ||||
} | } | ||||
// Convert the start coordinates to tile indexes | // Convert the start coordinates to tile indexes | ||||
▲ Show 20 Lines • Show All 313 Lines • Show Last 20 Lines |
Wildfire Games · Phabricator
Use the explicit type, see comment on the commit :)