|
|
|
@ -32,6 +32,8 @@ namespace MWSound
|
|
|
|
|
{
|
|
|
|
|
namespace
|
|
|
|
|
{
|
|
|
|
|
constexpr float sMinUpdateInterval = 1.0f / 30.0f;
|
|
|
|
|
|
|
|
|
|
WaterSoundUpdaterSettings makeWaterSoundUpdaterSettings()
|
|
|
|
|
{
|
|
|
|
|
WaterSoundUpdaterSettings settings;
|
|
|
|
@ -885,7 +887,6 @@ namespace MWSound
|
|
|
|
|
|
|
|
|
|
void SoundManager::updateWaterSound(float /*duration*/)
|
|
|
|
|
{
|
|
|
|
|
static const ESM::Cell *LastCell;
|
|
|
|
|
MWBase::World* world = MWBase::Environment::get().getWorld();
|
|
|
|
|
const MWWorld::ConstPtr player = world->getPlayerPtr();
|
|
|
|
|
const ESM::Cell *curcell = player.getCell()->getCell();
|
|
|
|
@ -903,9 +904,9 @@ namespace MWSound
|
|
|
|
|
bool soundIdChanged = false;
|
|
|
|
|
|
|
|
|
|
Sound_Buffer *sfx = lookupSound(update.mId);
|
|
|
|
|
if(LastCell != curcell)
|
|
|
|
|
if (mLastCell != curcell)
|
|
|
|
|
{
|
|
|
|
|
LastCell = curcell;
|
|
|
|
|
mLastCell = curcell;
|
|
|
|
|
SoundMap::const_iterator snditer = mActiveSounds.find(MWWorld::Ptr());
|
|
|
|
|
if(snditer != mActiveSounds.end())
|
|
|
|
|
{
|
|
|
|
@ -930,7 +931,7 @@ namespace MWSound
|
|
|
|
|
}
|
|
|
|
|
else if (update.mVolume > 0.0f)
|
|
|
|
|
{
|
|
|
|
|
LastCell = curcell;
|
|
|
|
|
mLastCell = curcell;
|
|
|
|
|
mNearWaterSound = playSound(update.mId, update.mVolume, 1.0f, Type::Sfx, PlayMode::Loop);
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
@ -946,13 +947,11 @@ namespace MWSound
|
|
|
|
|
mSaySoundsQueue.erase(queuesayiter++);
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
static float timePassed = 0.0;
|
|
|
|
|
|
|
|
|
|
timePassed += duration;
|
|
|
|
|
if(timePassed < (1.0f/30.0f))
|
|
|
|
|
mTimePassed += duration;
|
|
|
|
|
if (mTimePassed < sMinUpdateInterval)
|
|
|
|
|
return;
|
|
|
|
|
duration = timePassed;
|
|
|
|
|
timePassed = 0.0f;
|
|
|
|
|
duration = mTimePassed;
|
|
|
|
|
mTimePassed = 0.0f;
|
|
|
|
|
|
|
|
|
|
// Make sure music is still playing
|
|
|
|
|
if(!isMusicPlaying() && !mCurrentPlaylist.empty())
|
|
|
|
|