本文整理汇总了C++中xr_free函数的典型用法代码示例。如果您正苦于以下问题:C++ xr_free函数的具体用法?C++ xr_free怎么用?C++ xr_free使用的例子?那么, 这里精选的函数代码示例或许可以为您提供帮助。
在下文中一共展示了xr_free函数的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。
示例1: while
void 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;
}
}
示例2: xr_strdup
bool 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);
}
示例3: xr_free
CContextMenu::~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);
}
示例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;
}
示例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;
}
示例6:
CSoundStream::~CSoundStream ( )
{
Stop ( );
FS.r_close (hf);
xr_free (WaveSource);
xr_free (WaveDest);
xr_free (pwfx);
xr_free (psrc);
_RELEASE (pBuffer);
}
示例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;
}
}
示例8: xr_free
void 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 ();
}
}
示例9: ClearSlots
void EDetailManager::ClearSlots()
{
ZeroMemory (&dtH,sizeof(DetailHeader));
xr_free (dtSlots);
m_Selected.clear ();
InvalidateCache ();
}
示例10: xr_free
void CKinematics::IBoneInstances_Destroy()
{
if (bone_instances) {
xr_free(bone_instances);
bone_instances = NULL;
}
}
示例11: Export
void 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);
}
示例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
}
示例13: xr_delete
CLightShadows::~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 ();
}
示例14: VERIFY
void 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;
}
示例15: Create
void CImage::Create(u32 w, u32 h)
{
xr_free (pData);
dwWidth = w;
dwHeight = h;
pData = (u32*)(xr_malloc(w*h*sizeof(u32)));
}