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


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

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


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

示例1:

 void DiEditorManager::SetK2ResourcePack(const DiString& resPack, const DiString& texturePack)
 {
     if (texturePack.empty())
         DiK2Configs::SetK2ResourcePack(resPack);
     else
         DiK2Configs::SetK2ResourcePack(resPack, texturePack);
 }
开发者ID:wangyanxing,项目名称:Demi3D,代码行数:7,代码来源:EditorManager.cpp

示例2: SetResourceLocation

 void HonFxerApp::SetResourceLocation(const DiString& resPack, const DiString& texPack)
 {
     if (!texPack.empty())
         DiEditorManager::Get()->SetK2ResourcePack(resPack, texPack);
     else
         DiEditorManager::Get()->SetK2ResourcePack(resPack);
 }
开发者ID:wangyanxing,项目名称:Demi3D,代码行数:7,代码来源:HonFxerApp.cpp

示例3: SetCurrentFileName

 void DiEditorManager::SetCurrentFileName(const DiString& name)
 {
     mFxFileName = name;
     
     DiString title = "Hon Fxer";
     if(!name.empty())
         title.Format("Hon Fxer - %s",name.ExtractFileName().c_str());
     
     DiBase::Driver->GetMainRenderWindow()->GetWindow()->SetTitle(title.c_str());
 }
开发者ID:wangyanxing,项目名称:Demi3D,代码行数:10,代码来源:EditorManager.cpp

示例4: RemoveAdditPoseBlender

void DiAnimationPose::RemoveAdditPoseBlender( const DiString& strAdditAni )
{
    if(strAdditAni.empty())
    {
        return ;
    }

    AniBlenderMap::iterator itAdditBlender = mMapAdditBlenders.find(strAdditAni);
    if(itAdditBlender == mMapAdditBlenders.end())
    {
        DI_WARNING("Cannot find and delete the animation %s", strAdditAni.c_str());
        return;
    }

    DiClipController * pkClip = mClipSet->GetClipController(strAdditAni);
    pkClip->SetTimeRatio(1.0f);
    mMapAdditBlenders.erase(itAdditBlender);
    pkClip->SetWeight(1.0f);

}
开发者ID:zxy2845986,项目名称:Demi3D,代码行数:20,代码来源:AnimationPose.cpp

示例5: InitConsoleLogger

    void DiCommandManager::InitConsoleLogger(bool createWnd, const DiString& consoleFile)
    {
        if (!sConsoleLogger)
        {
            if (consoleFile.empty())
                sConsoleLogger = DI_NEW DiConsoleLogger(createWnd);
            else
                sConsoleLogger = DI_NEW DiConsoleLogger(createWnd, consoleFile);

            sConsoleLogger->OutputLog("Init console window", "", "", 0);
            DiLogManager::GetInstance().RegisterLogger(sConsoleLogger);

            DI_INFO("New external console window created");
        }
        else
        {
            if (createWnd)
            {
                sConsoleLogger->CreateConsoleWindow();
            }
        }
    }
开发者ID:wangyanxing,项目名称:Demi3D,代码行数:22,代码来源:Command.cpp

示例6: RenameAnimation

    bool DiMotion::RenameAnimation( const DiString& name,const DiString& strNewName )
    {
        if(strNewName.empty())
        {
            DI_WARNING("Empty name will not be accepted");
            return false;
        }

        AnimationList::iterator it = mAnimationList.find(name);
        if(it != mAnimationList.end())
        {
            DiAnimation * pkAnim = (*it).second;
            mAnimationList.erase(name);

            pkAnim->SetName(strNewName);
            mAnimationList[strNewName] = pkAnim;

            return true;
        }

        DI_WARNING("Cannot locate the animation: %s",name.c_str());
        return false;
    }
开发者ID:wangyanxing,项目名称:Demi3D,代码行数:23,代码来源:Motion.cpp

示例7: GetDefaultTexture

    DiTexturePtr DiK2Configs::GetTexture(const DiString& relPath)
    {
        DiString baseName = relPath.ExtractFileName();
        if (baseName.empty() || baseName[0] == '$')
            return DiK2Configs::GetSpecialTexture(baseName);

        DiTexturePtr ret = DiAssetManager::GetInstance().FindAsset<DiTexture>(relPath);
        if (ret)
            return ret;
        
        bool needprefix = !TEXTURE_PACK_PREFIX_FOLDER.empty();
        if(DiString::StartsWith(relPath, TEXTURE_PACK_PREFIX_FOLDER))
        {
            needprefix = false;
        }

        DiString full = GetK2MediaPath(relPath, true);
        if(full.empty())
        {
            DI_WARNING("Empty texture file!, using default texture instead");
            return DiTexture::GetDefaultTexture();
        }
        
#if 0
        if (TEXTURE_PACK && full[0] != '\\' && full[0] != '/')
        {
            full = "/"+full;
        }
#endif

        DiString tgaExt = ".tga";
#if DEMI_PLATFORM == DEMI_PLATFORM_IOS
        DiString compExt = ".pvr";
#else
        DiString compExt = ".dds";
#endif

        DiString tgaFile = full + tgaExt;
        DiString ddsFile = full + compExt;
        bool useTga = false;

        if (TEXTURE_PACK)
        {
            DiDataStreamPtr data;
            
            /// TODO read the descriptor file
            if(needprefix)
            {
                tgaFile = DiK2Configs::TEXTURE_PACK_PREFIX_FOLDER + tgaFile;
                ddsFile = DiK2Configs::TEXTURE_PACK_PREFIX_FOLDER + ddsFile;
            }

            if (TEXTURE_PACK->HasFile(ddsFile))
                data = TEXTURE_PACK->Open(ddsFile);
            else
            {
                data = TEXTURE_PACK->Open(tgaFile);
                useTga = true;
            }

            if (!data)
            {
                DI_WARNING("Cannot open the texture file: %s, using default texture", ddsFile.c_str());
                return DiTexture::GetDefaultTexture();
            }

#ifdef _K2_RECORD_USED_RESOURCE
            sUsedResources.insert(relPath + (useTga ? tgaExt : compExt));
#endif
            ret = DiAssetManager::GetInstance().CreateOrReplaceAsset<DiTexture>(relPath);
            ret->Load(data);
            return ret;
        }
        else
        {
            FILE* fp = nullptr;

            // try dds
            fp = fopen(ddsFile.c_str(), "rb");

            // try tga
            if (!fp)
            {
                fp = fopen(tgaFile.c_str(), "rb");
                useTga = true;
            }

            if (!fp)
            {
                DI_WARNING("Cannot open the texture file: %s, using default texture", ddsFile.c_str());
                return DiTexture::GetDefaultTexture();
            }

#ifdef _K2_RECORD_USED_RESOURCE
            sUsedResources.insert(relPath + (useTga ? tgaExt : compExt));
#endif
            DiDataStreamPtr texData(DI_NEW DiFileHandleDataStream(relPath, fp));

            ret = DiAssetManager::GetInstance().CreateOrReplaceAsset<DiTexture>(relPath);
            ret->Load(texData);
//.........这里部分代码省略.........
开发者ID:wangyanxing,项目名称:Demi3D,代码行数:101,代码来源:K2Configs.cpp


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