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


C++ DiString::CheckFileExtension方法代码示例

本文整理汇总了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;
    }
开发者ID:wangyanxing,项目名称:Demi3D,代码行数:29,代码来源:ShaderParam.cpp

示例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;
    }
开发者ID:wangyanxing,项目名称:Demi3D,代码行数:27,代码来源:ShaderParam.cpp

示例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];
	}
}
开发者ID:wangyanxing,项目名称:Demi3D,代码行数:22,代码来源:main.cpp

示例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;
        });
    }
开发者ID:wangyanxing,项目名称:Demi3D,代码行数:37,代码来源:K2Configs.cpp


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