mirror of
https://github.com/TES3MP/TES3MP.git
synced 2025-09-30 08:35:52 -04:00
adding missing cleanup for SoundManager
This commit is contained in:
parent
14e64c180f
commit
0f60898517
@ -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…
x
Reference in New Issue
Block a user