• 设为首页
  • 点击收藏
  • 手机版
    手机扫一扫访问
    迪恩网络手机版
  • 关注官方公众号
    微信扫一扫关注
    迪恩网络公众号

C++ configfile::SettingsMultiMap类代码示例

原作者: [db:作者] 来自: [db:来源] 收藏 邀请

本文整理汇总了C++中configfile::SettingsMultiMap的典型用法代码示例。如果您正苦于以下问题:C++ SettingsMultiMap类的具体用法?C++ SettingsMultiMap怎么用?C++ SettingsMultiMap使用的例子?那么恭喜您, 这里精选的类代码示例或许可以为您提供帮助。



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

示例1: Load

    //-----------------------------------------------------------------------
    void MapUtil::Load()
    {
#ifndef _MAPEDITOR
        mRoot = new Root("plugins.cfg", "ogre.cfg", "MapSplitter.log");     
        // Load resource paths from config file      
       ConfigFile cf;
        cf.load("resources.cfg");
        // Go through all sections & settings in the file
        ConfigFile::SectionIterator seci = cf.getSectionIterator();

        String secName, typeName, archName;
        while (seci.hasMoreElements())
        {
            secName = seci.peekNextKey();
            ConfigFile::SettingsMultiMap *settings = seci.getNext();
            ConfigFile::SettingsMultiMap::iterator i;
            for (i = settings->begin(); i != settings->end(); ++i)
            {
                typeName = i->first;
                archName = i->second;
                ResourceGroupManager::getSingleton().addResourceLocation(
                    archName, typeName, secName);
            }
        }

        mOptions = new PagingLandScapeOptions();
        mOptions->load("maptool.cfg");
#endif //_MAPEDITOR
    }
开发者ID:proton,项目名称:ireon,代码行数:30,代码来源:MapUtil.cpp


示例2: setupResources

void OgreApp::setupResources(void){
	Ogre::ResourceGroupManager* res_manager = Ogre::ResourceGroupManager::getSingletonPtr();
#if 0
	std::string res_path = respath + "materials/programs";
	res_manager->addResourceLocation(res_path, "FileSystem", "General");
	res_path = respath + "materials/scripts";
	res_manager->addResourceLocation(res_path, "FileSystem", "General");
	res_path = respath + "materials/textures";
	res_manager->addResourceLocation(res_path, "FileSystem", "General");
	res_path = respath + "models";
	res_manager->addResourceLocation(res_path, "FileSystem", "General");
#endif

	// Load resource paths from config file
	ConfigFile cf;

#if( CC_TARGET_PLATFORM == CC_PLATFORM_ANDROID )
	if (gAssetMgr) {   
		ArchiveManager::getSingleton().addArchiveFactory( 
				new APKFileSystemArchiveFactory(gAssetMgr) );
		ArchiveManager::getSingleton().addArchiveFactory( 
				new APKZipArchiveFactory(gAssetMgr) );
	} 

	cf.load(openAPKFile(resource_cfg_file));
#else
	cf.load(mResourcePath + resource_cfg_file);
#endif

	// Go through all sections & settings in the file
	ConfigFile::SectionIterator seci = cf.getSectionIterator();

	String sec, type, arch;
	while (seci.hasMoreElements()){
		sec = seci.peekNextKey();
		ConfigFile::SettingsMultiMap *settings = seci.getNext();
		ConfigFile::SettingsMultiMap::iterator i;
		for (i = settings->begin(); i != settings->end(); ++i){
			type = i->first;
			arch = i->second;

#if CC_TARGET_PLATFORM == CC_PLATFORM_IOS
			// 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
			arch = String(macBundlePath) + "/" + arch;
#elif CC_TARGET_PLATFORM == CC_PLATFORM_ANDROID
//			arch= "assets/" + arch;
#else
			//notice: mResourcePath must be prefix
			arch= mResourcePath + arch;
#endif
			res_manager->addResourceLocation(arch, type, sec);
		}
	}

#if( CC_TARGET_PLATFORM == CC_PLATFORM_ANDROID )
	res_manager->initialiseResourceGroup(Ogre::ResourceGroupManager::DEFAULT_RESOURCE_GROUP_NAME);
#endif
}
开发者ID:dorgonman,项目名称:cocos2d-x-ogre,代码行数:60,代码来源:ogreapp.cpp


