本文整理汇总了C++中CUtlVector::RemoveAll方法的典型用法代码示例。如果您正苦于以下问题:C++ CUtlVector::RemoveAll方法的具体用法?C++ CUtlVector::RemoveAll怎么用?C++ CUtlVector::RemoveAll使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类CUtlVector
的用法示例。
在下文中一共展示了CUtlVector::RemoveAll方法的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。
示例1: UncacheAllMaterials
void CHLClient::UncacheAllMaterials( )
{
for (int i = m_CachedMaterials.Count(); --i >= 0; )
{
m_CachedMaterials[i]->DecrementReferenceCount();
}
m_CachedMaterials.RemoveAll();
}
示例2: RemoveAll
void CUtlSymbolTable::RemoveAll()
{
m_Lookup.RemoveAll();
for ( int i=0; i < m_StringPools.Count(); i++ )
free( m_StringPools[i] );
m_StringPools.RemoveAll();
}
示例3: EmitWaterVolumesForBSP
// Creates a list of watermodel_t for later processing by EmitPhysCollision
void EmitWaterVolumesForBSP( dmodel_t *pModel, node_t *node )
{
CUtlVector<node_t *> leafListAnyWater;
// build the list of all leaves containing water
EnumLeaves_r( leafListAnyWater, node, MASK_WATER );
// make a sorted list to flood fill
CUtlVector<waterleaf_t> list;
int i;
for ( i = 0; i < leafListAnyWater.Count(); i++ )
{
waterleaf_t waterLeaf;
BuildWaterLeaf( leafListAnyWater[i], waterLeaf );
InsertSortWaterLeaf( list, waterLeaf );
}
leafbitarray_t visited;
CUtlVector<node_t *> waterAreaList;
for ( i = 0; i < list.Count(); i++ )
{
Flood_FindConnectedWaterVolumes_r( waterAreaList, list[i].pNode, list[i], visited );
// did we find a list of leaves connected to this one?
// remember the list is sorted, so this one may have been attached to a previous
// leaf. So it could have nothing hanging off of it.
if ( waterAreaList.Count() )
{
// yes, emit a watermodel
watermodel_t tmp;
tmp.modelIndex = nummodels;
tmp.contents = list[i].pNode->contents;
tmp.waterLeafData = list[i];
tmp.firstWaterLeafIndex = g_WaterLeafList.Count();
tmp.waterLeafCount = waterAreaList.Count();
float waterDepth = tmp.waterLeafData.surfaceDist - tmp.waterLeafData.minZ;
if ( tmp.waterLeafData.surfaceTexInfo < 0 )
{
// the map has probably leaked in this case, but output something anyway.
Assert(list[i].pNode->planenum == PLANENUM_LEAF);
tmp.waterLeafData.surfaceTexInfo = FirstWaterTexinfo( list[i].pNode->brushlist, tmp.contents );
}
tmp.depthTexinfo = FindOrCreateWaterTexInfo( &texinfo[ tmp.waterLeafData.surfaceTexInfo ], waterDepth );
tmp.fogVolumeIndex = FindOrCreateLeafWaterData( tmp.waterLeafData.surfaceDist, tmp.waterLeafData.minZ, tmp.waterLeafData.surfaceTexInfo );
for ( int j = 0; j < waterAreaList.Count(); j++ )
{
g_WaterLeafList.AddToTail( waterAreaList[j]->diskId );
}
waterAreaList.RemoveAll();
g_WaterModels.AddToTail( tmp );
}
}
WriteFogVolumeIDs( pModel );
}
示例4: GetFactoryNames
// static method
void CBuildFactoryHelper::GetFactoryNames( CUtlVector< char const * >& list )
{
list.RemoveAll();
CBuildFactoryHelper *p = m_sHelpers;
while ( p )
{
list.AddToTail( p->GetClassName() );
p = p->GetNext();
}
}
示例5: VGui_ClearVideoPanels
// Thiis is a hack due to the fact that the user can type quit with the video panel up, but it's parented to the GameUI dll root panel, which is already gone so
// we would crash in the destructor
void VGui_ClearVideoPanels()
{
for ( int i = g_vecVideoPanels.Count() - 1; i >= 0; --i )
{
if ( g_vecVideoPanels[ i ] )
{
delete g_vecVideoPanels[ i ];
}
}
g_vecVideoPanels.RemoveAll();
}
示例6: ShutdownModules
//-----------------------------------------------------------------------------
// Purpose: Shuts down all modules
//-----------------------------------------------------------------------------
void CToolFrameworkInternal::ShutdownModules()
{
// Shutdown dictionaries
int i;
for ( i = m_Modules.Count(); --i >= 0; )
{
Sys_UnloadModule( m_Modules[i] );
}
m_Modules.RemoveAll();
}
示例7: Templates_RemoveAll
//-----------------------------------------------------------------------------
// Purpose: Frees all the template data. Called on level shutdown.
//-----------------------------------------------------------------------------
void Templates_RemoveAll(void)
{
int nCount = g_Templates.Count();
for (int i = 0; i < nCount; i++)
{
TemplateEntityData_t *pTemplate = g_Templates.Element(i);
Templates_FreeTemplate( pTemplate );
}
g_Templates.RemoveAll();
}
示例8: RemoveAll
void RemoveAll( void )
{
for ( int i = 0; i < m_PanelList.Size(); i++ )
{
PanelItem_t *item = &m_PanelList[i];
delete item->m_EditLabel;
delete item->m_EditPanel;
delete item->m_EditButton;
}
m_PanelList.RemoveAll();
m_pControls->RemoveAll();
}
示例9: Shutdown
//-----------------------------------------------------------------------------
// Purpose:
//-----------------------------------------------------------------------------
void CSchemeManager::Shutdown( bool full )
{
// Full shutdown kills the null scheme
for( int i = full ? 0 : 1; i < m_Schemes.Count(); i++ )
{
m_Schemes[i]->Shutdown( full );
}
if ( full )
{
m_Schemes.RemoveAll();
}
}
示例10: Execute
void CTilegenAction_ChooseCandidate::Execute( CLayoutSystem *pLayoutSystem )
{
CUtlVector< CRoomCandidate > *pRoomCandidateList = pLayoutSystem->GetRoomCandidateList();
if ( pRoomCandidateList->Count() == 0 )
{
Log_Msg( LOG_TilegenLayoutSystem, "No more room candidates to choose from.\n" );
pLayoutSystem->GetFreeVariables()->SetOrCreateFreeVariable( "ChoseCandidate", ( void * )0 );
return;
}
int i;
float flChance = 0.0f;
for ( i = 0; i < pRoomCandidateList->Count(); ++ i )
{
flChance += pRoomCandidateList->Element( i ).m_flCandidateChance;
}
float flRandom = pLayoutSystem->GetRandomFloat( 0.0f, 1.0f ) * flChance;
for ( i = 0; i < pRoomCandidateList->Count(); ++ i )
{
flRandom -= pRoomCandidateList->Element( i ).m_flCandidateChance;
if ( flRandom <= 0.0f )
{
break;
}
}
if ( i == pRoomCandidateList->Count() )
{
i = pRoomCandidateList->Count() - 1;
}
const CRoomCandidate *pCandidate = &pRoomCandidateList->Element( i );
// This should always succeed since it's in the candidate list to begin with
bool bSuccess = pLayoutSystem->TryPlaceRoom( pCandidate );
Assert( bSuccess );
bSuccess;
Log_Msg( LOG_TilegenLayoutSystem, "Chose room candidate %s at position (%d, %d).\n", pCandidate->m_pRoomTemplate->GetFullName(), pCandidate->m_iXPos, pCandidate->m_iYPos );
// Empty the room candidate list for future actions
pRoomCandidateList->RemoveAll();
if ( m_bStopProcessingActionsOnSuccess )
{
pLayoutSystem->StopProcessingActions();
}
pLayoutSystem->GetFreeVariables()->SetOrCreateFreeVariable( "ChoseCandidate", ( void * )1 );
}
示例11: AddBrushes
void CPlaneList::AddBrushes( void )
{
CUtlVector<listplane_t> temp;
for ( int brushnumber = 0; brushnumber < numbrushes; brushnumber++ )
{
if ( IsBrushReferenced(brushnumber) )
{
CUtlVector<winding_t *> windings;
for ( int i = 0; i < dbrushes[brushnumber].numsides; i++ )
{
dbrushside_t *pside = dbrushsides + i + dbrushes[brushnumber].firstside;
if (pside->bevel)
continue;
dplane_t *pplane = dplanes + pside->planenum;
winding_t *w = BaseWindingForPlane( pplane->normal, pplane->dist - m_shrink );
for ( int j = 0; j < dbrushes[brushnumber].numsides && w; j++ )
{
if (i == j)
continue;
dbrushside_t *pClipSide = dbrushsides + j + dbrushes[brushnumber].firstside;
if (pClipSide->bevel)
continue;
dplane_t *pClipPlane = dplanes + pClipSide->planenum;
ChopWindingInPlace (&w, -pClipPlane->normal, -pClipPlane->dist+m_shrink, 0); //CLIP_EPSILON);
}
if ( w )
{
windings.AddToTail( w );
}
}
CUtlVector<Vector *> vertList;
for ( int p = 0; p < windings.Count(); p++ )
{
for ( int v = 0; v < windings[p]->numpoints; v++ )
{
vertList.AddToTail( windings[p]->p + v );
}
}
CPhysConvex *pConvex = physcollision->ConvexFromVerts( vertList.Base(), vertList.Count() );
if ( pConvex )
{
physcollision->SetConvexGameData( pConvex, brushnumber );
AddConvex( pConvex );
}
temp.RemoveAll();
}
}
}
示例12: GetTeamMembers
void CGECharacters::GetTeamMembers( int team, CUtlVector<const CGECharData*> &members ) const
{
if ( !m_pCharacters.Count() )
return;
members.RemoveAll();
// Add our sorted list next, filter for team
for ( int i=0; i < m_pCharacters.Count(); i++ )
{
if ( team == TEAM_UNASSIGNED || m_pCharacters[i]->iTeam == team )
members.AddToTail( m_pCharacters[i] );
}
}
示例13: FinishRecording
// Write the buffered crap out on shutdown.
void FinishRecording()
{
#ifndef CRASH_RECORDING
FILE* fp = OpenRecordingFile();
if (fp)
{
// store the command size
fwrite( g_pRecordingBuffer.Base(), 1, g_pRecordingBuffer.Size(), fp );
fflush( fp );
}
g_pRecordingBuffer.RemoveAll();
#endif
}
示例14: PerfThread_SendSpewText
void PerfThread_SendSpewText()
{
// Send the spew text to the database.
CCriticalSectionLock csLock( &g_SpewTextCS );
csLock.Lock();
if ( g_SpewText.Count() > 0 )
{
g_SpewText.AddToTail( 0 );
g_pDB->AddCommandToQueue( new CSQLDBCommand_TextMessage( g_SpewText.Base() ), NULL );
g_SpewText.RemoveAll();
}
csLock.Unlock();
}
示例15: Update
void Update()
{
if ( tickCount > gpGlobals->tickcount )
{
list.RemoveAll();
return;
}
for ( int i = list.Count()-1; i >= 0; --i )
{
if ( list[i].tickCount != gpGlobals->tickcount )
{
list.FastRemove(i);
}
}
}