Ejemplo n.º 1
0
//-----------------------------------------------------------------------------
// Level init, shutdown
//-----------------------------------------------------------------------------
void CClientLeafSystem::LevelInitPreEntity()
{
	MEM_ALLOC_CREDIT();

	m_Renderables.EnsureCapacity( 1024 );
	m_RenderablesInLeaf.EnsureCapacity( 1024 );
	m_ShadowsInLeaf.EnsureCapacity( 256 );
	m_ShadowsOnRenderable.EnsureCapacity( 256 );
	m_DirtyRenderables.EnsureCapacity( 256 );

	// Add all the leaves we'll need
	int leafCount = engine->LevelLeafCount();
	m_Leaf.EnsureCapacity( leafCount );

	ClientLeaf_t newLeaf;
	newLeaf.m_FirstElement = m_RenderablesInLeaf.InvalidIndex();
	newLeaf.m_FirstShadow = m_ShadowsInLeaf.InvalidIndex();
	newLeaf.m_FirstDetailProp = 0;
	newLeaf.m_DetailPropCount = 0;
	newLeaf.m_DetailPropRenderFrame = -1;
	while ( --leafCount >= 0 )
	{
		m_Leaf.AddToTail( newLeaf );
	}
}
Ejemplo n.º 2
0
void CBSPTreeData::Init( ISpatialQuery* pBSPTree )
{
	Assert( pBSPTree );
	m_pBSPTree = pBSPTree;

	m_Handles.EnsureCapacity( 1024 );
	m_LeafElements.EnsureCapacity( 1024 );
	m_HandleLeafList.EnsureCapacity( 1024 );

	// Add all the leaves we'll need
	int leafCount = m_pBSPTree->LeafCount();
	m_Leaf.EnsureCapacity( leafCount );

	Leaf_t newLeaf;
	newLeaf.m_FirstElement = m_LeafElements.InvalidIndex();
	while ( --leafCount >= 0 )
	{
		m_Leaf.AddToTail( newLeaf );
	}
}