本文整理汇总了C++中ogre::configfile::SectionIterator::peekNextKey方法的典型用法代码示例。如果您正苦于以下问题:C++ SectionIterator::peekNextKey方法的具体用法?C++ SectionIterator::peekNextKey怎么用?C++ SectionIterator::peekNextKey使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类ogre::configfile::SectionIterator
的用法示例。
在下文中一共展示了SectionIterator::peekNextKey方法的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。
示例1: loadResources
void OgreWidget::loadResources()
{
qDebug() << "OgreWidget::loadResources()";
// Load resource paths from config file
Ogre::ConfigFile cf;
cf.load("resources.cfg");
// Go through all sections & settings in the file
Ogre::ConfigFile::SectionIterator seci = cf.getSectionIterator();
Ogre::String secName, typeName, archName;
while (seci.hasMoreElements())
{
secName = seci.peekNextKey();
Ogre::ConfigFile::SettingsMultiMap *settings = seci.getNext();
Ogre::ConfigFile::SettingsMultiMap::iterator i;
for (i = settings->begin(); i != settings->end(); ++i)
{
typeName = i->first;
archName = i->second;
Ogre::ResourceGroupManager::getSingleton().addResourceLocation(archName, typeName, secName);
}
}
// Initialise, parse scripts etc
Ogre::ResourceGroupManager::getSingleton().initialiseAllResourceGroups();
qDebug() << "OgreWidget::loadResources(): done.";
}
示例2: locateResources
void CEditor::locateResources()
{
// load resource paths from config file
Ogre::ConfigFile cf;
cf.load( "resources_d.cfg" );
Ogre::ConfigFile::SectionIterator seci = cf.getSectionIterator();
Ogre::String sec, type, arch;
// go through all specified resource groups
while (seci.hasMoreElements())
{
sec = seci.peekNextKey();
Ogre::ConfigFile::SettingsMultiMap* settings = seci.getNext();
Ogre::ConfigFile::SettingsMultiMap::iterator i;
// go through all resource paths
for (i = settings->begin(); i != settings->end(); i++)
{
type = i->first;
arch = i->second;
Ogre::ResourceGroupManager::getSingleton().addResourceLocation(arch, type, sec);
}
}
}
示例3: setupResources
//-------------------------------------------------------------------------------------
void BaseApplication::setupResources(void)
{
// Load resource paths from config file
Ogre::ConfigFile cf;
cf.load(mResourcesCfg);
// Go through all sections & settings in the file
Ogre::ConfigFile::SectionIterator seci = cf.getSectionIterator();
Ogre::String secName, typeName, archName;
while (seci.hasMoreElements())
{
secName = seci.peekNextKey();
Ogre::ConfigFile::SettingsMultiMap *settings = seci.getNext();
Ogre::ConfigFile::SettingsMultiMap::iterator i;
for (i = settings->begin(); i != settings->end(); ++i)
{
typeName = i->first;
archName = i->second;
std::cerr << "Ogre::ResourceGroupManager::getSingleton().addResourceLocation(" << archName << ", " << typeName << ", " << secName << ")" << std::endl;
Ogre::ResourceGroupManager::getSingleton().addResourceLocation(
archName, typeName, secName);
}
}
}
示例4: while
void Ogre3DApplication::setup_resources ()
{
Ogre::String sec_name, type_name, arch_name;
Ogre::ConfigFile cf;
#ifdef Q_WS_WIN
cf.load ("resources_win.cfg");
#elif defined Q_WS_X11
cf.load ("resources.cfg");
#endif
Ogre::ConfigFile::SectionIterator seci = cf.getSectionIterator();
while (seci.hasMoreElements())
{
sec_name = seci.peekNextKey();
Ogre::ConfigFile::SettingsMultiMap *settings = seci.getNext();
Ogre::ConfigFile::SettingsMultiMap::iterator i;
for (i = settings->begin(); i != settings->end(); ++i)
{
type_name = i->first;
arch_name = i->second;
Ogre::ResourceGroupManager::getSingleton().
addResourceLocation (arch_name, type_name, sec_name);
}
}
}
示例5:
void HOO::Application::loadResources(){
Ogre::ConfigFile cf;
cf.load(mResourcesCfg);
Ogre::ConfigFile::SectionIterator sectionIter = cf.getSectionIterator();
Ogre::String sectionName, typeName, dataname;
while (sectionIter.hasMoreElements())
{
sectionName = sectionIter.peekNextKey();
Ogre::ConfigFile::SettingsMultiMap *settings = sectionIter.getNext();
Ogre::ConfigFile::SettingsMultiMap::iterator i;
for (i = settings->begin(); i != settings->end(); ++i)
{
typeName = i->first;
dataname = i->second;
Ogre::ResourceGroupManager::getSingleton().addResourceLocation(
dataname, typeName, sectionName);
}
}
HOO::ResourceListener* listener = new HOO::ResourceListener();
Ogre::ResourceGroupManager::getSingleton().addResourceGroupListener(listener);
Ogre::ResourceGroupManager::getSingleton().initialiseAllResourceGroups();
}
示例6: setupResources
//-------------------------------------------------------------------------------------
void THIS::setupResources(void)
{
cout << "<TRACE><LOG><SceneManager><setupResources> " << endl;
// Load resource paths from config file
Ogre::ConfigFile cf;
cf.load(mResourcesCfg);
// Go through all sections & settings in the file
Ogre::ConfigFile::SectionIterator seci = cf.getSectionIterator();
Ogre::String secName, typeName, archName;
while (seci.hasMoreElements())
{
secName = seci.peekNextKey();
Ogre::ConfigFile::SettingsMultiMap *settings = seci.getNext();
Ogre::ConfigFile::SettingsMultiMap::iterator i;
for (i = settings->begin(); i != settings->end(); ++i)
{
typeName = i->first;
archName = i->second;
Ogre::ResourceGroupManager::getSingleton().addResourceLocation(
archName, typeName, secName);
}
}
}
示例7: go
void MyConfig::go(void)
{
m_ConfigFile.load("aWorldOpts.cfg"); //todo is this location ok?
Ogre::ConfigFile::SectionIterator seci = m_ConfigFile.getSectionIterator();
Ogre::String sectionName;
Ogre::String keyName;
Ogre::String valueName;
while (seci.hasMoreElements())
{
sectionName = seci.peekNextKey();
Ogre::ConfigFile::SettingsMultiMap *settings = seci.getNext();
Ogre::ConfigFile::SettingsMultiMap::iterator i;
for (i = settings->begin(); i != settings->end(); ++i)
{
keyName = i->first;
valueName = i->second;
m_Configs.insert(std::pair<std::string, std::string>(sectionName + "/" + keyName, valueName));
// Debug - todo
// Ogre::String msg2 ="m_Configs: " + m_Configs[sectionName+"/"+keyName];
// Ogre::LogManager::getSingletonPtr()->logMessage(msg2);
}
}
}
示例8: setupResources
void TrackerRenderer::setupResources(void) {
// Load resource paths from config file
Ogre::ConfigFile cf;
cf.load(mResourcesCfg);
std::string package_path =
ros::package::getPath(ROS_PACKAGE_NAME) + +"/ogre_media/";
// Go through all sections & settings in the file
Ogre::ConfigFile::SectionIterator seci = cf.getSectionIterator();
Ogre::String secName, typeName, archName;
while (seci.hasMoreElements()) {
secName = seci.peekNextKey();
Ogre::ConfigFile::SettingsMultiMap* settings = seci.getNext();
Ogre::ConfigFile::SettingsMultiMap::iterator i;
for (i = settings->begin(); i != settings->end(); ++i) {
typeName = i->first;
archName = i->second;
archName = package_path + archName;
Ogre::ResourceGroupManager::getSingleton().addResourceLocation(
archName, typeName, secName);
}
}
}
示例9: Load
void CSamples::Load()
{
Ogre::ConfigFile cf;
#ifdef _DEBUG
cf.load("samples_d.cfg");
#else
cf.load("samples.cfg");
#endif
Ogre::ConfigFile::SectionIterator seci = cf.getSectionIterator();
Ogre::String secName, typeName, archName;
while (seci.hasMoreElements())
{
secName = seci.peekNextKey();
Ogre::ConfigFile::SettingsMultiMap *settings = seci.getNext();
for (Ogre::ConfigFile::SettingsMultiMap::iterator i = settings->begin(); i != settings->end(); ++i)
{
if (i->first == "StartSample")
{
m_app = GetSampleObject(i->second);
if (m_app != 0)
{
RunStartSample();
}
}
}
}
}
示例10: preloadResources
void GameManager::preloadResources()
{
/* Load resource paths from config file */
Ogre::ConfigFile cf;
cf.load("resources.cfg");
/* go through all settings in the file */
Ogre::ConfigFile::SectionIterator itSection = cf.getSectionIterator();
Ogre::String sSection, sType, sArch;
while(itSection.hasMoreElements())
{
sSection = itSection.peekNextKey();
Ogre::ConfigFile::SettingsMultiMap *mapSettings = itSection.getNext();
Ogre::ConfigFile::SettingsMultiMap::iterator itSetting = mapSettings->begin();
while(itSetting != mapSettings->end())
{
sType = itSetting->first;
sArch = itSetting->second;
mRoot->addResourceLocation(sArch, sType, sSection);
++itSetting;
}
}
/* Initialise resources */
Ogre::ResourceGroupManager::getSingleton().initialiseAllResourceGroups();
}
示例11: SetupResources
bool GameApp::SetupResources()
{
// load resources
Ogre::String secName, typeName, archName;
Ogre::ConfigFile cf;
cf.load("resources_d.cfg");
Ogre::ConfigFile::SectionIterator seci = cf.getSectionIterator();
while (seci.hasMoreElements())
{
secName = seci.peekNextKey();
Ogre::ConfigFile::SettingsMultiMap* settings = seci.getNext();
Ogre::ConfigFile::SettingsMultiMap::iterator i;
for (i = settings->begin(); i != settings->end(); ++i)
{
typeName = i->first;
archName = i->second;
Ogre::ResourceGroupManager::getSingleton().addResourceLocation(archName, typeName, secName);
}
}
Ogre::TextureManager::getSingleton().setDefaultNumMipmaps(5);
Ogre::ResourceGroupManager::getSingleton().initialiseAllResourceGroups();
return true;
}
示例12: LoadResourceFile
//------------------------------------------------------------------------------
bool wxOgreResources::LoadResourceFile(const Ogre::String& file)
{
Ogre::ConfigFile cf;
cf.load(file);
Ogre::ConfigFile::SectionIterator it = cf.getSectionIterator();
Ogre::String location, type, group;
while (it.hasMoreElements()) {
group = it.peekNextKey();
Ogre::ConfigFile::SettingsMultiMap *settings = it.getNext();
Ogre::ConfigFile::SettingsMultiMap::iterator i;
for (i = settings->begin(); i != settings->end(); ++i) {
type = i->first;
location = i->second;
try {
m_rmgr->addResourceLocation(location, type, group);
} catch (Ogre::Exception& e) {
wxOgreExceptionBox(e);
return false;
}
}
}
return true;
}
示例13: LoadResources
KBOOL AppFrame::LoadResources()
{
// Load resource paths from config file
Ogre::ConfigFile cf;
cf.load("resources.cfg");
// Go through all sections & settings in the file
Ogre::ConfigFile::SectionIterator seci = cf.getSectionIterator();
Ogre::String secName, typeName, archName;
while (seci.hasMoreElements())
{
secName = seci.peekNextKey();
Ogre::ConfigFile::SettingsMultiMap *settings = seci.getNext();
Ogre::ConfigFile::SettingsMultiMap::iterator i;
for (i = settings->begin(); i != settings->end(); ++i)
{
typeName = i->first;
archName = i->second;
Ogre::ResourceGroupManager::getSingleton().addResourceLocation(
archName, typeName, secName);
}
}
return true;
示例14: setupOgreResources
void CServer::setupOgreResources()
{
//////////////////
// OGRE //
//////////////////
// Carga las rutas de los recursos desde el archivo de configuración
Ogre::ConfigFile cf;
cf.load("resources.cfg");
// Examina todos los ajustes en el archivo
Ogre::ConfigFile::SectionIterator itSection = cf.getSectionIterator();
std::string sSection, sType, sArch;
while(itSection.hasMoreElements())
{
sSection = itSection.peekNextKey();
Ogre::ConfigFile::SettingsMultiMap *mapSettings = itSection.getNext();
Ogre::ConfigFile::SettingsMultiMap::const_iterator itSetting = mapSettings->begin();
while(itSetting != mapSettings->end())
{
sType = itSetting->first;
sArch = itSetting->second;
Ogre::ResourceGroupManager::getSingleton().
addResourceLocation(sArch, sType, sSection);
++itSetting;
}
}
} // setupResources
示例15: setupResources
void OgreEngine::setupResources(void)
{
// Load resource paths from config file
Ogre::ConfigFile cf;
cf.load(m_resources_cfg);
// Go through all sections & settings in the file
Ogre::ConfigFile::SectionIterator seci = cf.getSectionIterator();
Ogre::String secName, typeName, archName;
while (seci.hasMoreElements())
{
secName = seci.peekNextKey();
Ogre::ConfigFile::SettingsMultiMap *settings = seci.getNext();
Ogre::ConfigFile::SettingsMultiMap::iterator i;
for (i = settings->begin(); i != settings->end(); ++i)
{
typeName = i->first;
archName = i->second;
Ogre::ResourceGroupManager::getSingleton().addResourceLocation(
archName, typeName, secName);
}
}
Ogre::ResourceGroupManager::getSingleton().initialiseAllResourceGroups();
}