Code: Select all
/// Method which will define the source of resources (other than current folder)
virtual void setupResources(void)
{
// Load resource paths from config file
ConfigFile cf;
#if OGRE_DEBUG_MODE
cf.load(mResourcePath + "resources_d.cfg");
#else
cf.load(mResourcePath + "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;
#if OGRE_PLATFORM == OGRE_PLATFORM_APPLE || OGRE_PLATFORM == OGRE_PLATFORM_IPHONE
// 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 (!StringUtil::startsWith(archName, "/", false)) // only adjust relative dirs
archName = String(macBundlePath() + "/" + archName);
#endif
ResourceGroupManager::getSingleton().addResourceLocation(
archName, typeName, secName);
}
}
}