void CBSPTreeData::Remove( BSPTreeDataHandle_t handle )
{
	if (!m_Handles.IsValidIndex(handle))
		return;

	RemoveFromTree( handle );
	m_Handles.Free( handle );
}
Exemple #2
0
void CDispInfo::RemoveShadowDecal( DispShadowHandle_t h )
{
    // Any fragments we got we don't need
    ClearShadowDecalFragments(h);

    // Reset the head of the list
    if (m_FirstShadowDecal == h)
        m_FirstShadowDecal = s_DispShadowDecals.Next(h);

    // Blow away the decal
    s_DispShadowDecals.Free( h );
}
void CBSPTreeData::RemoveFromTree( BSPTreeDataHandle_t handle )
{
	// Iterate over the list of all leaves the handle is in
	unsigned short i = m_Handles[handle].m_LeafList;
	while (i != m_HandleLeafList.InvalidIndex())
	{
		int leaf = m_HandleLeafList[i].m_Leaf;
		unsigned short leafElement = m_HandleLeafList[i].m_LeafElementIndex; 

		// Unhook the handle from the leaf handle list
		if (leafElement == m_Leaf[leaf].m_FirstElement)
			m_Leaf[leaf].m_FirstElement = m_LeafElements.Next(leafElement);
		m_LeafElements.Free(leafElement);

		unsigned short prevNode = i;
		i = m_HandleLeafList.Next(i);
		m_HandleLeafList.Free(prevNode);
	}

	m_Handles[handle].m_LeafList = m_HandleLeafList.InvalidIndex();
}
Exemple #4
0
//-----------------------------------------------------------------------------
// Clears shadow decal fragment lists
//-----------------------------------------------------------------------------
void CDispInfo::ClearShadowDecalFragments( DispShadowHandle_t h )
{
    // Iterate over all fragments associated with each shadow decal
    CDispShadowDecal& decal = s_DispShadowDecals[h];
    DispShadowFragmentHandle_t f = decal.m_FirstFragment;
    DispShadowFragmentHandle_t next;
    while( f != DISP_SHADOW_FRAGMENT_HANDLE_INVALID )
    {
        next = s_DispShadowFragments.Next(f);
        s_DispShadowFragments.Free(f);
        f = next;
    }

    // Blat out the list
    decal.m_FirstFragment = DISP_SHADOW_FRAGMENT_HANDLE_INVALID;

    // Mark is as not computed
    decal.m_Flags &= ~CDispDecalBase::FRAGMENTS_COMPUTED;

    // Update the number of triangles in the decal
    decal.m_nTris = 0;
    decal.m_nVerts = 0;
}