mirror of
https://github.com/TES3MP/openmw-tes3mp.git
synced 2025-07-21 23:44:04 +00:00
adding missing cleanup for SoundManager
This commit is contained in:
parent
14e64c180f
commit
0f60898517
4 changed files with 15 additions and 0 deletions
|
@ -147,6 +147,8 @@ namespace MWBase
|
||||||
virtual void update(float duration) = 0;
|
virtual void update(float duration) = 0;
|
||||||
|
|
||||||
virtual void setListenerPosDir(const Ogre::Vector3 &pos, const Ogre::Vector3 &dir, const Ogre::Vector3 &up) = 0;
|
virtual void setListenerPosDir(const Ogre::Vector3 &pos, const Ogre::Vector3 &dir, const Ogre::Vector3 &up) = 0;
|
||||||
|
|
||||||
|
virtual void clear() = 0;
|
||||||
};
|
};
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
@ -705,4 +705,13 @@ namespace MWSound
|
||||||
{
|
{
|
||||||
return bytes / framesToBytes(1, config, type);
|
return bytes / framesToBytes(1, config, type);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
void SoundManager::clear()
|
||||||
|
{
|
||||||
|
for (SoundMap::iterator iter (mActiveSounds.begin()); iter!=mActiveSounds.end(); ++iter)
|
||||||
|
iter->first->stop();
|
||||||
|
|
||||||
|
mActiveSounds.clear();
|
||||||
|
stopMusic();
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
|
@ -148,6 +148,8 @@ namespace MWSound
|
||||||
virtual void update(float duration);
|
virtual void update(float duration);
|
||||||
|
|
||||||
virtual void setListenerPosDir(const Ogre::Vector3 &pos, const Ogre::Vector3 &dir, const Ogre::Vector3 &up);
|
virtual void setListenerPosDir(const Ogre::Vector3 &pos, const Ogre::Vector3 &dir, const Ogre::Vector3 &up);
|
||||||
|
|
||||||
|
virtual void clear();
|
||||||
};
|
};
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
@ -15,6 +15,7 @@
|
||||||
#include "../mwbase/windowmanager.hpp"
|
#include "../mwbase/windowmanager.hpp"
|
||||||
#include "../mwbase/mechanicsmanager.hpp"
|
#include "../mwbase/mechanicsmanager.hpp"
|
||||||
#include "../mwbase/scriptmanager.hpp"
|
#include "../mwbase/scriptmanager.hpp"
|
||||||
|
#include "../mwbase/soundmanager.hpp"
|
||||||
|
|
||||||
#include "../mwworld/player.hpp"
|
#include "../mwworld/player.hpp"
|
||||||
#include "../mwworld/class.hpp"
|
#include "../mwworld/class.hpp"
|
||||||
|
@ -27,6 +28,7 @@ void MWState::StateManager::cleanup()
|
||||||
{
|
{
|
||||||
if (mState!=State_NoGame)
|
if (mState!=State_NoGame)
|
||||||
{
|
{
|
||||||
|
MWBase::Environment::get().getSoundManager()->clear();
|
||||||
MWBase::Environment::get().getDialogueManager()->clear();
|
MWBase::Environment::get().getDialogueManager()->clear();
|
||||||
MWBase::Environment::get().getJournal()->clear();
|
MWBase::Environment::get().getJournal()->clear();
|
||||||
MWBase::Environment::get().getScriptManager()->getGlobalScripts().clear();
|
MWBase::Environment::get().getScriptManager()->getGlobalScripts().clear();
|
||||||
|
|
Loading…
Reference in a new issue