mirror of
https://github.com/TES3MP/openmw-tes3mp.git
synced 2025-02-19 18:09:50 +00:00
Make time passed SoundManager field
This commit is contained in:
parent
978b9e9285
commit
3fa1e7ebaf
2 changed files with 8 additions and 6 deletions
|
@ -32,6 +32,8 @@ namespace MWSound
|
|||
{
|
||||
namespace
|
||||
{
|
||||
constexpr float sMinUpdateInterval = 1.0f / 30.0f;
|
||||
|
||||
WaterSoundUpdaterSettings makeWaterSoundUpdaterSettings()
|
||||
{
|
||||
WaterSoundUpdaterSettings settings;
|
||||
|
@ -946,13 +948,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())
|
||||
|
|
|
@ -114,6 +114,8 @@ namespace MWSound
|
|||
|
||||
RegionSoundSelector mRegionSoundSelector;
|
||||
|
||||
float mTimePassed = 0;
|
||||
|
||||
Sound_Buffer *insertSound(const std::string &soundId, const ESM::Sound *sound);
|
||||
|
||||
Sound_Buffer *lookupSound(const std::string &soundId) const;
|
||||
|
|
Loading…
Reference in a new issue