示例3: setupResources

/// Method which will define the source of resources (other than current folder)
void OgreApp::setupResources(void)
{
	// Load resource paths from config file
	ConfigFile cf;
	cf.load("resources.cfg");

	// Go through all sections & settings in the file
	ConfigFile::SectionIterator seci = cf.getSectionIterator();

	String secName, typeName, archName;
	while (seci.hasMoreElements())
	{
		secName = seci.peekNextKey();
		ConfigFile::SettingsMultiMap *settings = seci.getNext();
		ConfigFile::SettingsMultiMap::const_iterator i;
		for (i = settings->begin(); i != settings->end(); ++i)
		{
			typeName = i->first;
			archName = i->second;
			ResourceGroupManager::getSingleton().addResourceLocation(
				archName, typeName, secName);
		}
	}
	ResourceGroupManager::getSingleton().initialiseAllResourceGroups();
}
开发者ID:aufheben1,项目名称:visual-experiments,代码行数:26,代码来源:OgreApp.cpp


示例4: setupResources

void GameManager::setupResources(void)
{
  // load resource paths from config file
  ConfigFile cf;
  std::string ResourcePath;
  ResourcePath = "..\\media\\";
  cf.load(ResourcePath + "resources.cfg");
  // go through all settings in the file
  ConfigFile::SectionIterator seci = cf.getSectionIterator();
  String secName, typeName, archName;

  while(seci.hasMoreElements())
  {
    secName = seci.peekNextKey();
    ConfigFile::SettingsMultiMap *settings = seci.getNext();
    ConfigFile::SettingsMultiMap::iterator i;

    for(i = settings->begin() ; i != settings->end() ; ++i)
    {
      typeName = i->first;
      archName = i->second;
      ResourceGroupManager::getSingleton().addResourceLocation(
        ResourcePath + archName, typeName, secName);
    }
  }

  ParticleSystemRendererFactory*  mParticleSystemRendererFact;
  ParticleEmitterFactory*     mParticleEmitterFact;
  mParticleSystemRendererFact = OGRE_NEW ShaderParticleRendererFactory();
  mParticleEmitterFact        = OGRE_NEW BoxEmitterFactory();
  ParticleSystemManager::getSingleton().addRendererFactory(mParticleSystemRendererFact);
  ParticleSystemManager::getSingleton().addEmitterFactory(mParticleEmitterFact);
}
开发者ID:xDusk,项目名称:lostisland04,代码行数:33,代码来源:GameManager.cpp


示例5: while

void
GraphicsManager::setupResources()
{
    ConfigFile configFile;
    configFile.load(m_resourcePath + "resources.cfg");

    ConfigFile::SectionIterator secItr = configFile.getSectionIterator();

    String secName, typeName, archName;
    while (secItr.hasMoreElements())
    {
        secName = secItr.peekNextKey();
        ConfigFile::SettingsMultiMap *settings = secItr.getNext();
        ConfigFile::SettingsMultiMap::iterator i;
        for (i = settings->begin(); i != settings->end(); ++i)
        {
            typeName = i->first;
            archName = i->second;
#if OGRE_PLATFORM == OGRE_PLATFORM_APPLE
            ResourceGroupManager::getSingleton().addResourceLocation(
                String(macBundlePath() + "/" + archName), typeName, secName);
#else
            ResourceGroupManager::getSingleton().addResourceLocation(
                archName, typeName, secName);
#endif
        }
    }
}
开发者ID:twiad,项目名称:COA-Jump-And-Run---Engine,代码行数:28,代码来源:GraphicsManager.cpp


示例6: defineResources

    void defineResources(void){
        String secName, typeName, archName;
        ConfigFile cf;

        #if OGRE_PLATFORM == OGRE_PLATFORM_APPLE
            cf.load(macBundlePath() + "/Contents/Resources/resources.cfg");
        #else
            cf.load("resources.cfg"); //parses
        #endif

        ConfigFile::SectionIterator seci = cf.getSectionIterator();
        while (seci.hasMoreElements()){ //start looping in the content
            secName = seci.peekNextKey(); //get all the content
            ConfigFile::SettingsMultiMap *settings = seci.getNext(); //only points to content address
            ConfigFile::SettingsMultiMap::iterator i;

            for (i = settings->begin(); i != settings->end(); ++i){
                typeName = i->first;
                archName = i->second;

                #if OGRE_PLATFORM == OGRE_PLATFORM_APPLE
                    ResourceGroupManager::getSingleton().addResourceLocation( String(macBundlePath() + "/" + archName), typeName, secName);
                #else
                    ResourceGroupManager::getSingleton().addResourceLocation( archName, typeName, secName);
                #endif
            }
        }
    }
