本文整理汇总了C++中DiString::CheckFileExtension方法的典型用法代码示例。如果您正苦于以下问题:C++ DiString::CheckFileExtension方法的具体用法?C++ DiString::CheckFileExtension怎么用?C++ DiString::CheckFileExtension使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类DiString
的用法示例。
在下文中一共展示了DiString::CheckFileExtension方法的4个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。
示例1: an
DiTexturePtr DiShaderParameter::WriteTexture2D( const DiString& name,
const DiString& textureName )
{
DiString texfile = textureName;
#if DEMI_PLATFORM == DEMI_PLATFORM_IOS
if(texfile.CheckFileExtension("dds"))
texfile = texfile.ExtractBaseName() + ".pvr";
#endif
//DI_LOG("Writing 2d texture name: %s, %s [%x]", name.c_str(), textureName.c_str(),this);
DiAssetManager& assetMgr = DiAssetManager::GetInstance();
DiTexturePtr textureAsset = assetMgr.GetAsset<DiTexture>(texfile);
if (!textureAsset)
{
textureAsset = DiTexture::GetDefaultTexture();
DI_WARNING("Cannot write the texture(%s), using default texture", texfile.c_str());
}
auto it = mShaderParams[VARIABLE_SAMPLER2D].find(name);
if (it != mShaderParams[VARIABLE_SAMPLER2D].end())
{
DiTexture* tex = textureAsset.get();
DiAny an(tex);
it->second = an;
}
return textureAsset;
}
示例2: WriteTextureCUBE
DiTexturePtr DiShaderParameter::WriteTextureCUBE( const DiString& name,
const DiString& textureName )
{
DiString texfile = textureName;
#if DEMI_PLATFORM == DEMI_PLATFORM_IOS
if(texfile.CheckFileExtension("dds"))
texfile = texfile.ExtractBaseName() + ".pvr";
#endif
DiAssetManager& assetMgr = DiAssetManager::GetInstance();
DiTexturePtr textureAsset = assetMgr.GetAsset<DiTexture>(texfile);
if (!textureAsset)
{
DI_WARNING("Failed to load the textureCUBE resource : %s",texfile.c_str());
return DiTexturePtr();
}
auto it = mShaderParams[VARIABLE_SAMPLERCUBE].find(name);
if (it != mShaderParams[VARIABLE_SAMPLERCUBE].end())
{
DiTexture* tex = textureAsset.get();
DiAny an(tex);
it->second = an;
}
return textureAsset;
}
示例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];
}
}
示例4: LoadConfig
void DiK2Configs::Init()
{
#if DEMI_PLATFORM == DEMI_PLATFORM_WIN32
LoadConfig("ConfigWin32.xml");
#elif DEMI_PLATFORM == DEMI_PLATFORM_OSX
LoadConfig("ConfigOSX.xml");
#else
LoadConfig("ConfigiOS.xml");
#endif
DiString resPath;
if (DiBase::CommandMgr->GetConsoleVar("k2_resource_path"))
{
resPath = DiBase::CommandMgr->GetConsoleVar("k2_resource_path")->GetString();
}
DiString texPath;
if (DiBase::CommandMgr->GetConsoleVar("k2_texture_path"))
{
texPath = DiBase::CommandMgr->GetConsoleVar("k2_texture_path")->GetString();
}
// if zip
if (resPath.CheckFileExtension("zip") || resPath.CheckFileExtension("s2z"))
SetK2ResourcePack(resPath, texPath);
// register the asset type
DiAssetManager::GetInstance().RegisterAssetType(DiK2ModelAsset::TYPE, "", [](const DiString& name){
return make_shared<DiK2ModelAsset>(name);
});
// register the manual loader
DiAssetManager::GetInstance().RegisterManualLoader(DiTexture::TYPE, [&](const DiString& name){
auto ret = DiK2Configs::GetTexture(name);
return ret;
});
}