Changeset View
Changeset View
Standalone View
Standalone View
ps/trunk/source/simulation2/components/CCmpObstructionManager.cpp
Show First 20 Lines • Show All 154 Lines • ▼ Show 20 Lines | virtual void Init(const CParamNode& UNUSED(paramNode)) | ||||
m_DebugOverlayEnabled = false; | m_DebugOverlayEnabled = false; | ||||
m_DebugOverlayDirty = true; | m_DebugOverlayDirty = true; | ||||
m_UnitShapeNext = 1; | m_UnitShapeNext = 1; | ||||
m_StaticShapeNext = 1; | m_StaticShapeNext = 1; | ||||
m_UpdateInformations.dirty = true; | m_UpdateInformations.dirty = true; | ||||
m_UpdateInformations.globallyDirty = true; | m_UpdateInformations.globallyDirty = true; | ||||
m_UpdateInformations.globalRecompute = true; | |||||
m_PassabilityCircular = false; | m_PassabilityCircular = false; | ||||
m_WorldX0 = m_WorldZ0 = m_WorldX1 = m_WorldZ1 = entity_pos_t::Zero(); | m_WorldX0 = m_WorldZ0 = m_WorldX1 = m_WorldZ1 = entity_pos_t::Zero(); | ||||
m_TerrainTiles = 0; | m_TerrainTiles = 0; | ||||
// Initialise with bogus values (these will get replaced when | // Initialise with bogus values (these will get replaced when | ||||
// SetBounds is called) | // SetBounds is called) | ||||
▲ Show 20 Lines • Show All 324 Lines • ▼ Show 20 Lines | virtual void SetDebugOverlay(bool enabled) | ||||
if (!enabled) | if (!enabled) | ||||
m_DebugOverlayLines.clear(); | m_DebugOverlayLines.clear(); | ||||
} | } | ||||
void RenderSubmit(SceneCollector& collector); | void RenderSubmit(SceneCollector& collector); | ||||
virtual void UpdateInformations(GridUpdateInformation& informations) | virtual void UpdateInformations(GridUpdateInformation& informations) | ||||
{ | { | ||||
// If the pathfinder wants to perform a full update, don't change that. | if (!m_UpdateInformations.dirtinessGrid.blank()) | ||||
if (m_UpdateInformations.dirty && !informations.globalRecompute) | informations.MergeAndClear(m_UpdateInformations); | ||||
informations.swap(m_UpdateInformations); | |||||
m_UpdateInformations.Clean(); | |||||
} | } | ||||
private: | private: | ||||
// Dynamic updates for the long-range pathfinder | // Dynamic updates for the long-range pathfinder | ||||
GridUpdateInformation m_UpdateInformations; | GridUpdateInformation m_UpdateInformations; | ||||
// These vectors might contain shapes that were deleted | // These vectors might contain shapes that were deleted | ||||
std::vector<u32> m_DirtyStaticShapes; | std::vector<u32> m_DirtyStaticShapes; | ||||
std::vector<u32> m_DirtyUnitShapes; | std::vector<u32> m_DirtyUnitShapes; | ||||
/** | /** | ||||
* Mark all previous Rasterize()d grids as dirty, and the debug display. | * Mark all previous Rasterize()d grids as dirty, and the debug display. | ||||
* Call this when the world bounds have changed. | * Call this when the world bounds have changed. | ||||
*/ | */ | ||||
void MakeDirtyAll() | void MakeDirtyAll() | ||||
{ | { | ||||
m_UpdateInformations.dirty = true; | m_UpdateInformations.dirty = true; | ||||
m_UpdateInformations.globallyDirty = true; | m_UpdateInformations.globallyDirty = true; | ||||
m_UpdateInformations.globalRecompute = true; | |||||
m_UpdateInformations.dirtinessGrid.reset(); | m_UpdateInformations.dirtinessGrid.reset(); | ||||
m_DebugOverlayDirty = true; | m_DebugOverlayDirty = true; | ||||
} | } | ||||
/** | /** | ||||
* Mark the debug display as dirty. | * Mark the debug display as dirty. | ||||
* Call this when nothing has changed except a unit's 'moving' flag. | * Call this when nothing has changed except a unit's 'moving' flag. | ||||
▲ Show 20 Lines • Show All 561 Lines • Show Last 20 Lines |
Wildfire Games · Phabricator