mirror of
https://github.com/OpenMW/openmw.git
synced 2025-02-04 00:45:33 +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()
|
void SoundManager::startRandomTitle()
|
||||||
{
|
{
|
||||||
Ogre::StringVectorPtr filelist;
|
Ogre::StringVector filelist;
|
||||||
filelist = mResourceMgr.findResourceNames(Ogre::ResourceGroupManager::DEFAULT_RESOURCE_GROUP_NAME,
|
|
||||||
"Music/"+mCurrentPlaylist+"/*");
|
Ogre::StringVector groups = Ogre::ResourceGroupManager::getSingleton().getResourceGroups ();
|
||||||
if(!filelist->size())
|
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;
|
return;
|
||||||
|
|
||||||
int i = rand()%filelist->size();
|
int i = rand()%filelist.size();
|
||||||
streamMusicFull((*filelist)[i]);
|
streamMusicFull(filelist[i]);
|
||||||
}
|
}
|
||||||
|
|
||||||
bool SoundManager::isMusicPlaying()
|
bool SoundManager::isMusicPlaying()
|
||||||
|
|
Loading…
Reference in a new issue