本文整理汇总了C++中DiString::ExtractDirName方法的典型用法代码示例。如果您正苦于以下问题:C++ DiString::ExtractDirName方法的具体用法?C++ DiString::ExtractDirName怎么用?C++ DiString::ExtractDirName使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类DiString
的用法示例。
在下文中一共展示了DiString::ExtractDirName方法的3个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。
示例1: main
int main(int numargs, char** args)
{
if (numargs < 2)
return -1;
parseArgs(numargs, args);
auto root = OGRE_NEW Ogre::Root("", "", "ogre.log");
root->loadPlugin("RenderSystem_Direct3D9_d");
root->setRenderSystem(root->getRenderSystemByName("Direct3D9 Rendering Subsystem"));
root->getRenderSystem()->setConfigOption("Full Screen","No");
root->initialise(true);
converterMgr = new ConverterMgr();
CovOptions option;
option.source = srcName.c_str();
option.dest = destName.c_str();
Ogre::ResourceGroupManager::getSingleton().addResourceLocation(srcName.ExtractDirName().c_str(),"FileSystem");
Ogre::ResourceGroupManager::getSingleton().initialiseResourceGroup(Ogre::ResourceGroupManager::DEFAULT_RESOURCE_GROUP_NAME);
if (isAnimation)
{
converterMgr->SkeletonToMotion(option);
}
else
{
converterMgr->MeshToModel(option);
}
delete converterMgr;
delete root;
return 0;
}
示例2: ExportMesh
void ModelConverter::ExportMesh( const Mesh* pMesh, const String& filename )
{
LogManager::getSingleton().logMessage("XMLMeshSerializer writing mesh data to " + filename + "...");
mMesh = const_cast<Mesh*>(pMesh);
LogManager::getSingleton().logMessage("Populating DOM...");
DiMeshPtr mesh = WriteMesh(pMesh);
LogManager::getSingleton().logMessage("DOM populated, writing model file..");
if (mesh)
{
// save to file
DiMeshSerializer ms;
ms.ExportMesh(mesh,filename);
// write material files
DiMesh::SubMeshIterator it = mesh->GetSubMeshs();
while (it.HasMoreElements())
{
DiSubMesh* subMesh = it.GetNext();
unsigned int maxw = subMesh->GetMaxWeights();
DiString matname = subMesh->GetMaterialName();
DiString matfile = filename.c_str();
matfile = matfile.ExtractDirName();
matfile += matname;
WriteSimpleMaterial(maxw,matfile);
}
}
}
示例3: parseArgs
void parseArgs(int numArgs, char **args)
{
srcName = args[1];
srcName.ToLower();
if(srcName.CheckFileExtension("skeleton") ||
srcName.CheckFileExtension("skeleton"))
{
isAnimation = true;
}
if(numArgs == 2)
{
destName = srcName.ExtractDirName();
DiString temp = srcName.ExtractFileName().ExtractBaseName();
destName.append(temp);
destName.append(!isAnimation?".model":".motion");
}
else if(numArgs == 3)
{
destName = args[2];
}
}