1
0
Fork 0
mirror of https://github.com/OpenMW/openmw.git synced 2025-02-01 11:45:34 +00:00

Update say sound queue explicitly once per frame

This commit is contained in:
Capostrophic 2019-05-26 18:46:53 +03:00
parent 4c2b694b29
commit c975dab7c3

View file

@ -994,6 +994,15 @@ namespace MWSound
void SoundManager::updateSounds(float duration)
{
// We update active say sounds map for specific actors here
// because for vanilla compatibility we can't do it immediately.
SaySoundMap::iterator queuesayiter = mSaySoundsQueue.begin();
while (queuesayiter != mSaySoundsQueue.end())
{
mActiveSaySounds[queuesayiter->first] = queuesayiter->second;
mSaySoundsQueue.erase(queuesayiter++);
}
static float timePassed = 0.0;
timePassed += duration;
@ -1076,14 +1085,7 @@ namespace MWSound
++snditer;
}
SaySoundMap::iterator sayiter = mSaySoundsQueue.begin();
while (sayiter != mSaySoundsQueue.end())
{
mActiveSaySounds[sayiter->first] = sayiter->second;
mSaySoundsQueue.erase(sayiter++);
}
sayiter = mActiveSaySounds.begin();
SaySoundMap::iterator sayiter = mActiveSaySounds.begin();
while (sayiter != mActiveSaySounds.end())
{
MWWorld::ConstPtr ptr = sayiter->first;