开发者ID:ramyD,项目名称:boksey,代码行数:28,代码来源:main.cpp


示例7: initOgreAssets

void Game::initOgreAssets() {
    using namespace Ogre;

    // Load resource paths from config file
    ConfigFile config_file;
    config_file.load("resources.cfg");

    // Go through all sections & settings in the file
    ConfigFile::SectionIterator section_iter = config_file.getSectionIterator();

    String group_name, location_type, location_name;
    while (section_iter.hasMoreElements()) {
        group_name = section_iter.peekNextKey();
        ConfigFile::SettingsMultiMap* settings = section_iter.getNext();
        for (auto i = settings->begin(); i != settings->end(); ++i) {
            location_type = i->first;
            location_name = i->second;
            static const bool recursive = false;
            ResourceGroupManager::getSingleton().addResourceLocation(
                location_name, location_type, group_name, recursive);
        }
    }

    ResourceGroupManager::getSingleton().initialiseAllResourceGroups();
}
开发者ID:raymond-w-ko,项目名称:letterdungeon,代码行数:25,代码来源:Game.cpp


示例8: setUp

void TerrainTests::setUp()
{
	mRoot = OGRE_NEW Root();

	// Load resource paths from config file
	ConfigFile cf;
	cf.load("resources.cfg");

	// Go through all sections & settings in the file
	ConfigFile::SectionIterator seci = cf.getSectionIterator();

	String secName, typeName, archName;
	while (seci.hasMoreElements())
	{
		secName = seci.peekNextKey();
		ConfigFile::SettingsMultiMap *settings = seci.getNext();
		ConfigFile::SettingsMultiMap::iterator i;
		for (i = settings->begin(); i != settings->end(); ++i)
		{
			typeName = i->first;
			archName = i->second;
			ResourceGroupManager::getSingleton().addResourceLocation(
				archName, typeName, secName);

		}
	}

	mSceneMgr = mRoot->createSceneManager(ST_GENERIC);

}
开发者ID:brunobg,项目名称:TuxSinbad,代码行数:30,代码来源:TerrainTests.cpp


示例9: RemoveResourceLocations

void AApplication::RemoveResourceLocations(std::string path)
{
    // Load resource paths from config file

    ConfigFile cf;
    cf.load(path+"resources.cfg");

    // Go through all sections & settings in the file
    ConfigFile::SectionIterator seci = cf.getSectionIterator();

    String secName, typeName, archName;
    while (seci.hasMoreElements())
    {
        secName = seci.peekNextKey();
        ConfigFile::SettingsMultiMap *settings = seci.getNext();
        ConfigFile::SettingsMultiMap::iterator i;
        for (i = settings->begin(); i != settings->end(); ++i)
        {
            typeName = i->first;
            archName = i->second;
            ResourceGroupManager::getSingleton().removeResourceLocation(archName, secName);
        }
    }

}
开发者ID:beorc,项目名称:flare_star,代码行数:25,代码来源:AApplication.cpp


示例10: setupResources

// Get the resources sources
void ClientMain::setupResources()
{
    ConfigFile                              cf;
    ConfigFile::SettingsMultiMap*           settings;
    ConfigFile::SettingsMultiMap::iterator  i;
    String                                  secName, typeName, archName;

    // Load other resource paths from config file
    cf.load(ClientConfig::getSingle()   ->getPath(String("resources.cfg")));

    // Go through all sections & settings in the file
    ConfigFile::SectionIterator seci    = cf.getSectionIterator();

    while (seci.hasMoreElements()) {
        secName  = seci.peekNextKey();
        settings = seci.getNext();

        for (i = settings->begin(); i != settings->end(); ++i) {
            typeName = i->first;
            archName = i->second;

            ResourceGroupManager::getSingleton().addResourceLocation(archName, typeName, secName);
        }
    }
    // Initialise and parse ressources
    TextureManager::getSingleton()       .setDefaultNumMipmaps(5);
    ResourceGroupManager::getSingleton() .initialiseAllResourceGroups();
}
开发者ID:wengerclub,项目名称:3DInteractiveSimulation,代码行数:29,代码来源:ClientMain.cpp


