Ejemplo n.º 1
0
//-----------------------------------------------------------------------------
//-----------------------------------------------------------------------------
void CDispChain::AddTo( IDispInfo *pDispInfo )
{
#if 0
	//
	// only add a surface once
	//
	// NOTE: search is linear for now, look into this during opt. phase
	//
	for( IDispInfo *pCmpDispInfo = m_pHead; pCmpDispInfo; pCmpDispInfo = pCmpDispInfo->GetNextInChain() )
	{
		if( pCmpDispInfo == pDispInfo )
			return;
	}
#endif

	//
	// add unique surface to the chain
	//
	if( m_bForRayCasts )
	{
		pDispInfo->SetNextInRayCastChain( m_pHead );
	}
	else
	{
		pDispInfo->SetNextInRenderChain( m_pHead );
	}
	m_pHead = pDispInfo;
}