本文整理汇总了C++中xr_delete函数的典型用法代码示例。如果您正苦于以下问题:C++ xr_delete函数的具体用法?C++ xr_delete怎么用?C++ xr_delete使用的例子?那么, 这里精选的函数代码示例或许可以为您提供帮助。
在下文中一共展示了xr_delete函数的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。
示例1: inventory
//.........这里部分代码省略.........
{
if ((I - B) == (int)inventory().GetActiveSlot())
{
if((*I).m_pIItem)
{
if (OnServer())
{
if (GameID() == GAME_SINGLE)
(*I).m_pIItem->Drop();
else
{
NET_Packet P;
(*I).m_pIItem->object().u_EventGen(P, GE_OWNERSHIP_REJECT,
(*I).m_pIItem->object().H_Parent()->ID());
P.w_u16(u16((*I).m_pIItem->object().ID()));
(*I).m_pIItem->object().u_EventSend(P);
}
}
};
}
else
{
CCustomOutfit *pOutfit = smart_cast<CCustomOutfit *> ((*I).m_pIItem);
if (pOutfit) continue;
if((*I).m_pIItem) inventory().Ruck((*I).m_pIItem);
};
};
///!!! чистка пояса
TIItemContainer &l_blist = inventory().m_belt;
while (!l_blist.empty()) inventory().Ruck(l_blist.front());
if (OnServer() && GameID() != GAME_SINGLE)
{
// bool MedKitDropped = false;
//if we are on server and actor has PDA - destroy PDA
TIItemContainer &l_rlist = inventory().m_ruck;
for(TIItemContainer::iterator l_it = l_rlist.begin(); l_rlist.end() != l_it; ++l_it)
{
if (GameID() == GAME_ARTEFACTHUNT)
{
CArtefact* pArtefact = smart_cast<CArtefact*> (*l_it);
if (pArtefact)
{
(*l_it)->Drop();
continue;
};
};
if ((*l_it)->object().CLS_ID == CLSID_OBJECT_PLAYERS_BAG)
{
(*l_it)->Drop();
continue;
};
/*
if ((*l_it)->object().CLS_ID == CLSID_IITEM_MEDKIT && !MedKitDropped)
{
MedKitDropped = true;
(*l_it)->Drop();
continue;
};
if ((*l_it)->object().CLS_ID == CLSID_DEVICE_PDA)
{
(*l_it)->Drop();
continue;
};
CCustomOutfit *pOutfit = smart_cast<CCustomOutfit *> (*l_it);
if (pOutfit) continue;
//пока у нас нельзя обыскивать трупы, удаляем все объекты из инвентаря
(*l_it)->object().DestroyObject();
*/
};
};
};
cam_Set (eacFreeLook);
mstate_wishful &= ~mcAnyMove;
mstate_real &= ~mcAnyMove;
if(!g_pGamePersistent->bDedicatedServer)
{
::Sound->play_at_pos (sndDie[Random.randI(SND_DIE_COUNT)],this,Position());
m_HeavyBreathSnd.stop ();
m_BloodSnd.stop ();
}
if(IsGameTypeSingle())
{
start_tutorial ("game_over");
}
//. HUD().GetUI()->UIGame()->AddCustomStatic("game_over", true);
xr_delete (m_sndShockEffector);
}
示例2: xr_delete
void global_slots_data::Free ()
{
if ( dtFS )
xr_delete( dtFS );
recalculation_data.close();
}
示例3: xr_delete
CUICustomEdit::~CUICustomEdit()
{
xr_delete( m_editor_control );
}
示例4: xr_delete
void RELATION_REGISTRY::clear_relation_registry()
{
xr_delete(m_relation_registry);
xr_delete(m_fight_registry);
xr_delete(m_spot_names);
}
示例5: VERIFY
//----------------------------------------------------
void CEditableObject::RemoveMesh(CEditableMesh* mesh){
EditMeshIt m_it = std::find(m_Meshes.begin(),m_Meshes.end(),mesh);
VERIFY(m_it!=m_Meshes.end());
m_Meshes.erase(m_it);
xr_delete(mesh);
}
示例6: R_ASSERT2
void game_sv_GameState::Create (shared_str &options)
{
string_path fn_game;
m_item_respawner.clear_respawns();
if (FS.exist(fn_game, "$level$", "level.game"))
{
IReader *F = FS.r_open (fn_game);
IReader *O = 0;
// Load RPoints
if (0!=(O = F->open_chunk (RPOINT_CHUNK)))
{
for (int id=0; O->find_chunk(id); ++id)
{
RPoint R;
u8 team;
u8 type;
u16 GameType;
shared_str rp_profile;
O->r_fvector3 (R.P);
O->r_fvector3 (R.A);
team = O->r_u8 ();
type = O->r_u8 ();
GameType = O->r_u16 ();
if(type==rptItemSpawn)
O->r_stringZ (rp_profile);
if (GameType != EGameIDs(u16(-1)))
{
if ((Type() == eGameIDCaptureTheArtefact) && (GameType & eGameIDCaptureTheArtefact))
{
team = team - 1;
R_ASSERT2( ((team >= 0) && (team < 4)) ||
(type != rptActorSpawn),
"Problem with CTA Team indexes. Propably you have added rpoint of team 0 for cta game type.");
}
if ((!(GameType & eGameIDDeathmatch) && (Type() == eGameIDDeathmatch)) ||
(!(GameType & eGameIDTeamDeathmatch) && (Type() == eGameIDTeamDeathmatch)) ||
(!(GameType & eGameIDArtefactHunt) && (Type() == eGameIDArtefactHunt)) ||
(!(GameType & eGameIDCaptureTheArtefact) && (Type() == eGameIDCaptureTheArtefact))
)
{
continue;
};
};
switch (type)
{
case rptActorSpawn:
{
rpoints[team].push_back (R);
for (int i=0; i<int(rpoints[team].size())-1; i++)
{
RPoint rp = rpoints[team][i];
float dist = R.P.distance_to_xz(rp.P)/2;
if (dist<rpoints_MinDist[team])
rpoints_MinDist[team] = dist;
dist = R.P.distance_to(rp.P)/2;
if (dist<rpoints_Dist[team])
rpoints_Dist[team] = dist;
};
}break;
case rptItemSpawn:
{
m_item_respawner.add_new_rpoint(rp_profile, R);
}
};
};
O->close();
}
FS.r_close (F);
}
if (!g_dedicated_server)
{
// loading scripts
ai().script_engine().remove_script_process(ScriptEngine::eScriptProcessorGame);
string_path S;
FS.update_path (S,"$game_config$","script.ltx");
CInifile *l_tpIniFile = xr_new<CInifile>(S);
R_ASSERT (l_tpIniFile);
if( l_tpIniFile->section_exist( type_name() ) )
if (l_tpIniFile->r_string(type_name(),"script"))
ai().script_engine().add_script_process(ScriptEngine::eScriptProcessorGame,xr_new<CScriptProcess>("game",l_tpIniFile->r_string(type_name(),"script")));
else
ai().script_engine().add_script_process(ScriptEngine::eScriptProcessorGame,xr_new<CScriptProcess>("game",""));
xr_delete (l_tpIniFile);
}
//---------------------------------------------------------------------
ConsoleCommands_Create();
//---------------------------------------------------------------------
// CCC_LoadCFG_custom* pTmp = xr_new<CCC_LoadCFG_custom>("sv_");
// pTmp->Execute (Console->ConfigFile);
// xr_delete (pTmp);
//---------------------------------------------------------------------
LPCSTR svcfg_ltx_name = "-svcfg ";
//.........这里部分代码省略.........
示例7: vecFace
void CBuild::BuildCForm ()
{
// Collecting data
Phase ("CFORM: creating...");
vecFace* cfFaces = new vecFace();
vecVertex* cfVertices = new vecVertex();
{
xr_vector<bool> cfVertexMarks;
cfVertexMarks.assign (lc_global_data()->g_vertices().size(),false);
Status("Sorting...");
std::sort(lc_global_data()->g_vertices().begin(),lc_global_data()->g_vertices().end());
Status("Collecting faces...");
cfFaces->reserve (lc_global_data()->g_faces().size());
for (vecFaceIt I=lc_global_data()->g_faces().begin(); I!=lc_global_data()->g_faces().end(); ++I)
{
Face* F = *I;
if (F->Shader().flags.bCollision)
{
cfFaces->push_back(F);
int index = GetVertexIndex(F->v[0]);
cfVertexMarks[index] = true;
index = GetVertexIndex(F->v[1]);
cfVertexMarks[index] = true;
index = GetVertexIndex(F->v[2]);
cfVertexMarks[index] = true;
}
}
Status("Collecting vertices...");
cfVertices->reserve (lc_global_data()->g_vertices().size());
std::sort(cfFaces->begin(),cfFaces->end());
for (u32 V=0; V<lc_global_data()->g_vertices().size(); V++)
if (cfVertexMarks[V]) cfVertices->push_back(lc_global_data()->g_vertices()[V]);
}
float p_total = 0;
float p_cost = 1.f/(cfVertices->size());
Fbox BB; BB.invalidate();
for (vecVertexIt it = cfVertices->begin(); it!=cfVertices->end(); it++)
BB.modify((*it)->P );
// CForm
Phase ("CFORM: collision model...");
Status ("Items to process: %d", cfFaces->size());
p_total = 0;
p_cost = 1.f/(cfFaces->size());
// Collect faces
CDB::CollectorPacked CL (BB,cfVertices->size(),cfFaces->size());
for (vecFaceIt F = cfFaces->begin(); F!=cfFaces->end(); F++)
{
Face* T = *F;
TestEdge (T->v[0],T->v[1],T);
TestEdge (T->v[1],T->v[2],T);
TestEdge (T->v[2],T->v[0],T);
CL.add_face (
T->v[0]->P, T->v[1]->P, T->v[2]->P,
T->dwMaterialGame, materials()[T->dwMaterial].sector, T->sm_group
);
Progress(p_total+=p_cost); // progress
}
if (bCriticalErrCnt) {
err_save ();
clMsg ("MultipleEdges: %d faces",bCriticalErrCnt);
}
xr_delete (cfFaces);
xr_delete (cfVertices);
// Models
Status ("Models...");
for (u32 ref=0; ref<mu_refs().size(); ref++)
mu_refs()[ref]->export_cform_game(CL);
// Simplification
if (g_params().m_quality!=ebqDraft)
SimplifyCFORM (CL);
// bb?
BB.invalidate ();
for (size_t it = 0; it<CL.getVS(); it++)
BB.modify( CL.getV()[it] );
// Saving
string_path fn;
IWriter* MFS = FS.w_open (strconcat(sizeof(fn),fn,pBuild->path,"level.cform"));
Status ("Saving...");
// Header
hdrCFORM hdr;
hdr.version = CFORM_CURRENT_VERSION;
hdr.vertcount = (u32)CL.getVS();
hdr.facecount = (u32)CL.getTS();
hdr.aabb = BB;
//.........这里部分代码省略.........
示例8: xr_delete
CUIGameAHunt::~CUIGameAHunt()
{
xr_delete(m_pReinforcementInidcator);
delete_data(m_pBuySpawnMsgBox);
}
示例9: u32
void CBuild::Flex2OGF()
{
float p_total = 0;
float p_cost = 1/float(g_XSplit.size());
validate_splits ();
g_tree.clear ();
g_tree.reserve (4096);
for (splitIt it=g_XSplit.begin(); it!=g_XSplit.end(); it++)
{
R_ASSERT ( ! (*it)->empty() );
u32 MODEL_ID = u32(it-g_XSplit.begin());
OGF* pOGF = new OGF();
Face* F = *((*it)->begin()); // first face
b_material* M = &(materials()[F->dwMaterial]); // and it's material
R_ASSERT (F && M);
try {
// Common data
pOGF->Sector = M->sector;
pOGF->material = F->dwMaterial;
// Collect textures
OGF_Texture T;
//pOGF->shader = M->shader;
//pOGF->shader_xrlc = &F->Shader();
TRY(T.name = textures()[M->surfidx].name);
TRY(T.pSurface = &(textures()[M->surfidx]));
TRY(pOGF->textures.push_back(T));
try {
if (F->hasImplicitLighting())
{
// specific lmap
string_path tn;
strconcat (sizeof(tn),tn,*T.name,"_lm.dds");
T.name = tn;
T.pSurface = T.pSurface; // Leave surface intact
R_ASSERT (pOGF);
pOGF->textures.push_back(T);
} else {
// If lightmaps persist
CLightmap* LM = F->lmap_layer;
if (LM) {
string_path fn;
sprintf_s (fn,"%s_1",LM->lm_texture.name);
T.name = fn;
T.pSurface = &(LM->lm_texture);
R_ASSERT (T.pSurface);
R_ASSERT (pOGF);
pOGF->textures.push_back(T); //.
sprintf (fn,"%s_2",LM->lm_texture.name);
T.name = fn;
pOGF->textures.push_back(T);
}
}
} catch (...) { clMsg("* ERROR: Flex2OGF, model# %d, *textures*",MODEL_ID); }
// Collect faces & vertices
F->CacheOpacity ();
bool _tc_ = !(F->flags.bOpaque);
try {
BuildOGFGeom( *pOGF, *(*it), _tc_ );
} catch (...) { clMsg("* ERROR: Flex2OGF, model# %d, *faces*",MODEL_ID); }
} catch (...)
{
clMsg("* ERROR: Flex2OGF, 1st part, model# %d",MODEL_ID);
}
try {
clMsg ("%3d: opt : v(%d)-f(%d)", MODEL_ID,pOGF->data.vertices.size(),pOGF->data.faces.size());
pOGF->Optimize ();
clMsg ("%3d: cb : v(%d)-f(%d)", MODEL_ID,pOGF->data.vertices.size(),pOGF->data.faces.size());
pOGF->CalcBounds ();
clMsg ("%3d: prog: v(%d)-f(%d)", MODEL_ID,pOGF->data.vertices.size(),pOGF->data.faces.size());
if (!b_noise) pOGF->MakeProgressive (c_PM_MetricLimit_static);
clMsg ("%3d: strp: v(%d)-f(%d)", MODEL_ID,pOGF->data.vertices.size(),pOGF->data.faces.size());
pOGF->Stripify ();
} catch (...) {
clMsg("* ERROR: Flex2OGF, 2nd part, model# %d",MODEL_ID);
}
g_tree.push_back (pOGF);
xr_delete (*it);
Progress (p_total+=p_cost);
}
g_XSplit.clear ();
}
示例10: dDestroyTriList
void dDestroyTriList(dGeomID g){
xr_delete(((dxTriList*)dGeomGetClassData(g))->Collider);
}
示例11: phcapture_destroy
void phcapture_destroy(IPHCapture* &c)
{
CPHCapture* capture = smart_cast<CPHCapture*>(c);
xr_delete(capture);
c = 0;
}
示例12: Startup
void Startup(LPSTR lpCmdLine)
{
char cmd[512],name[256];
BOOL bModifyOptions = FALSE;
strcpy(cmd,lpCmdLine);
strlwr(cmd);
if (strstr(cmd,"-?") || strstr(cmd,"-h")) { Help(); return; }
if (strstr(cmd,"-f")==0) { Help(); return; }
if (strstr(cmd,"-o")) bModifyOptions = TRUE;
if (strstr(cmd,"-gi")) b_radiosity = TRUE;
if (strstr(cmd,"-noise")) b_noise = TRUE;
if (strstr(cmd,"-nosun")) b_nosun = TRUE;
// Give a LOG-thread a chance to startup
//_set_sbh_threshold(1920);
InitCommonControls ();
thread_spawn (logThread, "log-update", 1024*1024,0);
Sleep (150);
// Faster FPU
SetPriorityClass (GetCurrentProcess(),NORMAL_PRIORITY_CLASS);
/*
u32 dwMin = 1800*(1024*1024);
u32 dwMax = 1900*(1024*1024);
if (0==SetProcessWorkingSetSize(GetCurrentProcess(),dwMin,dwMax))
{
clMsg("*** Failed to expand working set");
};
*/
// Load project
name[0]=0; sscanf(strstr(cmd,"-f")+2,"%s",name);
string256 prjName;
FS.update_path (prjName,"$game_levels$",strconcat(prjName,name,"\\build.prj"));
string256 phaseName;
Phase (strconcat(phaseName,"Reading project [",name,"]..."));
string256 inf;
extern HWND logWindow;
IReader* F = FS.r_open(prjName);
if (NULL==F){
sprintf (inf,"Build failed!\nCan't find level: '%s'",name);
clMsg (inf);
MessageBox (logWindow,inf,"Error!",MB_OK|MB_ICONERROR);
return;
}
// Version
u32 version;
F->r_chunk (EB_Version,&version);
clMsg ("version: %d",version);
R_ASSERT(XRCL_CURRENT_VERSION==version);
// Header
b_params Params;
F->r_chunk (EB_Parameters,&Params);
// Show options if needed
if (bModifyOptions)
{
Phase ("Project options...");
HMODULE L = LoadLibrary ("xrLC_Options.dll");
void* P = GetProcAddress (L,"_frmScenePropertiesRun");
R_ASSERT (P);
xrOptions* O = (xrOptions*)P;
int R = O(&Params,version,false);
FreeLibrary (L);
if (R==2) {
ExitProcess(0);
}
}
// Conversion
Phase ("Converting data structures...");
pBuild = xr_new<CBuild>();
pBuild->Load (Params,*F);
xr_delete (F);
// Call for builder
string256 lfn;
CTimer dwStartupTime; dwStartupTime.Start();
FS.update_path (lfn,_game_levels_,name);
pBuild->Run (lfn);
xr_delete (pBuild);
// Show statistic
extern std::string make_time(u32 sec);
u32 dwEndTime = dwStartupTime.GetElapsed_ms();
sprintf (inf,"Time elapsed: %s",make_time(dwEndTime/1000).c_str());
clMsg ("Build succesful!\n%s",inf);
MessageBox (logWindow,inf,"Congratulation!",MB_OK|MB_ICONINFORMATION);
// Close log
bClose = TRUE;
Sleep (500);
}
示例13:
//--------------------------------------------------------------------
CHUDManager::~CHUDManager()
{
xr_delete (pUI);
xr_delete (m_pHUDTarget);
b_online = false;
}
示例14: currentFOV
void CActor::UpdateCL ()
{
if(m_feel_touch_characters>0)
{
for(xr_vector<CObject*>::iterator it = feel_touch.begin(); it != feel_touch.end(); it++)
{
CPhysicsShellHolder *sh = smart_cast<CPhysicsShellHolder*>(*it);
if(sh&&sh->character_physics_support())
{
sh->character_physics_support()->movement()->UpdateObjectBox(character_physics_support()->movement()->PHCharacter());
}
}
}
if(m_holder)
m_holder->UpdateEx( currentFOV() );
m_snd_noise -= 0.3f*Device.fTimeDelta;
VERIFY2 (_valid(renderable.xform),*cName());
inherited::UpdateCL();
VERIFY2 (_valid(renderable.xform),*cName());
m_pPhysics_support->in_UpdateCL ();
VERIFY2 (_valid(renderable.xform),*cName());
if (g_Alive())
PickupModeUpdate ();
PickupModeUpdate_COD();
m_bZoomAimingMode = false;
CWeapon* pWeapon = smart_cast<CWeapon*>(inventory().ActiveItem());
Device.Statistic->TEST1.Begin ();
cam_Update(float(Device.dwTimeDelta)/1000.0f, currentFOV());
Device.Statistic->TEST1.End ();
if(Level().CurrentEntity() && this->ID()==Level().CurrentEntity()->ID() )
{
psHUD_Flags.set( HUD_CROSSHAIR_RT2, true );
psHUD_Flags.set( HUD_DRAW_RT, true );
}
if(pWeapon )
{
if(pWeapon->IsZoomed())
{
float full_fire_disp = pWeapon->GetFireDispersion(true);
CEffectorZoomInertion* S = smart_cast<CEffectorZoomInertion*> (Cameras().GetCamEffector(eCEZoom));
if(S) S->SetParams(full_fire_disp);
m_bZoomAimingMode = true;
}
if(Level().CurrentEntity() && this->ID()==Level().CurrentEntity()->ID() )
{
float fire_disp_full = pWeapon->GetFireDispersion(true);
HUD().SetCrosshairDisp(fire_disp_full, 0.02f);
HUD().ShowCrosshair(pWeapon->use_crosshair());
psHUD_Flags.set( HUD_CROSSHAIR_RT2, pWeapon->show_crosshair() );
psHUD_Flags.set( HUD_DRAW_RT, pWeapon->show_indicators() );
}
}
else
{
if(Level().CurrentEntity() && this->ID()==Level().CurrentEntity()->ID() )
{
HUD().SetCrosshairDisp(0.f);
HUD().ShowCrosshair(false);
}
}
UpdateDefferedMessages();
if (g_Alive())
CStepManager::update();
spatial.type |=STYPE_REACTTOSOUND;
if(m_sndShockEffector)
{
if (this == Level().CurrentViewEntity())
{
m_sndShockEffector->Update();
if(!m_sndShockEffector->InWork())
xr_delete(m_sndShockEffector);
}
else
xr_delete(m_sndShockEffector);
}
}
示例15: xr_delete
CUIEditBoxEx::~CUIEditBoxEx()
{
xr_delete(m_pFrameWindow);
}