mirror of
				https://github.com/OpenMW/openmw.git
				synced 2025-10-31 13:56:38 +00:00 
			
		
		
		
	Fix startRandomTitle
This commit is contained in:
		
							parent
							
								
									ebaf80d539
								
							
						
					
					
						commit
						48a88f1917
					
				
					 1 changed files with 13 additions and 6 deletions
				
			
		|  | @ -208,14 +208,21 @@ namespace MWSound | |||
| 
 | ||||
|     void SoundManager::startRandomTitle() | ||||
|     { | ||||
|         Ogre::StringVectorPtr filelist; | ||||
|         filelist = mResourceMgr.findResourceNames(Ogre::ResourceGroupManager::DEFAULT_RESOURCE_GROUP_NAME, | ||||
|                                                   "Music/"+mCurrentPlaylist+"/*"); | ||||
|         if(!filelist->size()) | ||||
|         Ogre::StringVector filelist; | ||||
| 
 | ||||
|         Ogre::StringVector groups = Ogre::ResourceGroupManager::getSingleton().getResourceGroups (); | ||||
|         for (Ogre::StringVector::iterator it = groups.begin(); it != groups.end(); ++it) | ||||
|         { | ||||
|             Ogre::StringVectorPtr resourcesInThisGroup = mResourceMgr.findResourceNames(*it, | ||||
|                                                                                         "Music/"+mCurrentPlaylist+"/*"); | ||||
|             filelist.insert(filelist.end(), resourcesInThisGroup->begin(), resourcesInThisGroup->end()); | ||||
|         } | ||||
| 
 | ||||
|         if(!filelist.size()) | ||||
|             return; | ||||
| 
 | ||||
|         int i = rand()%filelist->size(); | ||||
|         streamMusicFull((*filelist)[i]); | ||||
|         int i = rand()%filelist.size(); | ||||
|         streamMusicFull(filelist[i]); | ||||
|     } | ||||
| 
 | ||||
|     bool SoundManager::isMusicPlaying() | ||||
|  |  | |||
		Loading…
	
		Reference in a new issue