当前位置: 首页>>代码示例>>C++>>正文


C++ xr_free函数代码示例

本文整理汇总了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;
    }
}
开发者ID:2asoft,项目名称:xray,代码行数:31,代码来源:maTranslator.cpp

示例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);
}
开发者ID:OLR-xray,项目名称:OLR-3.0,代码行数:30,代码来源:script_storage.cpp

示例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);
}
开发者ID:OLR-xray,项目名称:OLR-3.0,代码行数:8,代码来源:ContextMenu.cpp

示例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,代码来源:HW.cpp

示例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,代码来源:SoundRender_Cache.cpp

示例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,代码来源:xr_streamsnd.cpp

示例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,代码来源:EngineAPI.cpp

示例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			();
	}
}
开发者ID:2asoft,项目名称:xray-16,代码行数:30,代码来源:r3_loader.cpp

示例9: ClearSlots

void EDetailManager::ClearSlots()
{
    ZeroMemory			(&dtH,sizeof(DetailHeader));
    xr_free				(dtSlots);
	m_Selected.clear	();
    InvalidateCache		();
}
开发者ID:2asoft,项目名称:xray,代码行数:7,代码来源:ESceneDOTools.cpp

示例10: xr_free

void	CKinematics::IBoneInstances_Destroy()
{
	if (bone_instances) {
		xr_free(bone_instances);
		bone_instances = NULL;
	}
}
开发者ID:NeoAnomaly,项目名称:xray,代码行数:7,代码来源:SkeletonCustom.cpp

示例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);
}
开发者ID:OLR-xray,项目名称:OLR-3.0,代码行数:25,代码来源:EDetailModel.cpp

示例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,代码来源:script_storage.cpp

示例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				();
}
开发者ID:OLR-xray,项目名称:OLR-3.0,代码行数:25,代码来源:LightShadows.cpp

示例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;
}
开发者ID:2asoft,项目名称:xray,代码行数:29,代码来源:xr_streamsnd.cpp

示例15: Create

void 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,代码来源:Image.cpp


注:本文中的xr_free函数示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。