コード例 #1
0
ファイル: DEntity.cpp プロジェクト: xonotic/netradient
bool* DEntity::BuildDuplicateList(){
	int max = GetIDMax();
	if ( max == 0 ) {
		return NULL;
	}

	bool* pbDupList = new bool[max];
	memset( pbDupList, 0, sizeof( bool ) * ( max ) );

	for ( std::list<DBrush *>::const_iterator pB1 = brushList.begin(); pB1 != brushList.end(); pB1++ )
	{
		std::list<DBrush *>::const_iterator pB2 = pB1;
		for ( pB2++; pB2 != brushList.end(); pB2++ )
		{
			if ( **pB1 == *pB2 ) {
				pbDupList[( *pB1 )->m_nBrushID] = true;
				pbDupList[( *pB2 )->m_nBrushID] = true;
			}
		}
	}

	return pbDupList;
}
コード例 #2
0
ファイル: DEntity.cpp プロジェクト: 0bsidian/GtkRadiant
bool* DEntity::BuildIntersectList(){
	int max = GetIDMax();
	if ( max == 0 ) {
		return NULL;
	}

	bool* pbIntList = new bool[max];
	memset( pbIntList, 0, sizeof( bool ) * ( max ) );

	for ( list<DBrush *>::const_iterator pB1 = brushList.begin(); pB1 != brushList.end(); pB1++ )
	{
		list<DBrush *>::const_iterator pB2 = pB1;
		for ( pB2++; pB2 != brushList.end(); pB2++ )
		{
			if ( ( *pB1 )->IntersectsWith( ( *pB2 ) ) ) {
				pbIntList[( *pB1 )->m_nBrushID] = TRUE;
				pbIntList[( *pB2 )->m_nBrushID] = TRUE;
			}
		}
	}

	return pbIntList;
}