示例11: setupResources

/// Method which will define the source of resources (other than current folder)
void Renderer::setupResources(void)
{
    // Load resource paths from config file
    ConfigFile cf;
    cf.load(mResourcePath + "resources.cfg");

    // Go through all sections & settings in the file
    ConfigFile::SectionIterator seci = cf.getSectionIterator();

    String secName, typeName, archName;
    while (seci.hasMoreElements())
    {
        secName = seci.peekNextKey();
        ConfigFile::SettingsMultiMap *settings = seci.getNext();
        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
            ResourceGroupManager::getSingleton().addResourceLocation(
                String(macBundlePath() + "/" + archName), typeName, secName);
#else
            ResourceGroupManager::getSingleton().addResourceLocation(
                archName, typeName, secName);
#endif
        }
    }
}
开发者ID:mwilksy,项目名称:ogreGame,代码行数:33,代码来源:Renderer.cpp


示例12: setupResources

//------------------------------------------------------------------------------------------
/// Method which will define the source of resources (other than current folder)
void CRtcApplication::setupResources()
{
    // Load resource paths from config file
    ConfigFile cf;
    cf.load(mResourcePath + skResourceFilename);

    // Go through all sections & settings in the file
    ConfigFile::SectionIterator seci = cf.getSectionIterator();

    String secName, typeName, archName;
    while (seci.hasMoreElements())
    {
        secName = seci.peekNextKey();
        ConfigFile::SettingsMultiMap *settings = seci.getNext();
        ConfigFile::SettingsMultiMap::iterator i;
        for (i = settings->begin(); i != settings->end(); ++i)
        {
            typeName = i->first;
            archName = i->second;
            ResourceGroupManager::getSingleton().addResourceLocation( String(mOGREResourcePath + "/" + archName), typeName, secName);

            if ( typeName == "FileSystem" )
            {
                ResourceGroupManager::getSingleton().addResourceLocation( String(mResourcePath + archName), typeName, secName);
            }
        }
    }
}
开发者ID:leandronunescorreia,项目名称:realtimecameras,代码行数:30,代码来源:crtcapplication.cpp


示例13: readCfg

bool Day::readCfg()
{
    ConfigFile cf;
    cf.load(DAY_DIR(raceName, dayName)+"/"+DAY_CFG);

    dprintf(MY_DEBUG_NOTE, "Read day cfg file: %s / %s\n", raceName.c_str(), dayName.c_str());
    // Go through all sections & settings in the file
    ConfigFile::SectionIterator seci = cf.getSectionIterator();

    std::string secName, keyName, valName;
    while (seci.hasMoreElements())
    {
        secName = seci.peekNextKey();
        dprintf(MY_DEBUG_NOTE, "\tSection d: %s\n", secName.c_str());
        ConfigFile::SettingsMultiMap *settings = seci.getNext();
        ConfigFile::SettingsMultiMap::iterator i;
        for (i = settings->begin(); i != settings->end(); ++i)
        {
            keyName = i->first;
            valName = i->second;
            dprintf(MY_DEBUG_NOTE, "\t\tkey: %s, value: %s\n", keyName.c_str(), valName.c_str());

            if (keyName == "long_name")
            {
                dayLongName = valName;
            }/* else if (keyName == "cache_objects")
            {
                cacheObjects = StringConverter::parseBool(valName, true);
            }*/
        }
    }
    return true;
}
开发者ID:Berkananna,项目名称:rallyraid,代码行数:33,代码来源:Day.cpp


示例14: setupResources

void GameManager::setupResources( void ) {
    // Load resource paths from config file
    ConfigFile cf;
    cf.load( "resources.cfg" );

    // Go through all settings in the file
    ConfigFile::SectionIterator itSection = cf.getSectionIterator();

    String sSection, sType, sArch;
    while( itSection.hasMoreElements() ) {
        sSection = itSection.peekNextKey();

        ConfigFile::SettingsMultiMap *mapSettings = itSection.getNext();
        ConfigFile::SettingsMultiMap::iterator itSetting = mapSettings->begin();
        while( itSetting != mapSettings->end() ) {
            sType = itSetting->first;
            sArch = itSetting->second;

            ResourceGroupManager::getSingleton().addResourceLocation(
                sArch, sType, sSection );

            ++itSetting;
        }
    }

}
开发者ID:ramyD,项目名称:Fourth,代码行数:26,代码来源:GameManager.cpp


