-----------------------------------------------------------------------------------
| 715 | } |
| 716 | //----------------------------------------------------------------------------------- |
| 717 | void GraphicsSystem::registerHlms() |
| 718 | { |
| 719 | Ogre::ConfigFile cf; |
| 720 | cf.load( AndroidSystems::openFile( mResourcePath + "resources2.cfg" ) ); |
| 721 | |
| 722 | #if OGRE_PLATFORM == OGRE_PLATFORM_APPLE || OGRE_PLATFORM == OGRE_PLATFORM_APPLE_IOS |
| 723 | Ogre::String rootHlmsFolder = |
| 724 | Ogre::macBundlePath() + '/' + cf.getSetting( "DoNotUseAsResource", "Hlms", "" ); |
| 725 | #else |
| 726 | Ogre::String rootHlmsFolder = mResourcePath + cf.getSetting( "DoNotUseAsResource", "Hlms", "" ); |
| 727 | #endif |
| 728 | |
| 729 | if( rootHlmsFolder.empty() ) |
| 730 | rootHlmsFolder = AndroidSystems::isAndroid() ? "/" : "./"; |
| 731 | else if( *( rootHlmsFolder.end() - 1 ) != '/' ) |
| 732 | rootHlmsFolder += "/"; |
| 733 | |
| 734 | // At this point rootHlmsFolder should be a valid path to the Hlms data folder |
| 735 | |
| 736 | Ogre::HlmsUnlit *hlmsUnlit = 0; |
| 737 | Ogre::HlmsPbs *hlmsPbs = 0; |
| 738 | |
| 739 | // For retrieval of the paths to the different folders needed |
| 740 | Ogre::String mainFolderPath; |
| 741 | Ogre::StringVector libraryFoldersPaths; |
| 742 | Ogre::StringVector::const_iterator libraryFolderPathIt; |
| 743 | Ogre::StringVector::const_iterator libraryFolderPathEn; |
| 744 | |
| 745 | Ogre::ArchiveManager &archiveManager = Ogre::ArchiveManager::getSingleton(); |
| 746 | |
| 747 | const Ogre::String &archiveType = getMediaReadArchiveType(); |
| 748 | |
| 749 | { |
| 750 | // Create & Register HlmsUnlit |
| 751 | // Get the path to all the subdirectories used by HlmsUnlit |
| 752 | Ogre::HlmsUnlit::getDefaultPaths( mainFolderPath, libraryFoldersPaths ); |
| 753 | Ogre::Archive *archiveUnlit = |
| 754 | archiveManager.load( rootHlmsFolder + mainFolderPath, archiveType, true ); |
| 755 | Ogre::ArchiveVec archiveUnlitLibraryFolders; |
| 756 | libraryFolderPathIt = libraryFoldersPaths.begin(); |
| 757 | libraryFolderPathEn = libraryFoldersPaths.end(); |
| 758 | while( libraryFolderPathIt != libraryFolderPathEn ) |
| 759 | { |
| 760 | Ogre::Archive *archiveLibrary = |
| 761 | archiveManager.load( rootHlmsFolder + *libraryFolderPathIt, archiveType, true ); |
| 762 | archiveUnlitLibraryFolders.push_back( archiveLibrary ); |
| 763 | ++libraryFolderPathIt; |
| 764 | } |
| 765 | |
| 766 | // Create and register the unlit Hlms |
| 767 | hlmsUnlit = OGRE_NEW Ogre::HlmsUnlit( archiveUnlit, &archiveUnlitLibraryFolders ); |
| 768 | Ogre::Root::getSingleton().getHlmsManager()->registerHlms( hlmsUnlit ); |
| 769 | } |
| 770 | |
| 771 | { |
| 772 | // Create & Register HlmsPbs |
| 773 | // Do the same for HlmsPbs: |
| 774 | Ogre::HlmsPbs::getDefaultPaths( mainFolderPath, libraryFoldersPaths ); |
nothing calls this directly
no test coverage detected