Esempio n. 1
0
    void SoundManager::startRandomTitle()
    {
        Ogre::StringVectorPtr filelist;
        filelist = mResourceMgr.findResourceNames(Ogre::ResourceGroupManager::DEFAULT_RESOURCE_GROUP_NAME,
                                                  "Music/"+mCurrentPlaylist+"/*");
        if(!filelist->size())
            return;

        int i = rand()%filelist->size();
        streamMusicFull((*filelist)[i]);
    }
Esempio n. 2
0
void MainWindow::updateLevels()
{
    try
    {
        ClientPluginManager& pluginManager = EditorGlobals::mGrid->getActiveServer().getPluginManager();
        LevelManager& levelManager = pluginManager.getPlugin<LevelManager>();
        ResourceManager& resourceManager = pluginManager.getPlugin<ResourceManager>();
        Ogre::StringVectorPtr levels = levelManager.list();

        int numListLevels = qMin( levels->size(), (std::size_t)cMaxLevels );

        for( int i = 0; i < numListLevels; ++i ) 
        {
            Path filePath = resourceManager.getResourcePath() / levels->at( i );
            QString file = QString( filePath.string().c_str() );
            QString text = tr( "&%1 %2" ).arg( i + 1 ).arg( strippedName( file ) );
            mLevelActions[i]->setText( text );
            mLevelActions[i]->setData( file );
            mLevelActions[i]->setVisible( true );
        }

        for( int i = numListLevels; i < cMaxLevels; ++i )
            mLevelActions[i]->setVisible( false );
    }
    catch( Exception e )
    {
        // Ignore error	
    }
}
Esempio n. 3
0
 void ResourceManager::DestroyAssetGroup(const String& GroupName)
 {
     for( std::vector<String>::iterator it = ResourceGroups.begin() ; it != ResourceGroups.end() ; it++ )
     {
         if(GroupName == (*it))
         {
             ResourceGroups.erase(it);
             break;
         }
     }
     /// @todo This is a bit of a hack, but needs to be here until we can upgrade our resource system.
     Ogre::StringVectorPtr ResourceNames = this->OgreResource->listResourceNames(GroupName,false);
     for( Whole X = 0 ; X < ResourceNames->size() ; ++X )
     {
         if(ResourceNames->at(X).find(".mesh"))
         {
             MeshManager::GetSingletonPtr()->UnloadMesh(ResourceNames->at(X));
         }
     }
     this->OgreResource->destroyResourceGroup(GroupName);
 }