示例15: setUp

//--------------------------------------------------------------------------
void MeshLodTests::setUp()
{
    mFSLayer = OGRE_NEW_T(Ogre::FileSystemLayer, Ogre::MEMCATEGORY_GENERAL)(OGRE_VERSION_NAME);

#ifdef OGRE_STATIC_LIB
    mStaticPluginLoader = OGRE_NEW StaticPluginLoader();
    Root* root = OGRE_NEW Root(BLANKSTRING);        
    mStaticPluginLoader.load();
#else
    String pluginsPath = mFSLayer->getConfigFilePath("plugins.cfg");
    Root* root = OGRE_NEW Root(pluginsPath);
#endif

    CPPUNIT_ASSERT(!root->getAvailableRenderers().empty());
    root->setRenderSystem(root->getAvailableRenderers().back());
    root->initialise(false); // Needed for setting up HardwareBufferManager

#if OGRE_PLATFORM == OGRE_PLATFORM_APPLE
    Ogre::NameValuePairList misc;
    // Tell OGRE that we're using cocoa, so it doesn't need to make a window for us
    misc["macAPI"] = "cocoa";
    root->createRenderWindow("", 320, 240, false, &misc)->setHidden(true);
#else
    root->createRenderWindow("", 320, 240, false, NULL)->setHidden(true);
#endif

    new MeshLodGenerator;

    // Load resource paths from config file
    ConfigFile cf;
    String resourcesPath;

#if OGRE_PLATFORM == OGRE_PLATFORM_APPLE || OGRE_PLATFORM == OGRE_PLATFORM_WIN32
    resourcesPath = mFSLayer->getConfigFilePath("resources.cfg");
#else
    resourcesPath = mFSLayer->getConfigFilePath("bin/resources.cfg");
#endif

    cf.load(resourcesPath);
    // Go through all sections & settings in the file
    ConfigFile::SectionIterator seci = cf.getSectionIterator();

    String secName, typeName, archName;
    while (seci.hasMoreElements()) {
        secName = seci.peekNextKey();
        ConfigFile::SettingsMultiMap* settings = seci.getNext();
        ConfigFile::SettingsMultiMap::iterator i;
        for (i = settings->begin(); i != settings->end(); ++i) {
            typeName = i->first;
            archName = i->second;
            ResourceGroupManager::getSingleton().addResourceLocation(
                archName, typeName, secName);
        }
    }

    // Create the mesh for testing
    mMesh = MeshManager::getSingleton().load("Sinbad.mesh", ResourceGroupManager::AUTODETECT_RESOURCE_GROUP_NAME);
}
开发者ID:whztt07,项目名称:ogre3d,代码行数:59,代码来源:MeshLodTests.cpp


示例16: setUp

void TerrainTests::setUp()
{
    // set up silent logging to not pollute output
	if(LogManager::getSingletonPtr())
		OGRE_DELETE Ogre::LogManager::getSingletonPtr();

	if(LogManager::getSingletonPtr() == 0)
	{
		LogManager* logManager = OGRE_NEW LogManager();
		logManager->createLog("testTerrain.log", true, false);
	}
    LogManager::getSingleton().setLogDetail(LL_LOW);
    mFSLayer = OGRE_NEW_T(Ogre::FileSystemLayer, Ogre::MEMCATEGORY_GENERAL)(OGRE_VERSION_NAME);

#ifdef OGRE_STATIC_LIB
	mRoot = OGRE_NEW Root(BLANKSTRING);
        
	mStaticPluginLoader.load();
#else
    String pluginsPath = mFSLayer->getConfigFilePath("plugins.cfg");
	mRoot = OGRE_NEW Root(pluginsPath);
#endif
	mTerrainOpts = OGRE_NEW TerrainGlobalOptions();

	// Load resource paths from config file
	ConfigFile cf;
    String resourcesPath;
#if OGRE_PLATFORM == OGRE_PLATFORM_APPLE || OGRE_PLATFORM == OGRE_PLATFORM_WIN32
    resourcesPath = mFSLayer->getConfigFilePath("resources.cfg");
#else
    resourcesPath = mFSLayer->getConfigFilePath("bin/resources.cfg");
#endif

    cf.load(resourcesPath);

	// Go through all sections & settings in the file
	ConfigFile::SectionIterator seci = cf.getSectionIterator();

	String secName, typeName, archName;
	while (seci.hasMoreElements())
	{
		secName = seci.peekNextKey();
		ConfigFile::SettingsMultiMap *settings = seci.getNext();
		ConfigFile::SettingsMultiMap::iterator i;
		for (i = settings->begin(); i != settings->end(); ++i)
		{
			typeName = i->first;
			archName = i->second;
			ResourceGroupManager::getSingleton().addResourceLocation(
				archName, typeName, secName);

		}
	}

	mSceneMgr = mRoot->createSceneManager(ST_GENERIC);

}
开发者ID:j-rivero,项目名称:ogre-acornacorn,代码行数:57,代码来源:TerrainTests.cpp


