本文整理汇总了C++中ogre::ConfigFile::getMultiSetting方法的典型用法代码示例。如果您正苦于以下问题:C++ ConfigFile::getMultiSetting方法的具体用法?C++ ConfigFile::getMultiSetting怎么用?C++ ConfigFile::getMultiSetting使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类ogre::ConfigFile
的用法示例。
在下文中一共展示了ConfigFile::getMultiSetting方法的3个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。
示例1: loadFactories
void ObjectManager::loadFactories(const String& factoriesfile)
{
String pluginDir;
Ogre::StringVector pluginList;
Ogre::ConfigFile cfg;
try {
cfg.load( factoriesfile );
}
catch (Ogre::Exception)
{
Ogre::LogManager::getSingleton().logMessage(factoriesfile + " not found, automatic object factories loading disabled.");
return;
}
pluginDir = cfg.getSetting("ObjectFactoryFolder"); // Ignored on Mac OS X, uses Resources/ directory
pluginList = cfg.getMultiSetting("ObjectFactory");
char last_char = pluginDir[pluginDir.length()-1];
if (last_char != '/' && last_char != '\\')
{
#if OGRE_PLATFORM == OGRE_PLATFORM_WIN32
pluginDir += "\\";
#elif OGRE_PLATFORM == OGRE_PLATFORM_LINUX
pluginDir += "/";
#endif
}
for( Ogre::StringVector::iterator it = pluginList.begin(); it != pluginList.end(); ++it )
{
this->loadFactory(pluginDir + (*it));
}
}
示例2: LoadOgrePlugins
bool OgreSubsystem::LoadOgrePlugins(Ogre::String const & pluginsfile)
{
Ogre::StringVector pluginList;
Ogre::String pluginDir;
Ogre::ConfigFile cfg;
try
{
cfg.load( pluginsfile );
}
catch (Ogre::Exception)
{
Ogre::LogManager::getSingleton().logMessage(pluginsfile + " not found, automatic plugin loading disabled.");
return false;
}
pluginDir = cfg.getSetting("PluginFolder"); // Ignored on Mac OS X, uses Resources/ directory
pluginList = cfg.getMultiSetting("Plugin");
#if OGRE_PLATFORM != OGRE_PLATFORM_APPLE && OGRE_PLATFORM != OGRE_PLATFORM_IPHONE
if (pluginDir.empty())
{
// User didn't specify plugins folder, try current one
pluginDir = ".";
}
#endif
char last_char = pluginDir[pluginDir.length()-1];
if (last_char != '/' && last_char != '\\')
{
#if OGRE_PLATFORM == OGRE_PLATFORM_WIN32
pluginDir += "\\";
#elif OGRE_PLATFORM == OGRE_PLATFORM_LINUX
pluginDir += "/";
#endif
}
for ( Ogre::StringVector::iterator it = pluginList.begin(); it != pluginList.end(); ++it )
{
Ogre::String pluginFilename = pluginDir + (*it);
try
{
m_ogre_root->loadPlugin(pluginFilename);
}
catch(Ogre::Exception &e)
{
LOG("failed to load plugin: " + pluginFilename + ": " + e.getFullDescription());
}
}
return true;
}
示例3: LoadOgrePlugins
bool OgreSubsystem::LoadOgrePlugins(Ogre::String const & pluginsfile)
{
Ogre::ConfigFile cfg;
try
{
cfg.load( pluginsfile );
}
catch (Ogre::Exception e)
{
Ogre::LogManager::getSingleton().logMessage(pluginsfile + " not found, automatic plugin loading disabled. Message: " + e.getFullDescription());
return false;
}
Ogre::String pluginDir = cfg.getSetting("PluginFolder");
Ogre::StringVector pluginList = cfg.getMultiSetting("Plugin");
if (pluginDir.empty())
{
pluginDir = RoR::App::sys_process_dir.GetActive();
}
for ( Ogre::StringVector::iterator it = pluginList.begin(); it != pluginList.end(); ++it )
{
Ogre::String pluginFilename = pluginDir + PATH_SLASH + (*it);
try
{
m_ogre_root->loadPlugin(pluginFilename);
}
catch (Ogre::Exception &e)
{
LOG("failed to load plugin: " + pluginFilename + ": " + e.getFullDescription());
}
}
return true;
}