这篇教程C++ xr_free函数代码示例写得很实用,希望能帮到您。
本文整理汇总了C++中xr_free函数的典型用法代码示例。如果您正苦于以下问题:C++ xr_free函数的具体用法?C++ xr_free怎么用?C++ xr_free使用的例子?那么恭喜您, 这里精选的函数代码示例或许可以为您提供帮助。 在下文中一共展示了xr_free函数的29个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于我们的系统推荐出更棒的C++代码示例。 示例1: whilevoid CXRayObjectExport::destroyEdgeTable()//// Free up all of the memory used by the edgeTable.//{//. if ( !smoothing ) return; SXREdgeInfoPtr element = NULL; SXREdgeInfoPtr tmp = NULL; for ( int v=0; v<edgeTableSize; v++ ) { element = edgeTable[v]; while ( NULL != element ) { tmp = element; element = element->next; xr_free( tmp ); } } if ( NULL != edgeTable ) { xr_free( edgeTable ); edgeTable = NULL; } if ( NULL != polySmoothingGroups ) { xr_free( polySmoothingGroups ); polySmoothingGroups = NULL; }}
开发者ID:2asoft,项目名称:xray,代码行数:31,
示例2: xr_strdupbool CScriptStorage::parse_namespace(LPCSTR caNamespaceName, LPSTR b, LPSTR c){ strcpy (b,""); strcpy (c,""); LPSTR S2 = xr_strdup(caNamespaceName); LPSTR S = S2; for (int i=0;;++i) { if (!xr_strlen(S)) { script_log (ScriptStorage::eLuaMessageTypeError,"the namespace name %s is incorrect!",caNamespaceName); xr_free (S2); return (false); } LPSTR S1 = strchr(S,'.'); if (S1) *S1 = 0; if (i) strcat (b,"{"); strcat (b,S); strcat (b,"="); if (i) strcat (c,"}"); if (S1) S = ++S1; else break; } xr_free (S2); return (true);}
开发者ID:OLR-xray,项目名称:OLR-3.0,代码行数:30,
示例3: xr_freeCContextMenu::~CContextMenu(){ for (xr_vector<MenuItem>::iterator I=Items.begin(); Items.end()!=I; ++I){ Engine.Event.Destroy(I->Event); xr_free(I->Name); xr_free(I->Param); } xr_free(Name);}
开发者ID:OLR-xray,项目名称:OLR-3.0,代码行数:8,
示例4: fill_render_mode_list/*void fill_render_mode_list(){ if(vid_quality_token != NULL) return; D3DCAPS9 caps; CHW _HW; _HW.CreateD3D (); _HW.pD3D->GetDeviceCaps (D3DADAPTER_DEFAULT,D3DDEVTYPE_HAL,&caps); _HW.DestroyD3D (); u16 ps_ver_major = u16 ( u32(u32(caps.PixelShaderVersion)&u32(0xf << 8ul))>>8 ); xr_vector<LPCSTR> _tmp; u32 i = 0; for(; i<5; ++i) { bool bBreakLoop = false; switch (i) { case 3: //"renderer_r2.5" if (ps_ver_major < 3) bBreakLoop = true; break; case 4: //"renderer_r_dx10" bBreakLoop = true; break; default: ; } if (bBreakLoop) break; _tmp.push_back (NULL); LPCSTR val = NULL; switch (i) { case 0: val ="renderer_r1"; break; case 1: val ="renderer_r2a"; break; case 2: val ="renderer_r2"; break; case 3: val ="renderer_r2.5"; break; case 4: val ="renderer_r_dx10"; break; // -) } _tmp.back() = xr_strdup(val); } u32 _cnt = _tmp.size()+1; vid_quality_token = xr_alloc<xr_token>(_cnt); vid_quality_token[_cnt-1].id = -1; vid_quality_token[_cnt-1].name = NULL;#ifdef DEBUG Msg("Available render modes[%d]:",_tmp.size());#endif // DEBUG for(u32 i=0; i<_tmp.size();++i) { vid_quality_token[i].id = i; vid_quality_token[i].name = _tmp[i];#ifdef DEBUG Msg ("[%s]",_tmp[i]);#endif // DEBUG }}*/void free_vid_mode_list(){ for( int i=0; vid_mode_token[i].name; i++ ) { xr_free (vid_mode_token[i].name); } xr_free (vid_mode_token); vid_mode_token = NULL;}
开发者ID:denanden,项目名称:xray-16,代码行数:71,
示例5: void CSoundRender_Cache::destroy (){ disconnect (); xr_free (data); xr_free (c_storage); c_begin = NULL; c_end = NULL; _total = 0; _line = 0; _count = 0;}
开发者ID:NeoAnomaly,项目名称:xray,代码行数:11,
示例6: CSoundStream::~CSoundStream ( ){ Stop ( ); FS.r_close (hf); xr_free (WaveSource); xr_free (WaveDest); xr_free (pwfx); xr_free (psrc); _RELEASE (pBuffer);}
开发者ID:2asoft,项目名称:xray,代码行数:11,
示例7: CEngineAPI::~CEngineAPI(){ // destroy quality token here if (vid_quality_token) { for( int i=0; vid_quality_token[i].name; i++ ) { xr_free (vid_quality_token[i].name); } xr_free (vid_quality_token); vid_quality_token = NULL; }}
开发者ID:2asoft,项目名称:xray,代码行数:13,
示例8: xr_freevoid CRender::LoadSWIs(CStreamReader* base_fs){ // allocate memory for portals if (base_fs->find_chunk(fsL_SWIS)){ CStreamReader *fs = base_fs->open_chunk(fsL_SWIS); u32 item_count = fs->r_u32(); xr_vector<FSlideWindowItem>::iterator it = SWIs.begin(); xr_vector<FSlideWindowItem>::iterator it_e = SWIs.end(); for(;it!=it_e;++it) xr_free( (*it).sw ); SWIs.clear_not_free(); SWIs.resize (item_count); for (u32 c=0; c<item_count; c++){ FSlideWindowItem& swi = SWIs[c]; swi.reserved[0] = fs->r_u32(); swi.reserved[1] = fs->r_u32(); swi.reserved[2] = fs->r_u32(); swi.reserved[3] = fs->r_u32(); swi.count = fs->r_u32(); VERIFY (NULL==swi.sw); swi.sw = xr_alloc<FSlideWindow> (swi.count); fs->r (swi.sw,sizeof(FSlideWindow)*swi.count); } fs->close (); }}
开发者ID:2asoft,项目名称:xray-16,代码行数:30,
示例9: ClearSlotsvoid EDetailManager::ClearSlots(){ ZeroMemory (&dtH,sizeof(DetailHeader)); xr_free (dtSlots); m_Selected.clear (); InvalidateCache ();}
开发者ID:2asoft,项目名称:xray,代码行数:7,
示例10: xr_freevoid CKinematics::IBoneInstances_Destroy(){ if (bone_instances) { xr_free(bone_instances); bone_instances = NULL; }}
开发者ID:NeoAnomaly,项目名称:xray,代码行数:7,
示例11: Exportvoid EDetail::Export(IWriter& F, LPCSTR tex_name, const Fvector2& offs, const Fvector2& scale, bool rot){ R_ASSERT (m_pRefs); CSurface* surf = *m_pRefs->FirstSurface(); R_ASSERT (surf); // write data F.w_stringZ (surf->_ShaderName()); F.w_stringZ (tex_name);//surf->_Texture()); F.w_u32 (m_Flags.get()); F.w_float (m_fMinScale); F.w_float (m_fMaxScale); F.w_u32 (number_vertices); F.w_u32 (number_indices); // remap UV EVertexIn* rm_vertices = xr_alloc<EVertexIn>(number_vertices); for (u32 k=0; k<number_vertices; k++) rm_vertices[k].remapUV(vertices[k],offs,scale,rot); F.w (rm_vertices, number_vertices*sizeof(fvfVertexIn)); F.w (indices, number_indices*sizeof(WORD)); xr_free (rm_vertices);}
开发者ID:OLR-xray,项目名称:OLR-3.0,代码行数:25,
示例12: static LPVOID __cdecl luabind_allocator ( luabind::memory_allocation_function_parameter const, void const * const pointer, size_t const size ){ if (!size) { LPVOID non_const_pointer = const_cast<LPVOID>(pointer); xr_free (non_const_pointer); return ( 0 ); } if (!pointer) {#ifdef DEBUG return ( Memory.mem_alloc(size, "luabind") );#else // #ifdef DEBUG return ( Memory.mem_alloc(size) );#endif // #ifdef DEBUG } LPVOID non_const_pointer = const_cast<LPVOID>(pointer);#ifdef DEBUG return ( Memory.mem_realloc(non_const_pointer, size, "luabind") );#else // #ifdef DEBUG return ( Memory.mem_realloc(non_const_pointer, size) );#endif // #ifdef DEBUG}
开发者ID:2asoft,项目名称:xray,代码行数:27,
示例13: xr_deleteCLightShadows::~CLightShadows(){ // Debug sh_Screen.destroy (); geom_Screen.destroy (); geom_Blur.destroy (); geom_World.destroy (); sh_BlurRT.destroy (); sh_BlurTR.destroy (); sh_World.destroy (); RT_temp.destroy (); RT.destroy (); // casters for (u32 it=0; it<casters_pool.size(); it++) xr_delete(casters_pool[it]); casters_pool.clear (); // cache for (u32 it=0; it<cache.size(); it++) xr_free (cache[it].tris); cache.clear ();}
开发者ID:OLR-xray,项目名称:OLR-3.0,代码行数:25,
示例14: VERIFYvoid CSoundStream::Play ( BOOL loop, int cnt ){ VERIFY(Sound); if (isPause) { Pause(); return; } if (dwStatus & DSBSTATUS_PLAYING) return; dwDecPos = 0; isPresentData = true;//---------------- if (hAcmStream){ CHK_DX(acmStreamClose(hAcmStream,0)); } CHK_DX(acmStreamOpen(&hAcmStream,0,psrc,pwfx,0,NULL,0,0)); CHK_DX(acmStreamSize(hAcmStream,dwDestBufSize,LPDWORD(&dwSrcBufSize),ACM_STREAMSIZEF_DESTINATION)); // alloc source data buffer VERIFY(dwSrcBufSize); xr_free(WaveSource); WaveSource = (unsigned char *)xr_malloc(dwSrcBufSize); // seek to data start hf->seek (DataPos); writepos = 0; Decompress (WaveDest); writepos =stream.cbDstLengthUsed;//------- iLoopCountRested= cnt; bMustLoop = loop; bMustPlay = true;}
开发者ID:2asoft,项目名称:xray,代码行数:29,
示例15: Createvoid CImage::Create(u32 w, u32 h){ xr_free (pData); dwWidth = w; dwHeight = h; pData = (u32*)(xr_malloc(w*h*sizeof(u32)));}
开发者ID:AntonioModer,项目名称:xray-16,代码行数:7,
示例16: _RELEASEdx10ConstantBuffer::~dx10ConstantBuffer(){ DEV->_DeleteConstantBuffer(this);// Flush(); _RELEASE(m_pBuffer); xr_free(m_pBufferData);}
开发者ID:2asoft,项目名称:xray,代码行数:7,
示例17: xr_delete////////////////////////////////////////////////////////////////////////////////////////// RemoveSmallStrips()//// allStrips is the whole strip _vector_...all small strips will be deleted from this list, to avoid leaking mem// allBigStrips is an out parameter which will contain all strips above minStripLength// faceList is an out parameter which will contain all faces which were removed from the striplist//void NvStripifier::RemoveSmallStrips(NvStripInfoVec& allStrips, NvStripInfoVec& allBigStrips, NvFaceInfoVec& faceList){ faceList.clear(); allBigStrips.clear(); //make sure these are empty NvFaceInfoVec tempFaceList; for(int i = 0; i < allStrips.size(); i++) { if(allStrips[i]->m_faces.size() < minStripLength) { //strip is too small, add faces to faceList for(int j = 0; j < allStrips[i]->m_faces.size(); j++) tempFaceList.push_back(allStrips[i]->m_faces[j]); //and xr_free memory xr_delete(allStrips[i]); } else { allBigStrips.push_back(allStrips[i]); } } bool *bVisitedList = xr_alloc<bool> (tempFaceList.size()); ZeroMemory (bVisitedList, tempFaceList.size()*sizeof(bool)); VertexCache* vcache = xr_new<VertexCache> (cacheSize); int bestNumHits = -1; int numHits = 0; int bestIndex = 0; while(1) { bestNumHits = -1; //find best face to add next, given the current cache for(int i = 0; i < tempFaceList.size(); i++) { if(bVisitedList[i]) continue; numHits = CalcNumHitsFace(vcache, tempFaceList[i]); if(numHits > bestNumHits) { bestNumHits = numHits; bestIndex = i; } } if(bestNumHits == -1.0f) break; bVisitedList[bestIndex] = true; UpdateCacheFace(vcache, tempFaceList[bestIndex]); faceList.push_back(tempFaceList[bestIndex]); } xr_delete (vcache); xr_free (bVisitedList);}
开发者ID:2asoft,项目名称:xray-16,代码行数:67,
示例18: xr_freeCGameFont::~CGameFont(){ if ( TCMap ) xr_free( TCMap ); // Shading RenderFactory->DestroyFontRender(pFontRender);}
开发者ID:2asoft,项目名称:xray,代码行数:8,
示例19: xr_freevoid CKinematicsAnimated::IBoneInstances_Destroy(){ inherited::IBoneInstances_Destroy(); if (blend_instances) { xr_free(blend_instances); blend_instances = NULL; }}
开发者ID:OLR-xray,项目名称:OLR-3.0,代码行数:8,
示例20: Loadvoid CSoundStream::Load( LPCSTR name ){ if (name) { xr_free (fName); fName = xr_strdup(name); } LoadADPCM ( ); bNeedUpdate = true;}
开发者ID:2asoft,项目名称:xray,代码行数:9,
示例21: void CResourceManager::OnDeviceDestroy(BOOL ){ if (RDEVICE.b_is_Ready) return; m_textures_description.UnLoad (); // Matrices for (map_Matrix::iterator m=m_matrices.begin(); m!=m_matrices.end(); m++) { R_ASSERT (1==m->second->dwReference); xr_delete (m->second); } m_matrices.clear (); // Constants for (map_Constant::iterator c=m_constants.begin(); c!=m_constants.end(); c++) { R_ASSERT (1==c->second->dwReference); xr_delete (c->second); } m_constants.clear (); // Release blenders for (map_BlenderIt b=m_blenders.begin(); b!=m_blenders.end(); b++) { xr_free ((char*&)b->first); IBlender::Destroy (b->second); } m_blenders.clear (); // destroy TD for (map_TDIt _t=m_td.begin(); _t!=m_td.end(); _t++) { xr_free ((char*&)_t->first); xr_free ((char*&)_t->second.T); xr_delete (_t->second.cs); } m_td.clear (); // scripting#ifndef _EDITOR LS_Unload ();#endif}
开发者ID:2asoft,项目名称:xray-16,代码行数:42,
示例22: ReplaceSpaceAndLowerCasevoid ReplaceSpaceAndLowerCase(shared_str& s){ if (*s){ char* _s = xr_strdup(*s); char* lp = _s; while(lp[0]){if (lp[0]==' ') lp[0]='_'; lp++;} xr_strlwr (_s); s = _s; xr_free (_s); }}
开发者ID:AntonioModer,项目名称:xray-16,代码行数:11,
示例23: WriteStoredDemovoid CLevel::Demo_Clear (){ WriteStoredDemo(); m_bDemoSaveMode = FALSE; xr_free(m_pStoredDemoData); m_dwStoredDemoDataSize = 0; if (!g_bLeaveTDemo) { DeleteFile(m_sDemoName); };};
开发者ID:OLR-xray,项目名称:XRay-NEW,代码行数:12,
示例24: xr_freevoid CSoundStream::Stop ( ){ int code; xr_free(WaveSource); if (hAcmStream) { code=acmStreamClose(hAcmStream,0); VERIFY2(code==0,"Can't close stream"); } hAcmStream = 0; pBuffer->Stop ( ); pBuffer->SetCurrentPosition ( 0 ); dwStatus = 0; isPause = false;}
开发者ID:2asoft,项目名称:xray,代码行数:13,
示例25: CPatternFunction::~CPatternFunction(){ xr_free (m_dwaVariableTypes); xr_free (m_dwaAtomicFeatureRange); xr_free (m_dwaPatternIndexes); for (u32 i=0; i<m_dwPatternCount; ++i) xr_free (m_tpPatterns[i].dwaVariableIndexes); xr_free (m_tpPatterns); xr_free (m_faParameters); xr_free (m_dwaVariableValues);}
开发者ID:OLR-xray,项目名称:OLR-3.0,代码行数:11,
示例26: _compressLZvoid IWriter::w_compressed(void* ptr, u32 count){ BYTE* dest = 0; unsigned dest_sz = 0; _compressLZ(&dest, &dest_sz, ptr, count); // if (g_dummy_stuff) // g_dummy_stuff (dest,dest_sz,dest); if (dest && dest_sz) w(dest, dest_sz); xr_free(dest);}
开发者ID:BubbaXXX,项目名称:xray-16,代码行数:13,
示例27: xr_freevoid CXRayObjectExport::freeLookupTables()//// Frees up all tables and arrays allocated by this plug-in.//{ if (vertexTablePtr){ for ( int i=0; i<objectCount; i++ ) { if ( vertexTablePtr[i] != NULL ) { xr_free( vertexTablePtr[i] ); } } } if (polygonTablePtr){ for ( int i=0; i<objectCount; i++ ) { if ( polygonTablePtr[i] != NULL ) { xr_free( polygonTablePtr[i] ); } } } if (objectGroupsTablePtr) { for ( int i=0; i<objectCount; i++ ) { if ( objectGroupsTablePtr[i] != NULL ) { xr_free( objectGroupsTablePtr[i] ); } } xr_free( objectGroupsTablePtr ); objectGroupsTablePtr = NULL; } if ( vertexTablePtr != NULL ) { xr_free( vertexTablePtr ); vertexTablePtr = NULL; } if ( polygonTablePtr != NULL ) { xr_free( polygonTablePtr ); polygonTablePtr = NULL; } if ( lastSets != NULL ) { xr_delete(lastSets); lastSets = NULL; } if ( lastMaterials != NULL ) { xr_delete(lastMaterials); lastMaterials = NULL; } if ( sets != NULL ) { xr_delete(sets); sets = NULL; } if ( objectNames != NULL ) { xr_delete(objectNames); objectNames = NULL; } }
开发者ID:2asoft,项目名称:xray,代码行数:58,
示例28: static void *lua_alloc_xr (void *ud, void *ptr, size_t osize, size_t nsize) { (void)ud; (void)osize; if (nsize == 0) { xr_free (ptr); return NULL; } else#ifdef DEBUG_MEMORY_NAME return Memory.mem_realloc (ptr, nsize, "LUA");#else // DEBUG_MEMORY_MANAGER return Memory.mem_realloc (ptr, nsize);#endif // DEBUG_MEMORY_MANAGER}
开发者ID:OLR-xray,项目名称:OLR-3.0,代码行数:14,
示例29: Clearvoid CEditableMesh::Clear() {#ifdef _EDITOR UnloadRenderBuffers ();#endif UnloadAdjacency (); UnloadCForm (); UnloadFNormals (); UnloadVNormals (); UnloadSVertices (); VERIFY (m_FNormalsRefs==0 && m_VNormalsRefs==0 && m_AdjsRefs==0 && m_SVertRefs==0); xr_free (m_Verts); xr_free (m_Faces); for (VMapIt vm_it=m_VMaps.begin(); vm_it!=m_VMaps.end(); vm_it++) xr_delete (*vm_it); m_VMaps.clear (); m_SurfFaces.clear (); for (VMRefsIt ref_it=m_VMRefs.begin(); ref_it!=m_VMRefs.end(); ref_it++) xr_free (ref_it->pts); m_VMRefs.clear ();}
开发者ID:NeoAnomaly,项目名称:xray,代码行数:23,
注:本文中的xr_free函数示例整理自Github/MSDocs等源码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。 C++ xr_strcpy函数代码示例 C++ xr_delete函数代码示例 |