这篇教程C++ xr_delete函数代码示例写得很实用,希望能帮到您。
本文整理汇总了C++中xr_delete函数的典型用法代码示例。如果您正苦于以下问题:C++ xr_delete函数的具体用法?C++ xr_delete怎么用?C++ xr_delete使用的例子?那么恭喜您, 这里精选的函数代码示例或许可以为您提供帮助。 在下文中一共展示了xr_delete函数的28个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于我们的系统推荐出更棒的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);}
开发者ID:OLR-xray,项目名称:XRay-NEW,代码行数:101,
示例2: xr_deletevoid global_slots_data::Free (){ if ( dtFS ) xr_delete( dtFS ); recalculation_data.close();}
开发者ID:AntonioModer,项目名称:xray-16,代码行数:6,
示例3: xr_deleteCUICustomEdit::~CUICustomEdit(){ xr_delete( m_editor_control );}
开发者ID:2asoft,项目名称:xray,代码行数:4,
示例4: xr_deletevoid RELATION_REGISTRY::clear_relation_registry(){ xr_delete(m_relation_registry); xr_delete(m_fight_registry); xr_delete(m_spot_names);}
开发者ID:OLR-xray,项目名称:OLR-3.0,代码行数:6,
示例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);}
开发者ID:OLR-xray,项目名称:OLR-3.0,代码行数:7,
示例6: R_ASSERT2void 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 ";//.........这里部分代码省略.........
开发者ID:AntonioModer,项目名称:xray-16,代码行数:101,
示例7: vecFacevoid 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;//.........这里部分代码省略.........
开发者ID:2asoft,项目名称:xray,代码行数:101,
示例8: xr_deleteCUIGameAHunt::~CUIGameAHunt(){ xr_delete(m_pReinforcementInidcator); delete_data(m_pBuySpawnMsgBox);}
开发者ID:OLR-xray,项目名称:OLR-3.0,代码行数:5,
示例9: u32void 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 ();}
开发者ID:2asoft,项目名称:xray,代码行数:93,
示例10: dDestroyTriListvoid dDestroyTriList(dGeomID g){ xr_delete(((dxTriList*)dGeomGetClassData(g))->Collider);}
开发者ID:AntonioModer,项目名称:xray-16,代码行数:4,
示例11: phcapture_destroyvoid phcapture_destroy(IPHCapture* &c){ CPHCapture* capture = smart_cast<CPHCapture*>(c); xr_delete(capture); c = 0;}
开发者ID:Zen13L,项目名称:xray-16,代码行数:6,
示例12: Startupvoid 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);}
开发者ID:OLR-xray,项目名称:XRay-NEW,代码行数:98,
示例13: //--------------------------------------------------------------------CHUDManager::~CHUDManager(){ xr_delete (pUI); xr_delete (m_pHUDTarget); b_online = false;}
开发者ID:OLR-xray,项目名称:XRay-NEW,代码行数:7,
示例14: currentFOVvoid 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); }}
开发者ID:OLR-xray,项目名称:XRay-NEW,代码行数:94,
示例15: xr_deleteCUIEditBoxEx::~CUIEditBoxEx(){ xr_delete(m_pFrameWindow);}
开发者ID:2asoft,项目名称:xray,代码行数:4,
示例16: CObjectHandler::~CObjectHandler (){ xr_delete (m_planner);}
开发者ID:OLR-xray,项目名称:XRay-NEW,代码行数:4,
示例17: Progressvoid CBuild::xrPhase_ResolveMaterials(){ // Count number of materials Status ("Calculating materials/subdivs..."); xr_vector<_counter> counts; { counts.reserve (256); for (vecFaceIt F_it=g_faces.begin(); F_it!=g_faces.end(); F_it++) { Face* F = *F_it; BOOL bCreate = TRUE; for (u32 I=0; I<counts.size(); I++) { if (F->dwMaterial == counts[I].dwMaterial) { counts[I].dwCount += 1; bCreate = FALSE; break; } } if (bCreate) { _counter C; C.dwMaterial = F->dwMaterial; C.dwCount = 1; counts.push_back(C); } Progress(float(F_it-g_faces.begin())/float(g_faces.size())); } } Status ("Perfroming subdivisions..."); { g_XSplit.reserve(64*1024); g_XSplit.resize (counts.size()); for (u32 I=0; I<counts.size(); I++) { g_XSplit[I] = xr_new<vecFace> (); g_XSplit[I]->reserve (counts[I].dwCount); } for (vecFaceIt F_it=g_faces.begin(); F_it!=g_faces.end(); F_it++) { Face* F = *F_it; if (!F->Shader().flags.bRendering) continue; for (u32 I=0; I<counts.size(); I++) { if (F->dwMaterial == counts[I].dwMaterial) { g_XSplit[I]->push_back (F); } } Progress(float(F_it-g_faces.begin())/float(g_faces.size())); } } Status ("Removing empty subdivs..."); { for (int SP = 0; SP<int(g_XSplit.size()); SP++) if (g_XSplit[SP]->empty()) xr_delete(g_XSplit[SP]); g_XSplit.erase(std::remove(g_XSplit.begin(),g_XSplit.end(),(vecFace*) NULL),g_XSplit.end()); } Status ("Detaching subdivs..."); { for (u32 it=0; it<g_XSplit.size(); it++) { Detach(g_XSplit[it]); } } clMsg ("%d subdivisions.",g_XSplit.size());}
开发者ID:OLR-xray,项目名称:OLR-3.0,代码行数:72,
示例18: destroy_lua_wpn_paramsvoid destroy_lua_wpn_params(){ if(g_lua_wpn_params) xr_delete(g_lua_wpn_params);}
开发者ID:2asoft,项目名称:xray,代码行数:5,
示例19: lc_global_datavoid CBuild::xrPhase_UVmap(){ // Main loop Status ("Processing..."); lc_global_data()->g_deflectors().reserve (64*1024); float p_cost = 1.f / float(g_XSplit.size()); float p_total = 0.f; vecFace faces_affected; for (int SP = 0; SP<int(g_XSplit.size()); SP++) { Progress (p_total+=p_cost); // ManOwaR, unsure: // Call to IsolateVertices() looks useless here // Calculation speed up, so commented // IsolateVertices (FALSE); // Detect vertex-lighting and avoid this subdivision R_ASSERT (!g_XSplit[SP]->empty()); Face* Fvl = g_XSplit[SP]->front(); if (Fvl->Shader().flags.bLIGHT_Vertex) continue; // do-not touch (skip) if (!Fvl->Shader().flags.bRendering) continue; // do-not touch (skip) if (Fvl->hasImplicitLighting()) continue; // do-not touch (skip) // find first poly that doesn't has mapping and start recursion while (TRUE) { // Select maximal sized poly Face * msF = NULL; float msA = 0; for (vecFaceIt it = g_XSplit[SP]->begin(); it!=g_XSplit[SP]->end(); it++) { if ( (*it)->pDeflector == NULL ) { float a = (*it)->CalcArea(); if (a>msA) { msF = (*it); msA = a; } } } if (msF) { CDeflector *D = xr_new<CDeflector>(); lc_global_data()->g_deflectors().push_back (D); // Start recursion from this face start_unwarp_recursion(); D->OA_SetNormal (msF->N); msF->OA_Unwarp (D); //Deflector = D; // break the cycle to startup again D->OA_Export (); // Detach affected faces faces_affected.clear (); for (int i=0; i<int(g_XSplit[SP]->size()); i++) { Face *F = (*g_XSplit[SP])[i]; if ( F->pDeflector == D ) { faces_affected.push_back(F); g_XSplit[SP]->erase (g_XSplit[SP]->begin()+i); i--; } } // detaching itself Detach (&faces_affected); g_XSplit.push_back (xr_new<vecFace> (faces_affected)); } else { if (g_XSplit[SP]->empty()) { xr_delete (g_XSplit[SP]); g_XSplit.erase (g_XSplit.begin()+SP); SP--; } // Cancel infine loop (while) break; } } } clMsg("%d subdivisions...",g_XSplit.size()); err_save ();}
开发者ID:AntonioModer,项目名称:xray-16,代码行数:82,
示例20: _SequenceToListvoid xrCompressor::ProcessLTX(CInifile& ltx){ config_ltx =<x; if (ltx.line_exist("options","exclude_exts")) _SequenceToList(exclude_exts, ltx.r_string("options","exclude_exts")); files_list = xr_new< xr_vector<char*> >(); folders_list = xr_new< xr_vector<char*> >(); if(ltx.section_exist("include_folders")) { CInifile::Sect& if_sect = ltx.r_section("include_folders"); for (CInifile::SectCIt if_it=if_sect.Data.begin(); if_it!=if_sect.Data.end(); ++if_it) { BOOL ifRecurse = CInifile::IsBOOL(if_it->second.c_str()); u32 folder_mask = FS_ListFolders | (ifRecurse?0:FS_RootOnly); string_path path; LPCSTR _path = 0==xr_strcmp(if_it->first.c_str(),".//")?"":if_it->first.c_str(); xr_strcpy (path,_path); u32 path_len = xr_strlen(path); if ((0!=path_len)&&(path[path_len-1]!='//')) xr_strcat(path,"//"); Msg (""); Msg ("Processing folder: '%s'",path); BOOL efRecurse; BOOL val = IsFolderAccepted(ltx,path,efRecurse); if (val || (!val&&!efRecurse)) { if (val) GatherFiles (path); xr_vector<char*>* i_fl_list = FS.file_list_open ("$target_folder$",path,folder_mask); if (!i_fl_list) { Msg ("ERROR: Unable to open folder list:", path); continue; } xr_vector<char*>::iterator it = i_fl_list->begin(); xr_vector<char*>::iterator itE = i_fl_list->end(); for (;it!=itE;++it) { xr_string tmp_path = xr_string(path)+xr_string(*it); bool val = IsFolderAccepted(ltx,tmp_path.c_str(),efRecurse); if (val) { folders_list->push_back(xr_strdup(tmp_path.c_str())); Msg ("+F: %s",tmp_path.c_str()); // collect files if (ifRecurse) GatherFiles (tmp_path.c_str()); }else { Msg ("-F: %s",tmp_path.c_str()); } } FS.file_list_close (i_fl_list); }else { Msg ("-F: %s",path); } } }//if(ltx.section_exist("include_folders")) if(ltx.section_exist("include_files")) { CInifile::Sect& if_sect = ltx.r_section("include_files"); for (CInifile::SectCIt if_it=if_sect.Data.begin(); if_it!=if_sect.Data.end(); ++if_it) { files_list->push_back (xr_strdup(if_it->first.c_str())); } } PerformWork (); // free xr_vector<char*>::iterator it = files_list->begin(); xr_vector<char*>::iterator itE = files_list->end(); for (;it!=itE;++it) xr_free(*it); xr_delete(files_list); it = folders_list->begin(); itE = folders_list->end(); for (;it!=itE;++it) xr_free(*it); xr_delete(folders_list); exclude_exts.clear_and_free();}
开发者ID:AntonioModer,项目名称:xray-16,代码行数:93,
示例21: Reset//.........这里部分代码省略......... const char *pszText = line->m_subLines[i].m_text.c_str(); const u32 tcolor = line->m_subLines[i].m_color; VERIFY( pszText ); tmp_line.AddSubLine( pszText , tcolor ); } m_lines.push_back( tmp_line ); tmp_line.Clear(); } else { for ( int i = 0 ; i < vsz ; i++ ) { const char *pszText = line->m_subLines[i].m_text.c_str(); const u32 tcolor = line->m_subLines[i].m_color; u16 uFrom = 0 , uPartLen = 0; VERIFY( pszText ); u16 nMarkers = m_pFont->SplitByWidth( aMarkers , UBUFFER_SIZE , fTargetWidth , pszText ); for ( u16 j = 0 ; j < nMarkers ; j ++ ) { uPartLen = aMarkers[ j ] - uFrom; VERIFY( ( uPartLen > 0 ) && ( uPartLen < MAX_MB_CHARS ) ); strncpy( szTempLine , pszText + uFrom , uPartLen ); szTempLine[ uPartLen ] = '/0'; tmp_line.AddSubLine( szTempLine , tcolor ); m_lines.push_back( tmp_line ); tmp_line.Clear(); // Compiler bug :)#pragma warning( disable : 4244 ) uFrom += uPartLen;#pragma warning( default : 4244 ) } strncpy( szTempLine , pszText + uFrom , MAX_MB_CHARS ); tmp_line.AddSubLine( szTempLine , tcolor ); m_lines.push_back( tmp_line ); tmp_line.Clear(); } } } else { float max_width = m_wndSize.x; u32 sbl_cnt = line->m_subLines.size(); CUILine tmp_line; string4096 buff; float curr_width = 0.0f; bool bnew_line = false; float __eps = get_str_width(m_pFont,'o');//hack -( for(u32 sbl_idx=0; sbl_idx<sbl_cnt; ++sbl_idx) { bool b_last_subl = (sbl_idx==sbl_cnt-1); CUISubLine& sbl = line->m_subLines[sbl_idx];//. Msg("%s",sbl.m_text.c_str()); u32 sub_len = (u32)sbl.m_text.length(); u32 curr_w_pos = 0; u32 last_space_idx = 0; for(u32 idx=0; idx<sub_len; ++idx) { bool b_last_ch = (idx==sub_len-1); if(isspace(sbl.m_text[idx])) last_space_idx = idx; float w1 = get_str_width(m_pFont, sbl.m_text[idx]); bool bOver = (curr_width+w1+__eps > max_width); if(bOver || b_last_ch) { if(last_space_idx && !b_last_ch) { idx = last_space_idx; last_space_idx = 0; } strncpy_s (buff, sizeof(buff), sbl.m_text.c_str()+curr_w_pos, idx-curr_w_pos+1);//. Msg ("-%s",buff); tmp_line.AddSubLine (buff , sbl.m_color); curr_w_pos = idx+1; } else curr_width += w1; if(bOver || (b_last_ch&&sbl.m_last_in_line) ) { m_lines.push_back (tmp_line); tmp_line.Clear (); curr_width = 0.0f; bnew_line = false; } } if(b_last_subl && !tmp_line.IsEmpty()) { m_lines.push_back (tmp_line); tmp_line.Clear (); curr_width = 0.0f; bnew_line = false; } } }//. while (line->GetSize() > 0 )//. m_lines.push_back(*line->CutByLength(m_pFont, m_wndSize.x, uFlags.test(flCutWordsMode))); xr_delete(line); uFlags.set(flNeedReparse, FALSE);}
开发者ID:OLR-xray,项目名称:OLR-3.0,代码行数:101,
示例22: ClearSMotions/*bool CEditableObject::LoadSMotions(const char* fname){ IReader* F = FS.r_open(fname); ClearSMotions(); // object motions m_SMotions.resize(F->r_u32()); SetActiveSMotion(0); for (SMotionIt m_it=m_SMotions.begin(); m_it!=m_SMotions.end(); m_it++){ *m_it = xr_new<CSMotion>(); if (!(*m_it)->Load(*F)){ ELog.DlgMsg(mtError,"Motions has different version. Load failed."); xr_delete(*m_it); m_SMotions.clear(); FS.r_close(F); return false; } if (!CheckBoneCompliance(*m_it)){ ClearSMotions(); ELog.DlgMsg(mtError,"Load failed.",fname); xr_delete(&*m_it); FS.r_close(F); return false; } } FS.r_close(F); return true;}*/bool CEditableObject::AppendSMotion(LPCSTR fname, SMotionVec* inserted){ VERIFY(IsSkeleton()); bool bRes = true; LPCSTR ext = strext(fname); if (0==stricmp(ext,".skl")){ CSMotion* M = xr_new<CSMotion>(); if (!M->LoadMotion(fname)){ ELog.Msg(mtError,"Motion '%s' can't load. Append failed.",fname); xr_delete(M); bRes = false; }else{ string256 name; _splitpath(fname,0,0,name,0); if (CheckBoneCompliance(M)){ M->SortBonesBySkeleton(m_Bones); string256 m_name; GenerateSMotionName (m_name,name,M); M->SetName (m_name); m_SMotions.push_back(M); if (inserted) inserted->push_back(M); // optimize M->Optimize (); }else{ ELog.Msg(mtError,"Append failed.",fname); xr_delete(M); bRes = false; } } }else if (0==stricmp(ext,".skls")){ IReader* F = FS.r_open(fname); if (!F){ ELog.Msg(mtError,"Can't open file '%s'.",fname); bRes = false; } if (bRes){ // object motions int cnt = F->r_u32(); for (int k=0; k<cnt; k++){ CSMotion* M = xr_new<CSMotion>(); if (!M->Load(*F)){ ELog.Msg(mtError,"Motion '%s' has different version. Load failed.",M->Name()); xr_delete(M); bRes = false; break; } if (!CheckBoneCompliance(M)){ xr_delete(M); bRes = false; break; } if (bRes){ M->SortBonesBySkeleton(m_Bones); string256 m_name; GenerateSMotionName (m_name,M->Name(),M); M->SetName (m_name); m_SMotions.push_back(M); if (inserted) inserted->push_back(M); // optimize M->Optimize (); } } } FS.r_close(F); } return bRes;}
开发者ID:OLR-xray,项目名称:OLR-3.0,代码行数:98,
示例23: lc_global_data//.........这里部分代码省略......... Vertex *pBase = *T; if (pBase->similar(*pTest,g_params().m_weld_distance)) { while(pTest->m_adjacents.size()) pTest->m_adjacents.front()->VReplace(pTest, pBase); lc_global_data()->destroy_vertex(lc_global_data()->g_vertices()[it]); Vremoved += 1; pTest = NULL; break; } } // If we get here - there is no similar vertices - register in hash tables if (pTest) { H.push_back (pTest); u32 ixE,iyE,izE; ixE = iFloor((V.x+VMeps.x-VMmin.x)*scale.x); iyE = iFloor((V.y+VMeps.y-VMmin.y)*scale.y); izE = iFloor((V.z+VMeps.z-VMmin.z)*scale.z); R_ASSERT(ixE<=HDIM_X && iyE<=HDIM_Y && izE<=HDIM_Z); if (ixE!=ix) HASH[ixE][iy][iz]->push_back (pTest); if (iyE!=iy) HASH[ix][iyE][iz]->push_back (pTest); if (izE!=iz) HASH[ix][iy][izE]->push_back (pTest); if ((ixE!=ix)&&(iyE!=iy)) HASH[ixE][iyE][iz]->push_back (pTest); if ((ixE!=ix)&&(izE!=iz)) HASH[ixE][iy][izE]->push_back (pTest); if ((iyE!=iy)&&(izE!=iz)) HASH[ix][iyE][izE]->push_back (pTest); if ((ixE!=ix)&&(iyE!=iy)&&(izE!=iz)) HASH[ixE][iyE][izE]->push_back (pTest); } } Status("Removing degenerated/duplicated faces..."); g_bUnregister = false; for (u32 it=0; it<lc_global_data()->g_faces().size(); it++) { R_ASSERT (it>=0 && it<(int)lc_global_data()->g_faces().size()); Face* F = lc_global_data()->g_faces()[it]; if ( F->isDegenerated()) { lc_global_data()->destroy_face (lc_global_data()->g_faces()[it]); Fremoved ++; } else { // Check validity F->Verify ( ); } Progress (float(it)/float(lc_global_data()->g_faces().size())); } if (InvalideFaces()) { err_save (); Debug.fatal (DEBUG_INFO,"* FATAL: %d invalid faces. Compilation aborted",InvalideFaces()); } Status ("Adjacency check..."); g_bUnregister = false; for (u32 it = 0; it<lc_global_data()->g_vertices().size(); ++it) { if (lc_global_data()->g_vertices()[it] && (lc_global_data()->g_vertices()[it]->m_adjacents.empty())) { lc_global_data()->destroy_vertex (lc_global_data()->g_vertices()[it]); ++Vremoved; } } Status ("Cleanup..."); lc_global_data()->g_vertices().erase (std::remove(lc_global_data()->g_vertices().begin(),lc_global_data()->g_vertices().end(),(Vertex*)0),lc_global_data()->g_vertices().end()); lc_global_data()->g_faces().erase (std::remove(lc_global_data()->g_faces().begin(),lc_global_data()->g_faces().end(),(Face*)0),lc_global_data()->g_faces().end()); { for (int ix=0; ix<HDIM_X+1; ix++) for (int iy=0; iy<HDIM_Y+1; iy++) for (int iz=0; iz<HDIM_Z+1; iz++) { xr_delete(HASH[ix][iy][iz]); } } mem_Compact (); clMsg("%d vertices removed. (%d left)",Vcount-lc_global_data()->g_vertices().size(),lc_global_data()->g_vertices().size()); clMsg("%d faces removed. (%d left)", Fcount-lc_global_data()->g_faces().size(), lc_global_data()->g_faces().size()); // ------------------------------------------------------------- /* int err_count =0 ; for (int _1=0; _1<g_faces.size(); _1++) { Progress(float(_1)/float(g_faces.size())); for (int _2=0; _2<g_faces.size(); _2++) { if (_1==_2) continue; if (FaceEqual(*g_faces[_1],*g_faces[_2])) { err_count ++; } } } clMsg ("! duplicate/same faces found:%d",err_count); */ // -------------------------------------------------------------}
开发者ID:AntonioModer,项目名称:xray-16,代码行数:101,
示例24: SetActiveSMotionvoid CEditableObject::ClearSMotions(){ SetActiveSMotion(0); for(SMotionIt m_it=m_SMotions.begin(); m_it!=m_SMotions.end();m_it++)xr_delete(*m_it); m_SMotions.clear();}
开发者ID:OLR-xray,项目名称:OLR-3.0,代码行数:6,
示例25: RemoveImageDatavoid CSurface::RemoveImageData(){ xr_delete (m_ImageData);}
开发者ID:OLR-xray,项目名称:OLR-3.0,代码行数:4,
示例26: xr_deleteCAI_PseudoDog::~CAI_PseudoDog(){ xr_delete(StateMan);}
开发者ID:2asoft,项目名称:xray,代码行数:4,
示例27: delete_dataCWeaponStatMgun::~CWeaponStatMgun(){ delete_data(m_Ammo); xr_delete(camera);}
开发者ID:AntonioModer,项目名称:xray-16,代码行数:5,
示例28: FindObjectByNamebool EScene::ReadObjectsLTX(CInifile& ini, LPCSTR sect_name_parent, LPCSTR sect_name_prefix, TAppendObject on_append, SPBItem* pb){ string128 buff; R_ASSERT (on_append); sprintf (buff, "%s_count", sect_name_prefix); u32 count = ini.r_u32(sect_name_parent, buff); bool bRes = true; for(u32 i=0; i<count; ++i) { sprintf (buff, "%s_%s_%d", sect_name_parent, sect_name_prefix, i); CCustomObject* obj = NULL; if(ReadObjectLTX(ini, buff, obj)) { LPCSTR obj_name = obj->Name; CCustomObject* existing = FindObjectByName(obj_name,obj->ClassID); if(existing) { if(g_frmConflictLoadObject->m_result!=2 && g_frmConflictLoadObject->m_result!=4 && g_frmConflictLoadObject->m_result!=6) { g_frmConflictLoadObject->m_existing_object = existing; g_frmConflictLoadObject->m_new_object = obj; g_frmConflictLoadObject->Prepare (); g_frmConflictLoadObject->ShowModal (); } switch(g_frmConflictLoadObject->m_result) { case 1: //Overwrite case 2: //Overwrite All { bool res = RemoveObject (existing, true, true); if(!res) Msg("! RemoveObject [%s] failed", existing->Name); else xr_delete(existing); }break; case 3: //Insert new case 4: //Insert new All { string256 buf; GenObjectName (obj->ClassID, buf, obj->Name); obj->Name = buf; }break; case 0: //Cancel case 5: //Skip case 6: //Skip All { xr_delete(obj); }break; } //switch } //if exist if (obj && !on_append(obj)) xr_delete(obj);} else bRes = false; if (pb) pb->Inc(); } return bRes;}
开发者ID:AntonioModer,项目名称:xray-16,代码行数:64,
注:本文中的xr_delete函数示例整理自Github/MSDocs等源码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。 C++ xr_free函数代码示例 C++ xr函数代码示例 |