本文整理汇总了C++中ogre::configfile::SettingsMultiMap类的典型用法代码示例。如果您正苦于以下问题:C++ SettingsMultiMap类的具体用法?C++ SettingsMultiMap怎么用?C++ SettingsMultiMap使用的例子?那么, 这里精选的类代码示例或许可以为您提供帮助。
在下文中一共展示了SettingsMultiMap类的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。
示例1: StartupOgre
void Client::StartupOgre() {
Ogre::LogManager* logMgr = OGRE_NEW Ogre::LogManager;
logMgr->createLog("DefaultLog", true, false, false);
mOgreRoot = new Ogre::Root("../data/config/plugins.cfg");
// setup resources
// Load resource paths from config file
Ogre::ConfigFile cf;
cf.load("../data/config/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);
}
}
// configure
// Show the configuration dialog and initialise the system
if(!(mOgreRoot->restoreConfig() || mOgreRoot->showConfigDialog())) {
exit(0);
}
mWindow = mOgreRoot->initialise(true, "Client Window");
// Set default mipmap level (NB some APIs ignore this)
Ogre::TextureManager::getSingleton().setDefaultNumMipmaps(5);
// initialise all resource groups
// Ogre::ResourceGroupManager::getSingleton().initialiseAllResourceGroups();
Ogre::ResourceGroupManager::getSingleton().initialiseResourceGroup("Basics");
Ogre::ResourceGroupManager::getSingleton().initialiseResourceGroup("GUI");
InitializeWindow();
// ogre loaded
}
示例2: setupResources
//--------------------------------------------------------------------------
void CompositorDemo::setupResources(void)
{
// Load resource paths from config file
Ogre::ConfigFile cf;
#if OGRE_PLATFORM == OGRE_PLATFORM_APPLE
Ogre::String mResourcePath;
mResourcePath = bundlePath() + "/Contents/Resources/";
cf.load(mResourcePath + "resources.cfg");
#else
cf.load("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;
#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
Ogre::ResourceGroupManager::getSingleton().addResourceLocation(
Ogre::String(bundlePath() + "/" + archName), typeName, secName);
#else
Ogre::ResourceGroupManager::getSingleton().addResourceLocation(
archName, typeName, secName);
#endif
}
}
Ogre::LogManager::getSingleton().logMessage( "Resource directories setup" );
}
示例3: loadResources
void MyApp::loadResources() {
Ogre::ConfigFile cf;
cf.load("resources.cfg");
Ogre::ConfigFile::SectionIterator sI = cf.getSectionIterator();
Ogre::String sectionstr, typestr, datastr;
while (sI.hasMoreElements()) {
sectionstr = sI.peekNextKey();
Ogre::ConfigFile::SettingsMultiMap *settings = sI.getNext();
Ogre::ConfigFile::SettingsMultiMap::iterator i;
for (i = settings->begin(); i != settings->end(); ++i) {
typestr = i->first; datastr = i->second;
Ogre::ResourceGroupManager::getSingleton().addResourceLocation
(datastr, typestr, sectionstr);
}
}
Ogre::ResourceGroupManager::getSingleton().initialiseAllResourceGroups();
}
示例4: loadResources
void loadResources(){
Ogre::ConfigFile cf;
cf.load("resources_d.cfg");
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);
}
}
Ogre::ResourceGroupManager::getSingleton().initialiseAllResourceGroups();
}
示例5: start
bool App::start()
{
mRoot = new Ogre::Root("plugins_d.cfg", "ogre.cfg", "Ogre.log");
Ogre::ConfigFile configFile;
configFile.load("resources_d.cfg");
Ogre::ConfigFile::SectionIterator seci = configFile.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);
}
}
if (!(mRoot->restoreConfig() || mRoot->showConfigDialog()))
{
return false;
}
mWindow = mRoot->initialise(true, "ZappyGraph");
Ogre::TextureManager::getSingleton().setDefaultNumMipmaps(5);
Ogre::ResourceGroupManager::getSingleton().initialiseAllResourceGroups();
Game* game = new Game();
NetworkManager *net = new NetworkManager(game);
Menu *menuManager = new Menu(net);
game->init(mRoot, mWindow, menuManager, net);
game->createMenu();
while (true)
{
net->update();
Ogre::WindowEventUtilities::messagePump();
if (mWindow->isClosed())
return false;
if (!mRoot->renderOneFrame())
return false;
}
return true;
}
示例6: setupResources
void Application::setupResources(void)
{
Ogre::ConfigFile cf;
cf.load(mResourcePath + "resources.cfg");
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: setupResources
void OgreCPP::setupResources(std::string mResourcePath)
{
// Load resource paths from config file
Ogre::ConfigFile cf;
// FILE * pFile;
// pFile = fopen ("myfile.txt","w");
#ifdef __linux
cf.load(mResourcePath+"/resources_linux.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);
}
}
#else
//cf.load(mResourcePath+"/resources.cfg");
// Add resource locations
std::cout << "resource path: " << mResourcePath << std::endl;
std::cout << "resource path: " << mResourcePath << "/Contents/Mac" << std::endl;
printf("ADDING RESOURCES FOR MAC\n");
mRoot->addResourceLocation(mResourcePath + "/Contents/Resources/media/", "FileSystem");
mRoot->addResourceLocation(mResourcePath + "/Contents/Resources/media/fonts", "FileSystem");
mRoot->addResourceLocation(mResourcePath + "/Contents/Resources/media/materials/programs", "FileSystem");
mRoot->addResourceLocation(mResourcePath + "/Contents/Resources/media/materials/scripts", "FileSystem");
mRoot->addResourceLocation(mResourcePath + "/Contents/Resources/media/materials/textures", "FileSystem");
mRoot->addResourceLocation(mResourcePath + "/Contents/Resources/media/models", "FileSystem");
mRoot->addResourceLocation(mResourcePath + "/Contents/Resources/media/particle", "FileSystem");
#endif
}
示例8: initOgre
void App::initOgre(bool showDebugWindow)
{
Ogre::ConfigFile cf;
mRoot = new Ogre::Root("plugins.cfg");
cf.load("../../media/resources.cfg");
mRoot->addFrameListener(this);
// add resources
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)
Ogre::ResourceGroupManager::getSingleton().addResourceLocation(i->second, i->first, secName);
}
// initialize render system
mRoot->setRenderSystem(mRoot->getRenderSystemByName("OpenGL Rendering Subsystem"));
mRoot->initialise(false, "ARLib Example");
// create windows:
if (mRift)
{
Ogre::NameValuePairList miscParams;
miscParams["monitorIndex"] = Ogre::StringConverter::toString(1);
miscParams["border"] = "none";
miscParams["vsync"] = "true";
mWindow = mRoot->createRenderWindow("ARLib Example", 1920, 1080, true, &miscParams);
}
if (showDebugWindow)
{
Ogre::NameValuePairList miscParamsSmall;
miscParamsSmall["monitorIndex"] = Ogre::StringConverter::toString(0);
mSmallWindow = mRoot->createRenderWindow("ARLib Example (debug window)", 1920 / 2, 1080 / 2, false, &miscParamsSmall);
if (!mWindow)
mWindow = mSmallWindow;
}
Ogre::ResourceGroupManager::getSingleton().initialiseAllResourceGroups();
}
示例9: defineResources
void Application::defineResources()
{
Ogre::String sectionName, typeName, resName;
Ogre::ConfigFile cFile;
cFile.load("resources.cfg");
Ogre::ConfigFile::SectionIterator secIt = cFile.getSectionIterator();
while (secIt.hasMoreElements())
{
sectionName = secIt.peekNextKey();
Ogre::ConfigFile::SettingsMultiMap* settings = secIt.getNext();
Ogre::ConfigFile::SettingsMultiMap::iterator it;
for (it=settings->begin();it!=settings->end();++it)
{
typeName= it->first;
resName = it->second;
Ogre::ResourceGroupManager::getSingleton().addResourceLocation(resName,typeName,sectionName);
}
}
}
示例10: loadResources
static void loadResources(const char *name)
{
cf.load(openAPKFile(name));
Ogre::ConfigFile::SectionIterator seci = cf.getSectionIterator();
while (seci.hasMoreElements())
{
Ogre::String sec, type, arch;
sec = seci.peekNextKey();
Ogre::ConfigFile::SettingsMultiMap* settings = seci.getNext();
Ogre::ConfigFile::SettingsMultiMap::iterator i;
for (i = settings->begin(); i != settings->end(); i++)
{
type = i->first;
arch = i->second;
Ogre::ResourceGroupManager::getSingleton().addResourceLocation(arch, type, sec);
}
}
}
示例11: cargarRecursos
void MainWindow::cargarRecursos()
{
QSettings settings("toglia3d","SpriteSceneViewer");
QString rutaRecursosSetting = settings.value("rutaRecursos", QString("/home")).toString();
QFileDialog openDialog;
//openDialog.exec();
QString filtro = tr("*.cfg");
rutaRecursos = openDialog.getOpenFileName(
this,
tr("Abrir"),
rutaRecursosSetting,
filtro
);
if(!rutaRecursos.isEmpty()){
settings.setValue("rutaRecursos",rutaRecursos);
Ogre::ConfigFile cf;
cf.load(rutaRecursos.toStdString());
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: mFilePath
SettingsFileParser::SettingsFileParser(Ogre::String filePath)
: mFilePath(filePath)
{
// Set default settings
mRestoreConfig = false;
mLockMouse = true;
mDebugDraw = true;
mHumanChars = true;
mObstacles = true;
mSingleNavmesh = false;
mRaycastScene = false;
mTempObstacleSteering = true;
mComplexObstacles = true;
mTerrain = false;
mPaged = false;
mTerrainTilesX = 1;
mTerrainTilesZ = 1;
mTerrainTileSize = 12000.0f;
mTerrainTileResolution = 513;
mTerrainHeightScale = 1.0f;
// Load settings from config file
Ogre::ConfigFile settingsFile = Ogre::ConfigFile();
settingsFile.loadDirect(filePath);
Ogre::ConfigFile::SectionIterator sectIt = settingsFile.getSectionIterator();
Ogre::String sectionName, optionName, optionValue;
while(sectIt.hasMoreElements())
{
sectionName = sectIt.peekNextKey();
Ogre::ConfigFile::SettingsMultiMap *sectSettings = sectIt.getNext();
Ogre::ConfigFile::SettingsMultiMap::iterator it;
for(it = sectSettings->begin(); it != sectSettings->end(); it++) {
optionName = it->first;
optionValue = it->second;
addOption(sectionName, optionName, optionValue);
}
}
}
示例13: setupResources
/** Set up Ogre resources
*/
void QtSpacescapeWidget::setupResources(void) {
// Load resource paths from config file
Ogre::ConfigFile config;
config.load("resources.cfg");
// Go through all sections & settings in the file
Ogre::ConfigFile::SectionIterator it = config.getSectionIterator();
Ogre::String secName, typeName, archName;
while (it.hasMoreElements()) {
secName = it.peekNextKey();
Ogre::ConfigFile::SettingsMultiMap *settings = it.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);
}
}
}
示例14: 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;
Ogre::ResourceGroupManager::getSingleton().addResourceLocation(
archName, typeName, secName);
}
}
}
示例15: loadConfig
void RenderPump::loadConfig()
{
Ogre::ConfigFile cf;
#if OGRE_DEBUG_MODE
cf.load("setting_d.cfg");
#else
cf.load("setting.cfg");
#endif
Ogre::ConfigFile::SectionIterator secIter = cf.getSectionIterator();
Ogre::String secName, typeName, archName;
while(secIter.hasMoreElements())
{
secName = secIter.peekNextKey();
Ogre::ConfigFile::SettingsMultiMap *settings = secIter.getNext();
Ogre::ConfigFile::SettingsMultiMap::iterator iter;
for(iter=settings->begin(); iter!=settings->end(); iter++)
{
theApp.addPath(iter->first, iter->second);
}
}
}