本文整理汇总了C++中ogre::configfile::SectionIterator类的典型用法代码示例。如果您正苦于以下问题:C++ SectionIterator类的具体用法?C++ SectionIterator怎么用?C++ SectionIterator使用的例子?那么, 这里精选的类代码示例或许可以为您提供帮助。
在下文中一共展示了SectionIterator类的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。
示例1: setupResources
// Resources
//-------------------------------------------------------------------------------------
void BaseApp::setupResources()
{
// Load resource paths from config file
Ogre::ConfigFile cf;
std::string s = PATHMANAGER::GameConfigDir() +
(pSet->tex_size > 0 ? "/resources.cfg" : "/resources_s.cfg");
cf.load(s);
// 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(
PATHMANAGER::Data() + "/" + archName, typeName, secName);
} }
}
示例2: loadResourses
void Viewer::loadResourses()
{
#if defined(Q_WS_WIN)
Ogre::ConfigFile cf;
cf.load("resources.cfg");
#endif
#if defined(Q_WS_X11)
Ogre::ConfigFile cf;
cf.load("/usr/share/OGRE/resources.cfg");
#endif
// 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();
}
示例3: while
//-----------------------------------------------------------------------
void
System::_setupResources(const Ogre::String& resourceFileName)
{
// Load resource paths from config file
Ogre::ConfigFile cf;
cf.load(resourceFileName);
// 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();
const Ogre::ConfigFile::SettingsMultiMap *settings = seci.getNext();
Ogre::ConfigFile::SettingsMultiMap::const_iterator i;
for (i = settings->begin(); i != settings->end(); ++i)
{
typeName = i->first;
archName = i->second;
bool recursive = false;
if (archName[0] == '*')
{
archName.erase(0, 1);
Ogre::StringUtil::trim(archName);
recursive = true;
}
Ogre::ResourceGroupManager::getSingleton().addResourceLocation(
archName, typeName, secName, recursive);
}
}
}
示例4: 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;
#if OGRE_PLATFORM == OGRE_PLATFORM_APPLE
// OS X does not set the working directory relative to the app.
// In order to make things portable on OS X we need to provide
// the loading with it's own bundle path location.
if (!Ogre::StringUtil::startsWith(archName, "/", false)) // only adjust relative directories
archName = Ogre::String(Ogre::macBundlePath() + "/" + archName);
#endif
Ogre::ResourceGroupManager::getSingleton().addResourceLocation(
archName, typeName, secName);
}
}
}
示例5: 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;
}
示例6: 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;
}
示例7: loadResources
void gkEngine::loadResources(const gkString& name)
{
if (name.empty()) return;
try
{
Ogre::ConfigFile fp;
fp.load(name);
Ogre::ResourceGroupManager* resourceManager = Ogre::ResourceGroupManager::getSingletonPtr();
Ogre::ConfigFile::SectionIterator cit = fp.getSectionIterator();
while (cit.hasMoreElements())
{
gkString elementname = cit.peekNextKey();
Ogre::ConfigFile::SettingsMultiMap* ptr = cit.getNext();
for (Ogre::ConfigFile::SettingsMultiMap::iterator dit = ptr->begin(); dit != ptr->end(); ++dit)
resourceManager->addResourceLocation(dit->second, dit->first, elementname);
}
Ogre::ResourceGroupManager::getSingleton().initialiseAllResourceGroups();
}
catch (Ogre::Exception& e)
{
gkLogMessage("Engine: Failed to load resource file!\n" << e.getDescription());
}
}
示例8: 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);
}
}
}
示例9: setupResources
void OgreModule::setupResources()
{
// Load resource paths from config file
Ogre::ConfigFile cf;
cf.load(mResourcePath + "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;
#if OGRE_PLATFORM == OGRE_PLATFORM_APPLE
// OS X does not set the working directory relative to the app,
// In order to make_unique entities portable on OS X we need to provide
// the loading with it's own bundle path location
Ogre::ResourceGroupManager::getSingleton().addResourceLocation(
Ogre::String(macBundlePath() + "/" + archName), typeName, secName);
#else
Ogre::ResourceGroupManager::getSingleton().addResourceLocation(
archName, typeName, secName);
#endif
}
}
}
示例10: 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();
}
}
}
}
}
示例11: initResources
void OgreEngine::initResources() {
// 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);
}
}
Ogre::ResourceGroupManager::getSingleton().initialiseAllResourceGroups();
}
示例12: 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);
}
}
}
示例13: 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();
}
示例14: InitializeRootResourcesAndPlugins
void Game::InitializeRootResourcesAndPlugins()
{
// construct Ogre::Root
mRoot = new Ogre::Root(mPluginsCfg);
// set up resources
// 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();
/*secName is the name of each section: Essential, Popular, General
typeName is the type of the resource being defined: FileSystem (folder) or Zip file
archName is an absolute path to the resource */
Ogre::String secName, typeName, archName;
//Loop through each section and store the location of the resource
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().initialiseResourceGroup("General");
}
示例15: loadResources
void Application::loadResources()
{
// You can specify as many locations as you want, or have several resource groups that you
// load/unload when you need.
// You may also wish to read the resource locations from a configuration file instead of
// having them hard-coded.
Ogre::ResourceGroupManager& resourceManager = Ogre::ResourceGroupManager::getSingleton();
Ogre::String secName, typeName, archName;
Ogre::ConfigFile cf;
cf.load("resources.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);
}
}
resourceManager.initialiseAllResourceGroups();
}