示例17: dprintf

/* static */ void RaceManager::readGlobalObjects(const std::string& fileName, RaceManager::globalObjectList_t& globalObjectList)
{
    ConfigFile cf;
    cf.load(fileName);

    dprintf(MY_DEBUG_NOTE, "Read global objects cfg file: %s\n", fileName.c_str());
    // Go through all sections & settings in the file
    ConfigFile::SectionIterator seci = cf.getSectionIterator();

    std::string secName, keyName, valName;
    while (seci.hasMoreElements())
    {
        std::string objectPoolName;
        irr::core::vector3df apos;
        irr::core::vector3df rot;
        irr::core::vector3df scale(1.0f, 1.0f, 1.0f);

        secName = seci.peekNextKey();
        dprintf(MY_DEBUG_NOTE, "\tSection: %s\n", secName.c_str());
        ConfigFile::SettingsMultiMap *settings = seci.getNext();
        ConfigFile::SettingsMultiMap::iterator i;
        for (i = settings->begin(); i != settings->end(); ++i)
        {
            keyName = i->first;
            valName = i->second;
            dprintf(MY_DEBUG_NOTE, "\t\tkey: %s, value: %s\n", keyName.c_str(), valName.c_str());

            if (keyName == "type")
            {
                objectPoolName = valName;
            } else if (keyName == "pos")
            {
                StringConverter::parseFloat3(valName, apos.X, apos.Y, apos.Z);
            } else if (keyName == "rot")
            {
                StringConverter::parseFloat3(valName, rot.X, rot.Y, rot.Z);
            } else if (keyName == "scale")
            {
                StringConverter::parseFloat3(valName, scale.X, scale.Y, scale.Z);
            }
        }

        ObjectPool* objectPool = 0;
        ObjectPoolManager::objectPoolMap_t::const_iterator poolIt = ObjectPoolManager::getInstance()->getObjectPoolMap().find(objectPoolName);
        if (poolIt != ObjectPoolManager::getInstance()->getObjectPoolMap().end())
        {
            objectPool = poolIt->second;
        }

        if (objectPool)
        {
            ObjectWireGlobalObject* globalObject = new ObjectWireGlobalObject(objectPool, apos, rot, scale);
            globalObjectList.push_back(globalObject);
        }
    }
}
开发者ID:Berkananna,项目名称:rallyraid,代码行数:56,代码来源:RaceManager.cpp


示例18: while

OgreApp::OgreApp()
{
    root = new Root;

    ConfigFile cf;
    cf.load("resources.cfg");

    // Go through all sections & settings in the file
    ConfigFile::SectionIterator seci = cf.getSectionIterator();

    String secName, typeName, archName;
    while (seci.hasMoreElements())
    {
        secName = seci.peekNextKey();
        ConfigFile::SettingsMultiMap *settings = seci.getNext();
        ConfigFile::SettingsMultiMap::iterator i;
        for (i = settings->begin(); i != settings->end(); ++i)
        {
            typeName = i->first;
            archName = i->second;
            ResourceGroupManager::getSingleton().addResourceLocation(
                archName, typeName, secName);
        }
    }

	ResourceGroupManager::getSingleton().initialiseAllResourceGroups();
	
	// Restore the old config
	if(!root->restoreConfig())
	{
		// If there is no existing config, bring up the config dialog
		if(!root->showConfigDialog())
		{
			// If the user cancels the dialog, close the app
			exit(0);
		}
	}

    win = root->initialise(true, "Ogre Framework");

	sceneMgr = root->createSceneManager(ST_GENERIC, "MainSceneManager");

    camera = sceneMgr->createCamera("SimpleCamera");
    viewPort = root->getAutoCreatedWindow()->addViewport(camera);
    viewPort->setBackgroundColour(ColourValue(0,0,0));
    camera->setAspectRatio(Real(viewPort->getActualWidth()) / Real(viewPort->getActualHeight()));
    camera->setNearClipDistance(1.0);

	soundManager = new OgreAL::SoundManager();

	createScene();

    listener = new DeviceListener(win, camera, sceneMgr);
    root->addFrameListener(listener);
}
开发者ID:barsnadcat,项目名称:steelandconcrete,代码行数:55,代码来源:OgreApp.cpp


