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


C++ CSurface::_Texture方法代码示例

本文整理汇总了C++中CSurface::_Texture方法的典型用法代码示例。如果您正苦于以下问题:C++ CSurface::_Texture方法的具体用法?C++ CSurface::_Texture怎么用?C++ CSurface::_Texture使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在CSurface的用法示例。


在下文中一共展示了CSurface::_Texture方法的5个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。

示例1: OnDeviceCreate

void EDetail::OnDeviceCreate()
{
	if (!m_pRefs)		return;
    CSurface* surf		= *m_pRefs->FirstSurface();
    VERIFY				(surf);
    AnsiString	s_name	= surf->_ShaderName();
    AnsiString	t_name	= surf->_Texture();
	shader.create		(s_name.c_str(),t_name.c_str());
}
开发者ID:OLR-xray,项目名称:OLR-3.0,代码行数:9,代码来源:EDetailModel.cpp

示例2: GetSummaryInfo

bool EDetailManager::GetSummaryInfo(SSceneSummary* inf)
{
	for (DetailIt it=objects.begin(); it!=objects.end(); it++){
    	((EDetail*)(*it))->OnDeviceCreate();
        CEditableObject* E 	= ((EDetail*)(*it))->m_pRefs;
		if (!E)				continue;
	    CSurface* surf		= *E->FirstSurface(); VERIFY(surf);
		inf->AppendTexture	(surf->_Texture(),SSceneSummary::sttDO,0,0,"$DETAILS$");
    }
    return true;
}
开发者ID:2asoft,项目名称:xray,代码行数:11,代码来源:ESceneDOTools.cpp

示例3: Export

void EDetail::Export(LPCSTR name)
{
    CSurface* surf		= *m_pRefs->FirstSurface();
	R_ASSERT			(surf);
    IWriter* F 			= FS.w_open(name);
    if (F){
        Fvector2 offs	= {0,0};
        Fvector2 scale	= {1,1};
        Export			(*F,surf->_Texture(),offs,scale,false);
        FS.w_close		(F);
    }else{
        Log				("!Can't export detail:",name);
    }
}
开发者ID:OLR-xray,项目名称:OLR-3.0,代码行数:14,代码来源:EDetailModel.cpp

示例4: Import_LWO

bool CEditableObject::Import_LWO(const char* fn, bool bNeedOptimize)
{
	lwObject *I=0;
//	UI->SetStatus("Importing...");
//	UI->ProgressStart(100,"Read file:");
//	UI->ProgressUpdate(1);
    string512 fname;
    strcpy(fname,fn);
#ifdef _EDITOR
	I=LWO_ImportObject(fname,I);
#else
	unsigned int failID;
	int failpos;
	I = lwGetObject( fname, &failID, &failpos );
#endif
//	UI->ProgressUpdate(100);
	if (I){
        bool bResult=true;
        ELog.Msg( mtInformation, "CEditableObject: import lwo %s...", fname );

        // parse lwo object
        {
        	m_Meshes.reserve	(I->nlayers);
            m_Surfaces.reserve	(I->nsurfs);

            // surfaces
            st_lwSurface* Isf=0;
            {
                int i=0;
//                UI->ProgressStart(I->nsurfs,"Check surf:");
                for (Isf=I->surf; Isf; Isf=Isf->next){
//                    UI->ProgressUpdate(i);
                    Isf->alpha_mode=i; // перетираем для внутренних целей !!!
                    CSurface* Osf = new CSurface();
                    m_Surfaces.push_back(Osf);
                    if (Isf->name&&Isf->name[0]) Osf->SetName(Isf->name); else Osf->SetName("Default");
                    Osf->m_Flags.set(CSurface::sf2Sided,(Isf->sideflags==3)?TRUE:FALSE);
                    AnsiString en_name="default", lc_name="default", gm_name="default";
                    XRShader* sh_info = 0;
                    if (Isf->nshaders&&(stricmp(Isf->shader->name,SH_PLUGIN_NAME)==0)){
                    	sh_info 	= (XRShader*)Isf->shader->data;
                        en_name 	= sh_info->en_name;
                        lc_name 	= sh_info->lc_name;
                        gm_name		= sh_info->gm_name;
                    }else
						ELog.Msg(mtError,"CEditableObject: Shader not found on surface '%s'.",Osf->_Name());
#ifdef _EDITOR
					if (!Device.Resources->_FindBlender(en_name.c_str())){
						ELog.Msg(mtError,"CEditableObject: Render shader '%s' - can't find in library.\nUsing 'default' shader on surface '%s'.", en_name.c_str(), Osf->_Name());
	                    en_name = "default";
					}
					if (!Device.ShaderXRLC.Get(lc_name.c_str())){
						ELog.Msg(mtError,"CEditableObject: Compiler shader '%s' - can't find in library.\nUsing 'default' shader on surface '%s'.", lc_name.c_str(), Osf->_Name());
	                    lc_name = "default";
					}
					if (!GMLib.GetMaterial(gm_name.c_str())){
						ELog.Msg(mtError,"CEditableObject: Game material '%s' - can't find in library.\nUsing 'default' material on surface '%s'.", lc_name.c_str(), Osf->_Name());
	                    gm_name = "default";
					}
#endif
                    // fill texture layers
                    int cidx;
                    st_lwClip* Icl;
                    u32 dwNumTextures=0;
                    for (st_lwTexture* Itx=Isf->color.tex; Itx; Itx=Itx->next){
                        string1024 tname="";
                        dwNumTextures++;
                        cidx = -1;
                        if (Itx->type==ID_IMAP) cidx=Itx->param.imap.cindex;
                        else{
                            ELog.DlgMsg(mtError, "Import LWO (Surface '%s'): 'Texture' is not Image Map!",Osf->_Name());
                            bResult=false;
                            break;
                        }
                        if (cidx!=-1){
                            // get textures
                            for (Icl=I->clip; Icl; Icl=Icl->next)
                                if ((cidx==Icl->index)&&(Icl->type==ID_STIL)){
                                    strcpy(tname,Icl->source.still.name);
                                    break;
                                }
                            if (tname[0]==0){
                                ELog.DlgMsg(mtError, "Import LWO (Surface '%s'): 'Texture' name is empty or non 'STIL' type!",Osf->_Name());
                                bResult=false;
                                break;
                            }
                            string256 tex_name;
                            _splitpath( tname, 0, 0, tex_name, 0 );
							Osf->SetTexture(EFS.AppendFolderToName(tex_name,1,TRUE));
                            // get vmap refs
                            Osf->SetVMap(Itx->param.imap.vmap_name);
                        }
                    }
                    if (!bResult) break;
                    if (!Osf->_VMap()||!Osf->_VMap()[0]){
						ELog.DlgMsg(mtError, "Invalid surface '%s'. VMap empty.",Osf->_Name());
                        bResult = false;
						break;
                    }
                    if (!Osf->_Texture()||!Osf->_Texture()[0]){
//.........这里部分代码省略.........
开发者ID:galek,项目名称:xray,代码行数:101,代码来源:EditObjectImport.cpp

示例5: GetTextureName

LPCSTR EDetail::GetTextureName()
{
	VERIFY(m_pRefs);
    CSurface* surf		= *m_pRefs->FirstSurface(); VERIFY(surf);
    return surf->_Texture();
}
开发者ID:OLR-xray,项目名称:OLR-3.0,代码行数:6,代码来源:EDetailModel.cpp


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