Use the sound manager's update to make sure music is still playing

This commit is contained in:
Chris Robinson 2012-03-20 10:46:10 -07:00
parent 0261aac518
commit 5ae47f783e
3 changed files with 5 additions and 6 deletions

View file

@ -117,11 +117,7 @@ bool OMW::Engine::frameRenderingQueued (const Ogre::FrameEvent& evt)
// sound
if (mUseSound)
{
mEnvironment.mSoundManager->playPlaylist();
mEnvironment.mSoundManager->update (evt.timeSinceLastFrame);
}
// update GUI
Ogre::RenderWindow* window = mOgre->getWindow();

View file

@ -384,6 +384,10 @@ namespace MWSound
{
timePassed = 0.0f;
// Make sure music is still playing
if(!mMusic || !mMusic->isPlaying())
startRandomTitle();
Ogre::Camera *cam = mEnvironment.mWorld->getPlayer().getRenderer()->getCamera();
Ogre::Vector3 nPos, nDir, nUp;
nPos = cam->getRealPosition();

View file

@ -83,10 +83,9 @@ namespace MWSound
bool isMusicPlaying();
///< Returns true if music is playing
void playPlaylist(std::string playlist="");
void playPlaylist(std::string playlist);
///< Start playing music from the selected folder
/// \param name of the folder that contains the playlist
/// if none is set then it plays from the current playlist
void say(MWWorld::Ptr reference, const std::string& filename);
///< Make an actor say some text.