本文整理汇总了C++中ogre::StringVectorPtr类的典型用法代码示例。如果您正苦于以下问题:C++ StringVectorPtr类的具体用法?C++ StringVectorPtr怎么用?C++ StringVectorPtr使用的例子?那么恭喜您, 这里精选的类代码示例或许可以为您提供帮助。
在下文中一共展示了StringVectorPtr类的19个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于我们的系统推荐出更棒的C++代码示例。
示例1: changeWallpaper
void LoadingScreen::changeWallpaper ()
{
if (mResources.isNull ())
{
mResources = Ogre::StringVectorPtr (new Ogre::StringVector);
Ogre::StringVectorPtr resources = Ogre::ResourceGroupManager::getSingleton ().listResourceNames ("General", false);
for (Ogre::StringVector::const_iterator it = resources->begin(); it != resources->end(); ++it)
{
if (it->size() < 6)
continue;
std::string start = it->substr(0, 6);
boost::to_lower(start);
if (start == "splash")
mResources->push_back (*it);
}
}
if (mResources->size())
{
std::string randomSplash = mResources->at (rand() % mResources->size());
Ogre::TexturePtr tex = Ogre::TextureManager::getSingleton ().load (randomSplash, "General");
mBackgroundImage->setImageTexture (randomSplash);
}
else
std::cerr << "No loading screens found!" << std::endl;
}
开发者ID:timrisi,项目名称:openmw,代码行数:29,代码来源:loadingscreen.cpp
示例2: updateLevels
void MainWindow::updateLevels()
{
try
{
ClientPluginManager& pluginManager = EditorGlobals::mGrid->getActiveServer().getPluginManager();
LevelManager& levelManager = pluginManager.getPlugin<LevelManager>();
ResourceManager& resourceManager = pluginManager.getPlugin<ResourceManager>();
Ogre::StringVectorPtr levels = levelManager.list();
int numListLevels = qMin( levels->size(), (std::size_t)cMaxLevels );
for( int i = 0; i < numListLevels; ++i )
{
Path filePath = resourceManager.getResourcePath() / levels->at( i );
QString file = QString( filePath.string().c_str() );
QString text = tr( "&%1 %2" ).arg( i + 1 ).arg( strippedName( file ) );
mLevelActions[i]->setText( text );
mLevelActions[i]->setData( file );
mLevelActions[i]->setVisible( true );
}
for( int i = numListLevels; i < cMaxLevels; ++i )
mLevelActions[i]->setVisible( false );
}
catch( Exception e )
{
// Ignore error
}
}
开发者ID:Gohla,项目名称:Diversia,代码行数:29,代码来源:MainWindow.cpp
示例3: startRandomTitle
void SoundManager::startRandomTitle()
{
Ogre::StringVector filelist;
if (mMusicFiles.find(mCurrentPlaylist) == mMusicFiles.end())
{
Ogre::StringVector groups = Ogre::ResourceGroupManager::getSingleton().getResourceGroups ();
for (Ogre::StringVector::iterator it = groups.begin(); it != groups.end(); ++it)
{
Ogre::StringVectorPtr resourcesInThisGroup = mResourceMgr.findResourceNames(*it,
"Music/"+mCurrentPlaylist+"/*");
filelist.insert(filelist.end(), resourcesInThisGroup->begin(), resourcesInThisGroup->end());
}
mMusicFiles[mCurrentPlaylist] = filelist;
}
else
filelist = mMusicFiles[mCurrentPlaylist];
if(!filelist.size())
return;
int i = rand()%filelist.size();
// Don't play the same music track twice in a row
if (filelist[i] == mLastPlayedMusic)
{
i = (i+1) % filelist.size();
}
streamMusicFull(filelist[i]);
}
开发者ID:Digmaster,项目名称:openmw,代码行数:30,代码来源:soundmanagerimp.cpp
示例4:
const std::vector<std::string> ModelDefinitionManager::getAllMeshes() const
{
std::vector<std::string> meshes;
Ogre::StringVectorPtr meshesVector = Ogre::ResourceGroupManager::getSingleton().findResourceNames("General", "*.mesh");
for (Ogre::StringVector::iterator I = meshesVector->begin(); I != meshesVector->end(); ++I) {
meshes.push_back(std::string(*I));
}
meshesVector.setNull();
return meshes;
}
开发者ID:PlumInTheLateAfternoonShade,项目名称:ember_gsoc_2013_test,代码行数:10,代码来源:ModelDefinitionManager.cpp
示例5: loadAllMaterialControlFiles
void loadAllMaterialControlFiles(MaterialControlsContainer& controlsContainer)
{
Ogre::StringVectorPtr fileStringVector = Ogre::ResourceGroupManager::getSingleton().findResourceNames( "Popular", "*.controls");
Ogre::StringVector::iterator controlsFileNameIterator = fileStringVector->begin();
while ( controlsFileNameIterator != fileStringVector->end() )
{
loadMaterialControlsFile(controlsContainer, *controlsFileNameIterator);
++controlsFileNameIterator;
}
}
开发者ID:MrLobo,项目名称:El-Rayo-de-Zeus,代码行数:11,代码来源:MaterialControls.cpp
示例6: startRandomTitle
void SoundManager::startRandomTitle()
{
Ogre::StringVectorPtr filelist;
filelist = mResourceMgr.findResourceNames(Ogre::ResourceGroupManager::DEFAULT_RESOURCE_GROUP_NAME,
"Music/"+mCurrentPlaylist+"/*");
if(!filelist->size())
return;
int i = rand()%filelist->size();
streamMusicFull((*filelist)[i]);
}
开发者ID:valistar,项目名称:openmw,代码行数:11,代码来源:soundmanagerimp.cpp
示例7: loadAllFonts
void FontLoader::loadAllFonts(bool exportToFile)
{
Ogre::StringVector groups = Ogre::ResourceGroupManager::getSingleton().getResourceGroups ();
for (Ogre::StringVector::iterator it = groups.begin(); it != groups.end(); ++it)
{
Ogre::StringVectorPtr resourcesInThisGroup = Ogre::ResourceGroupManager::getSingleton ().findResourceNames (*it, "*.fnt");
for (Ogre::StringVector::iterator resource = resourcesInThisGroup->begin(); resource != resourcesInThisGroup->end(); ++resource)
{
loadFont(*resource, exportToFile);
}
}
}
开发者ID:Bodillium,项目名称:openmw,代码行数:12,代码来源:fontloader.cpp
示例8: list
ResourceList ResourceManager::list()
{
ResourceList resourceList;
Ogre::StringVectorPtr resources = mRGM.findResourceNames( mGroup, "*" );
for( Ogre::StringVector::const_iterator i = resources->begin(); i != resources->end(); ++i )
{
resourceList.push_back( Path( *i ) );
}
return resourceList;
}
开发者ID:Gohla,项目名称:Diversia,代码行数:13,代码来源:ResourceManager.cpp
示例9: mBaseDirectory
CSMWorld::Resources::Resources (const std::string& baseDirectory, UniversalId::Type type,
const char * const *extensions)
: mBaseDirectory (baseDirectory), mType (type)
{
int baseSize = mBaseDirectory.size();
Ogre::StringVector resourcesGroups =
Ogre::ResourceGroupManager::getSingleton().getResourceGroups();
for (Ogre::StringVector::iterator iter (resourcesGroups.begin());
iter!=resourcesGroups.end(); ++iter)
{
if (*iter=="General" || *iter=="Internal" || *iter=="Autodetect")
continue;
Ogre::StringVectorPtr resources =
Ogre::ResourceGroupManager::getSingleton().listResourceNames (*iter);
for (Ogre::StringVector::const_iterator iter (resources->begin());
iter!=resources->end(); ++iter)
{
if (static_cast<int> (iter->size())<baseSize+1 ||
iter->substr (0, baseSize)!=mBaseDirectory ||
((*iter)[baseSize]!='/' && (*iter)[baseSize]!='\\'))
continue;
if (extensions)
{
std::string::size_type index = iter->find_last_of ('.');
if (index==std::string::npos)
continue;
std::string extension = iter->substr (index+1);
int i = 0;
for (; extensions[i]; ++i)
if (extensions[i]==extension)
break;
if (!extensions[i])
continue;
}
std::string file = iter->substr (baseSize+1);
mFiles.push_back (file);
mIndex.insert (std::make_pair (file, static_cast<int> (mFiles.size())-1));
}
}
}
开发者ID:Allxere,项目名称:openmw,代码行数:51,代码来源:resources.cpp
示例10: _CreateMeshPanel
bool CMainFrame::_CreateMeshPanel( CImageList& imageList, Ogre::StringVectorPtr& meshNames )
{
if (!m_resourceSelector.Create(WS_CHILD|WS_VISIBLE, CRect(200,100,400,300), this, IDS_ResourceSelector))
return false;
m_resourceSelector.SetOwner(this);
m_resourceSelector.SetIconSize(CSize(MESH_ICON_SIZE, MESH_ICON_SIZE));
CXTPTaskPanelGroup* pGroup = m_resourceSelector.AddGroup(IDS_ResourceSelector_Mesh);
int itemCount = imageList.GetImageCount();
m_resourceSelector.GetImageManager()->SetImageList(imageList.Detach(), 0);
for (int i=0; i<itemCount; ++i)
{
std::wstring meshname(Utility::EngineToUnicode(meshNames->at(i)));
meshname.erase(meshname.length()-5);
// Add folder entries
CXTPTaskPanelGroupItem* pItem = pGroup->AddLinkItem(i, 0);
pItem->SetIconIndex(i);
pItem->SetCaption(meshname.c_str());
}
m_resourceSelector.SetBehaviour(xtpTaskPanelBehaviourList);
m_resourceSelector.SetSelectItemOnFocus(TRUE);
m_resourceSelector.SetMultiColumn(TRUE);
m_resourceSelector.SetColumnWidth(RES_SELECTOR_COLUMN_WIDTH);
m_resourceSelector.GetAt(0)->SetExpanded(TRUE);
//拖拽支持
m_resourceSelector.AllowDrag(xtpTaskItemAllowDragCopyOutsideControl);
return true;
}
开发者ID:mavaL,项目名称:MiniCraft,代码行数:32,代码来源:MainFrm.cpp
示例11: startRandomTitle
void SoundManager::startRandomTitle()
{
Ogre::StringVector filelist;
Ogre::StringVector groups = Ogre::ResourceGroupManager::getSingleton().getResourceGroups ();
for (Ogre::StringVector::iterator it = groups.begin(); it != groups.end(); ++it)
{
Ogre::StringVectorPtr resourcesInThisGroup = mResourceMgr.findResourceNames(*it,
"Music/"+mCurrentPlaylist+"/*");
filelist.insert(filelist.end(), resourcesInThisGroup->begin(), resourcesInThisGroup->end());
}
if(!filelist.size())
return;
int i = rand()%filelist.size();
streamMusicFull(filelist[i]);
}
开发者ID:Adrian-Revk,项目名称:openmw,代码行数:18,代码来源:soundmanagerimp.cpp
示例12: while
//-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~
void
ResourceService::getResourceNames(I_ResourceNameVisitor& _visitor,
const std::string& _group,
const std::string& _pattern) const
{
_visitor.begin();
Ogre::StringVectorPtr pStringVector =
m_groupManager.findResourceNames(_group, _pattern);
Ogre::StringVector::iterator iter = pStringVector->begin();
while (iter != pStringVector->end())
{
_visitor.visit(*iter);
iter++;
}
_visitor.end();
}
开发者ID:SgtFlame,项目名称:indiezen,代码行数:20,代码来源:ResourceService.cpp
示例13: changeWallpaper
void LoadingScreen::changeWallpaper ()
{
std::vector<std::string> splash;
Ogre::StringVectorPtr resources = Ogre::ResourceGroupManager::getSingleton ().listResourceNames ("General", false);
for (Ogre::StringVector::const_iterator it = resources->begin(); it != resources->end(); ++it)
{
if (it->size() < 6)
continue;
std::string start = it->substr(0, 6);
boost::to_lower(start);
if (start == "splash")
splash.push_back (*it);
}
std::string randomSplash = splash[rand() % splash.size()];
Ogre::TexturePtr tex = Ogre::TextureManager::getSingleton ().load (randomSplash, "General");
mBackgroundImage->setImageTexture (randomSplash);
}
开发者ID:Gohan1989,项目名称:openmw,代码行数:20,代码来源:loadingscreen.cpp
示例14: DestroyAssetGroup
void ResourceManager::DestroyAssetGroup(const String& GroupName)
{
for( std::vector<String>::iterator it = ResourceGroups.begin() ; it != ResourceGroups.end() ; it++ )
{
if(GroupName == (*it))
{
ResourceGroups.erase(it);
break;
}
}
/// @todo This is a bit of a hack, but needs to be here until we can upgrade our resource system.
Ogre::StringVectorPtr ResourceNames = this->OgreResource->listResourceNames(GroupName,false);
for( Whole X = 0 ; X < ResourceNames->size() ; ++X )
{
if(ResourceNames->at(X).find(".mesh"))
{
MeshManager::GetSingletonPtr()->UnloadMesh(ResourceNames->at(X));
}
}
this->OgreResource->destroyResourceGroup(GroupName);
}
开发者ID:zester,项目名称:Mezzanine,代码行数:21,代码来源:resourcemanager.cpp
示例15: getResourceGroupFileNames
//----------------------------------------------------------------------------//
size_t OgreResourceProvider::getResourceGroupFileNames(
std::vector<String>& out_vec, const String& file_pattern,
const String& resource_group)
{
// get list of files in the group that match the pattern.
Ogre::StringVectorPtr vp =
Ogre::ResourceGroupManager::getSingleton().findResourceNames(
(resource_group.empty() ?
d_defaultResourceGroup.c_str() :
resource_group.c_str()),
file_pattern.c_str());
size_t entries = 0;
Ogre::StringVector::iterator i = vp->begin();
for (; i != vp->end(); ++i)
{
out_vec.push_back(i->c_str());
++entries;
}
return entries;
}
开发者ID:Ketzer2002,项目名称:meridian59-engine,代码行数:23,代码来源:ResourceProvider.cpp
示例16: LoadAll
void aiBehaviorTreeTemplateManager::LoadAll()
{
Ogre::StringVectorPtr loc = Ogre::ResourceGroupManager::getSingleton().findResourceLocation("BehaviorTemplate", "*Behaviors");
const STRING filename = loc->at(0) + "\\Script\\";
//加载全局黑板xml
Ogre::DataStreamPtr stream = Ogre::ResourceGroupManager::getSingleton().openResource("RaceGlobal.xml", "BehaviorTemplate");
char* szData = strdup(stream->getAsString().c_str());
rapidxml::xml_document<> XMLDoc;
XMLDoc.parse<0>(szData);
rapidxml::xml_node<>* pNode = XMLDoc.first_node("Root")->first_node("BlackBoard");
while(pNode)
{
const STRING raceName = pNode->first_attribute("race")->value();
rapidxml::xml_node<>* pVarNode = pNode->first_node("Variable");
eGameRace race;
if(raceName == "Terran") race = eGameRace_Terran;
else if(raceName == "Zerg") race = eGameRace_Zerg;
else assert(0);
aiBlackBoard* bb = new aiBlackBoard;
bb->LoadParams(pVarNode);
m_globalBBs.insert(std::make_pair(race, bb));
//脚本
const char* szFilename = XMLDoc.first_node("Root")->first_node("Script")->first_attribute("filename")->value();
const STRING filepath = filename + szFilename;
SCRIPTNAMAGER.DoFile(filepath);
pNode = pNode->next_sibling("BlackBoard");
}
free(szData);
XMLDoc.clear();
//加载各单位行为树xml
Ogre::StringVectorPtr files = Ogre::ResourceGroupManager::getSingleton().findResourceNames("BehaviorTemplate", "*.xml");
auto iter = std::find(files->begin(), files->end(), "RaceGlobal.xml");
files->erase(iter);
for (auto iter=files->begin(); iter!=files->end(); ++iter)
{
aiBehaviorTreeTemplate* pTmpl = new aiBehaviorTreeTemplate;
const STRING name = pTmpl->Load(*iter);
m_bts.insert(std::make_pair(name, pTmpl));
}
}
开发者ID:wangxun159123,项目名称:MiniCraft,代码行数:49,代码来源:BehaviorTreeTemplateManager.cpp
示例17: changeWallpaper
void LoadingScreen::changeWallpaper ()
{
if (mResources.empty())
{
Ogre::StringVector groups = Ogre::ResourceGroupManager::getSingleton().getResourceGroups ();
for (Ogre::StringVector::iterator it = groups.begin(); it != groups.end(); ++it)
{
Ogre::StringVectorPtr resourcesInThisGroup = Ogre::ResourceGroupManager::getSingleton ().findResourceNames (*it, "Splash_*.tga");
mResources.insert(mResources.end(), resourcesInThisGroup->begin(), resourcesInThisGroup->end());
}
}
if (!mResources.empty())
{
std::string const & randomSplash = mResources.at (rand() % mResources.size());
Ogre::TexturePtr tex = Ogre::TextureManager::getSingleton ().load (randomSplash, Ogre::ResourceGroupManager::AUTODETECT_RESOURCE_GROUP_NAME);
mBackgroundImage->setImageTexture (randomSplash);
}
else
std::cerr << "No loading screens found!" << std::endl;
}
开发者ID:Adrian-Revk,项目名称:openmw,代码行数:23,代码来源:loadingscreen.cpp
示例18: Initial
//.........这里部分代码省略.........
m_pPostFilterManager->createPostFilter("Bloom", m_pFairySystem->getViewport());
m_pPostFilterManager->createPostFilter("HeatVision", m_pFairySystem->getViewport());
m_pPostFilterManager->createPostFilter("Fade", m_pFairySystem->getViewport());
m_pPostFilterManager->createPostFilter("MotionBlur", m_pFairySystem->getViewport());
//--------------------------------------------
// 设置特效系统的声音播放函数
Fairy::LogicModel::SetPlaySoundFuncton((OnPlaySound)(g_pSoundSystem->GetPlaySoundFunc()));
Fairy::LogicModel::SetStopSoundFunction((OnStopSound)(g_pSoundSystem->GetStopSoundFunc()));
Fairy::BulletSystem::SetPlaySoundFuncton((OnPlaySound)(g_pSoundSystem->GetPlaySoundFunc()));
Fairy::BulletSystem::SetStopSoundFunction((OnStopSound)(g_pSoundSystem->GetStopSoundFunc()));
Fairy::LogicModel::SetGetHeightInWorldListener((GetHeightInWorld)(g_pWorldSystem->GetTerrainHeightFunc()));
// 初始化 fake obeject manager
m_pFakeObjectManager = new CFakeObjectEntityManager;
m_pFakeObjectManager->Initial();
// Fairy::Effect::setDefaultIterativeInterval(0.01f);
Ogre::ParticleSystem::setDefaultIterationInterval(0.033f);
// 系统设置接口挂接变量控制系统
g_pEventSys->RegisterEventHandle("VARIABLE_CHANGED",_OnVariableChangedEvent);
// 恢复上次颜色设置
g_pEventSys->PushEvent(GE_VARIABLE_CHANGED, sz32BitTexturesVar, g_pVaribleSys->GetAs_String(sz32BitTexturesVar).c_str());
// Ogre::TextureManager::getSingleton().setDefaultNumMipmaps( 1 );
// 加载人物阴影配置
BOOL bHave;
INT nHumanLightmap = g_pVaribleSys->GetAs_Float(szShadowTechniqueVar, &bHave );
if( bHave )
Scene_SetShadowTechnique( (BOOL)nHumanLightmap );
// 加载全局泛光配置
INT nFullScreenLight = g_pVaribleSys->GetAs_Float( szPostFilterEnabledVar, &bHave );
if( bHave )
Scene_SetPostFilterEnabled( (BOOL)nFullScreenLight );
//初始化小地图探灯功能
m_pMapLight = new CUIMapLight;
m_pMapLight->Initial();
}
catch(const Ogre::Exception& e)
{
BOOL rethrow = TRUE;
if (e.getNumber() == Ogre::Exception::ERR_DUPLICATE_ITEM)
{
if (e.getSource() == "ResourceManager::add")
{
if (Ogre::StringUtil::endsWith(listener._scriptName, ".material", TRUE))
{
char materialName[256];
if (sscanf(e.getDescription().c_str(), "Resource with the name %255s already exists.", materialName) == 1)
{
Ogre::MaterialPtr material = Ogre::MaterialManager::getSingleton().getByName(materialName);
if (!material.isNull())
{
char message[1024];
Ogre::StringVectorPtr currentNames = Fairy::findResourceFilenames(listener._groupName, listener._scriptName);
const Ogre::String& currentName = currentNames.isNull() || currentNames->empty() ? listener._scriptName : currentNames->front();
if (material->getOrigin().empty())
{
_snprintf(message, 1024,
("Predefined material \"%s\" duplicated in file \"%s\", the application will exit."),
material->getName().c_str(), currentName.c_str());
}
else
{
Ogre::StringVectorPtr originNames = Fairy::findResourceFilenames(material->getGroup(), material->getOrigin());
const Ogre::String& originName = originNames.isNull() || originNames->empty() ? material->getOrigin() : originNames->front();
if (currentName == originName)
{
_snprintf(message, 1024,
("The material \"%s\" occuring in the file \"%s\" more than once, the application will exit."),
material->getName().c_str(), currentName.c_str());
}
else
{
_snprintf(message, 1024,
("Duplicate material \"%s\" in files \"%s\" and \"%s\", the application will exit."),
material->getName().c_str(), currentName.c_str(), originName.c_str());
}
}
KLThrow("Ogre::%s", message);
}
}
}
}
}
throw;
}
}
开发者ID:jjiezheng,项目名称:pap_full,代码行数:101,代码来源:EngineInterface.cpp
示例19: Initial
//.........这里部分代码省略.........
FLOAT fCamera_MaxDistance = g_pVaribleSys->GetAs_Float("Camera_MaxDistance", &bHave);
if(bHave) CCamera_Scene::MAX_DISTANCE = fCamera_MaxDistance;
FLOAT fCamera_Pitch = g_pVaribleSys->GetAs_Float("Camera_Pitch", &bHave);
if(bHave) CCamera_Scene::STATIC_PITCH = -fCamera_Pitch*TDU_PI/180.0f;
}
m_pCamera_CharView = new CCamera_CharSel(m_pRenderSystem->getCamera());
m_pCamera_Scene = new CCamera_Scene(m_pRenderSystem->getCamera());
m_pCamera_Scene->SetDistance(CCamera_Scene::MAX_DISTANCE);
m_pCamera_Current = m_pCamera_CharView;
//--------------------------------------------
//初始化PostFilter系统
m_pPostFilterManager = m_pRenderSystem->getPostFilterManager();
//注册所有全局渲染器
WX::registerAllPostFilterFactories(m_pPostFilterManager);
m_pPostFilterManager->createPostFilter("Floodlighting", m_pRenderSystem->getViewport());
// m_pPostFilterManager->createPostFilter("Bloom", m_pRenderSystem->getViewport());
// m_pPostFilterManager->createPostFilter("HeatVision", m_pRenderSystem->getViewport());
m_pPostFilterManager->createPostFilter("Fade", m_pRenderSystem->getViewport());
//--------------------------------------------
//设置特效系统的声音播放函数
WX::LogicModel::SetPlaySoundFuncton((OnPlaySound)(g_pSoundSystem->GetPlaySoundFunc()));
WX::LogicModel::SetStopSoundFunction((OnStopSound)(g_pSoundSystem->GetStopSoundFunc()));
WX::LogicModel::SetGetHeightInWorldListener((GetHeightInWorld)(g_pWorldSystem->GetTerrainHeightFunc()));
// 初始化 fake obeject manager
m_pFakeObjectManager = new CFakeObjectManager;
m_pFakeObjectManager->Initial();
// WX::Effect::setDefaultIterativeInterval(0.01f);
Ogre::ParticleSystem::setDefaultIterationInterval(0.033f);
//系统设置接口挂接变量控制系统
g_pEventSys->RegisterEventHandle("VARIABLE_CHANGED",_OnVariableChangedEvent);
//恢复上次颜色设置
g_pEventSys->PushEvent(
GE_VARIABLE_CHANGED,
sz32BitTexturesVar,
g_pVaribleSys->GetAs_String(sz32BitTexturesVar).c_str());
}
catch(const Ogre::Exception& e)
{
BOOL rethrow = TRUE;
if (e.getNumber() == Ogre::Exception::ERR_DUPLICATE_ITEM)
{
if (e.getSource() == "ResourceManager::add")
{
if (Ogre::StringUtil::endsWith(listener._scriptName, ".material", TRUE))
{
char materialName[256];
if (sscanf(e.getDescription().c_str(), "Resource with the name %255s already exists.", materialName) == 1)
{
Ogre::MaterialPtr material = Ogre::MaterialManager::getSingleton().getByName(materialName);
if (!material.isNull())
{
char message[1024];
Ogre::StringVectorPtr currentNames = WX::findResourceFilenames(listener._groupName, listener._scriptName);
const Ogre::String& currentName = currentNames.isNull() || currentNames->empty() ? listener._scriptName : currentNames->front();
if (material->getOrigin().empty())
{
_snprintf(message, 1024,
("Predefined material \"%s\" duplicated in file \"%s\", the application will exit."),
material->getName().c_str(), currentName.c_str());
}
else
{
Ogre::StringVectorPtr originNames = WX::findResourceFilenames(material->getGroup(), material->getOrigin());
const Ogre::String& originName = originNames.isNull() || originNames->empty() ? material->getOrigin() : originNames->front();
if (currentName == originName)
{
_snprintf(message, 1024,
("The material \"%s\" occuring in the file \"%s\" more than once, the application will exit."),
material->getName().c_str(), currentName.c_str());
}
else
{
_snprintf(message, 1024,
("Duplicate material \"%s\" in files \"%s\" and \"%s\", the application will exit."),
material->getName().c_str(), currentName.c_str(), originName.c_str());
}
}
TDThrow("Ogre::%s", message);
}
}
}
}
}
throw;
}
}
开发者ID:brock7,项目名称:TianLong,代码行数:101,代码来源:RenderSystem.cpp
注:本文中的ogre::StringVectorPtr类示例由纯净天空整理自Github/MSDocs等源码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。 |
请发表评论