本文整理汇总了C++中xr_vector::clear_not_free方法的典型用法代码示例。如果您正苦于以下问题:C++ xr_vector::clear_not_free方法的具体用法?C++ xr_vector::clear_not_free怎么用?C++ xr_vector::clear_not_free使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类xr_vector
的用法示例。
在下文中一共展示了xr_vector::clear_not_free方法的4个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。
示例1: highlight_ammo_for_weapon
void CUIActorMenu::highlight_ammo_for_weapon( PIItem weapon_item, CUIDragDropListEx* ddlist )
{
VERIFY( weapon_item );
VERIFY( ddlist );
static xr_vector<shared_str> ammo_types;
ammo_types.clear_not_free();
CWeapon* weapon = smart_cast<CWeapon*>(weapon_item);
if ( !weapon )
{
return;
}
ammo_types.assign( weapon->m_ammoTypes.begin(), weapon->m_ammoTypes.end() );
CWeaponMagazinedWGrenade* wg = smart_cast<CWeaponMagazinedWGrenade*>(weapon_item);
if ( wg )
{
if ( wg->IsGrenadeLauncherAttached() && wg->m_ammoTypes2.size() )
{
ammo_types.insert( ammo_types.end(), wg->m_ammoTypes2.begin(), wg->m_ammoTypes2.end() );
}
}
if ( ammo_types.size() == 0 )
{
return;
}
xr_vector<shared_str>::iterator ite = ammo_types.end();
u32 const cnt = ddlist->ItemsCount();
for ( u32 i = 0; i < cnt; ++i )
{
CUICellItem* ci = ddlist->GetItemIdx(i);
PIItem item = (PIItem)ci->m_pData;
if ( !item )
{
continue;
}
CWeaponAmmo* ammo = smart_cast<CWeaponAmmo*>(item);
if ( !ammo )
{
highlight_addons_for_weapon( weapon_item, ci );
continue; // for i
}
shared_str const& ammo_name = item->object().cNameSect();
xr_vector<shared_str>::iterator itb = ammo_types.begin();
for ( ; itb != ite; ++itb )
{
if ( ammo_name._get() == (*itb)._get() )
{
ci->m_select_armament = true;
break; // itb
}
}
}//for i
}
示例2:
//----------------------------------------------------------------------
int CObjectSpace::GetNearest ( xr_vector<ISpatial*>& q_spatial, xr_vector<CObject*>& q_nearest, const Fvector &point, float range, CObject* ignore_object )
{
q_spatial.clear_not_free ( );
// Query objects
q_nearest.clear_not_free ( );
Fsphere Q; Q.set (point,range);
Fvector B; B.set (range,range,range);
g_SpatialSpace->q_box(q_spatial,0,STYPE_COLLIDEABLE,point,B);
// Iterate
xr_vector<ISpatial*>::iterator it = q_spatial.begin ();
xr_vector<ISpatial*>::iterator end = q_spatial.end ();
for (; it!=end; it++) {
CObject* O = (*it)->dcast_CObject ();
if (0==O) continue;
if (O==ignore_object) continue;
Fsphere mS = { O->spatial.sphere.P, O->spatial.sphere.R };
if (Q.intersect(mS)) q_nearest.push_back(O);
}
return q_nearest.size();
}
示例3: ActivePDAContacts
void CPda::ActivePDAContacts(xr_vector<CPda*>& res)
{
res.clear_not_free ();
xr_vector<CObject*>::iterator it = m_active_contacts.begin();
xr_vector<CObject*>::iterator it_e = m_active_contacts.end();
for(;it!=it_e;++it)
{
CPda* p = GetPdaFromOwner(*it);
if(p)
res.push_back(p);
}
}
示例4: SendConnectionData
void xrServer::SendConnectionData(IClient* _CL)
{
g_perform_spawn_ids.clear_not_free();
xrClientData* CL = (xrClientData*)_CL;
NET_Packet P;
u32 mode = net_flags(TRUE,TRUE);
// Replicate current entities on to this client
xrS_entities::iterator I=entities.begin(),E=entities.end();
for (; I!=E; ++I) I->second->net_Processed = FALSE;
for (I=entities.begin(); I!=E; ++I) Perform_connect_spawn (I->second,CL,P);
// Send "finished" signal
P.w_begin (M_SV_CONFIG_FINISHED);
SendTo (CL->ID,P,mode);
};