本文整理汇总了C++中CSurface::_VMap方法的典型用法代码示例。如果您正苦于以下问题:C++ CSurface::_VMap方法的具体用法?C++ CSurface::_VMap怎么用?C++ CSurface::_VMap使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类CSurface
的用法示例。
在下文中一共展示了CSurface::_VMap方法的1个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。
示例1: 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]){
//.........这里部分代码省略.........