示例19: setUp

void TerrainTests::setUp()
{
    // set up silent logging to not pollute output
	if(LogManager::getSingletonPtr())
		OGRE_DELETE Ogre::LogManager::getSingletonPtr();

	if(LogManager::getSingletonPtr() == 0)
	{
		LogManager* logManager = OGRE_NEW LogManager();
		logManager->createLog("testTerrain.log", true, false);
	}
    LogManager::getSingleton().setLogDetail(LL_LOW);

	mRoot = OGRE_NEW Root();
	mTerrainOpts = OGRE_NEW TerrainGlobalOptions();

	// Load resource paths from config file
	ConfigFile cf;
#if OGRE_PLATFORM == OGRE_PLATFORM_APPLE
	cf.load(macBundlePath() + "/Contents/Resources/resources.cfg");
#else
	cf.load("resources.cfg");
#endif

	// Go through all sections & settings in the file
	ConfigFile::SectionIterator seci = cf.getSectionIterator();

	String secName, typeName, archName;
	while (seci.hasMoreElements())
	{
		secName = seci.peekNextKey();
		ConfigFile::SettingsMultiMap *settings = seci.getNext();
		ConfigFile::SettingsMultiMap::iterator i;
		for (i = settings->begin(); i != settings->end(); ++i)
		{
			typeName = i->first;
			archName = i->second;
			ResourceGroupManager::getSingleton().addResourceLocation(
				archName, typeName, secName);

		}
	}

	mSceneMgr = mRoot->createSceneManager(ST_GENERIC);

}
开发者ID:vancepym,项目名称:ogre,代码行数:46,代码来源:TerrainTests.cpp


示例20:

/** Reads configuration from "media/config/splash.res" and loads all ressource groups inside.\n
	The options must be initialized.\n
	Ogre must be initialized with a scene manager, camera and viewport.\n
	@sa Ponykart::Core::Options, Kernel/LKernel.h
*/
Splash::Splash()
{
	current=0;

	log("[Loading] Loading splash screen ressources...");
	ConfigFile configFile;
	configFile.load("media/config/splash.res");
	ConfigFile::SectionIterator seci = configFile.getSectionIterator();
	while (seci.hasMoreElements())
	{
		String secName = seci.peekNextKey();
		ConfigFile::SettingsMultiMap *settings = seci.getNext();
		for (auto i = settings->begin(); i != settings->end(); ++i)
			ResourceGroupManager::getSingleton().addResourceLocation(i->second, i->first, secName);
	}
	ResourceGroupManager::getSingleton().initialiseAllResourceGroups();

	createScene();
	updateGUI();
}
开发者ID:Nuke928,项目名称:PonyKart,代码行数:25,代码来源:Splash.cpp



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


鲜花

握手

雷人

路过

鸡蛋
该文章已有0人参与评论

请发表评论

全部评论

专题导读
上一篇:
C++ configitem::Ptr类代码示例发布时间:2022-05-31
下一篇:
C++ configfile::SectionIterator类代码示例发布时间:2022-05-31
热门推荐
阅读排行榜

扫描微信二维码

查看手机版网站

随时了解更新最新资讯

139-2527-9053

在线客服(服务时间 9:00~18:00)

在线QQ客服
地址:深圳市南山区西丽大学城创智工业园
电邮:jeky_zhao#qq.com
移动电话:139-2527-9053

Powered by 互联科技 X3.4© 2001-2213 极客世界.|Sitemap