]]>OGRE璧勬簮綆$悊鍒嗘瀽http://m.shnenglu.com/fengyue/archive/2011/11/23/160783.html椋庢偊椋庢偊Wed, 23 Nov 2011 03:07:00 GMThttp://m.shnenglu.com/fengyue/archive/2011/11/23/160783.htmlhttp://m.shnenglu.com/fengyue/comments/160783.htmlhttp://m.shnenglu.com/fengyue/archive/2011/11/23/160783.html#Feedback0http://m.shnenglu.com/fengyue/comments/commentRss/160783.htmlhttp://m.shnenglu.com/fengyue/services/trackbacks/160783.htmlOGRE鐨勬枃浠剁郴緇熸瘮杈冨鏉傦紝涓嶇啛鎮夌殑浜轟笉鐭ラ亾鎬庝箞浣跨敤錛岀粡甯稿嚭鐜版壘涓嶅埌璧勬簮鐨勯棶棰橈紝鍦ㄨ繖閲岀畝鍗曚粙緇嶄竴涓嬭祫婧愯礬寰勭殑璁劇疆錛?br />璧勬簮璺緞鍙互閫氳繃紼嬪簭璁劇疆涔熷彲浠ラ氳繃閰嶇疆鏂瑰紡: 閰嶇疆鏂瑰紡 resources.cfg灝辨槸鐢ㄦ潵閰嶇疆璧勬簮鐨勮礬寰勭殑錛屽唴瀹瑰涓嬶細 # Resource locations to be added to the 'boostrap' path # This also contains the minimum you need to use the Ogre example framework [Bootstrap] Zip=../../Media/packs/OgreCore.zip
# Resource locations to be added to the default path [General] FileSystem=../../Media FileSystem=../../Media/fonts FileSystem=../../Media/materials/programs FileSystem=../../Media/materials/scripts FileSystem=../../Media/materials/textures FileSystem=../../Media/models FileSystem=../../Media/overlays FileSystem=../../Media/particle FileSystem=../../Media/gui FileSystem=../../Media/DeferredShadingMedia Zip=../../Media/packs/cubemap.zip Zip=../../Media/packs/cubemapsJS.zip Zip=../../Media/packs/dragon.zip Zip=../../Media/packs/fresneldemo.zip Zip=../../Media/packs/ogretestmap.zip Zip=../../Media/packs/skybox.zip
1virtualvoid setupResources(void) 2{ 3// Load resource paths from config file 4 ConfigFile cf; 5 cf.load(mResourcePath +"resources.cfg"); 6 7// Go through all sections & settings in the file 8 ConfigFile::SectionIterator seci = cf.getSectionIterator(); 9 10 String secName, typeName, archName; 11while (seci.hasMoreElements()) 12{ 13 secName = seci.peekNextKey(); 14 ConfigFile::SettingsMultiMap *settings = seci.getNext(); 15 ConfigFile::SettingsMultiMap::iterator i; 16for (i = settings->begin(); i != settings->end(); ++i) 17{ 18 typeName = i->first; 19 archName = i->second; 20#if OGRE_PLATFORM == OGRE_PLATFORM_APPLE 21// OS X does not set the working directory relative to the app, 22// In order to make things portable on OS X we need to provide 23// the loading with it's own bundle path location 24 ResourceGroupManager::getSingleton().addResourceLocation( 25 String(macBundlePath() +"/"+ archName), typeName, secName); 26#else 27 ResourceGroupManager::getSingleton().addResourceLocation( 28 archName, typeName, secName); 29#endif 30 } 31 } 32 }