mirror of
https://github.com/TES3MP/openmw-tes3mp.git
synced 2025-02-21 10:39:39 +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
|
namespace
|
||||||
{
|
{
|
||||||
|
constexpr float sMinUpdateInterval = 1.0f / 30.0f;
|
||||||
|
|
||||||
WaterSoundUpdaterSettings makeWaterSoundUpdaterSettings()
|
WaterSoundUpdaterSettings makeWaterSoundUpdaterSettings()
|
||||||
{
|
{
|
||||||
WaterSoundUpdaterSettings settings;
|
WaterSoundUpdaterSettings settings;
|
||||||
|
@ -946,13 +948,11 @@ namespace MWSound
|
||||||
mSaySoundsQueue.erase(queuesayiter++);
|
mSaySoundsQueue.erase(queuesayiter++);
|
||||||
}
|
}
|
||||||
|
|
||||||
static float timePassed = 0.0;
|
mTimePassed += duration;
|
||||||
|
if (mTimePassed < sMinUpdateInterval)
|
||||||
timePassed += duration;
|
|
||||||
if(timePassed < (1.0f/30.0f))
|
|
||||||
return;
|
return;
|
||||||
duration = timePassed;
|
duration = mTimePassed;
|
||||||
timePassed = 0.0f;
|
mTimePassed = 0.0f;
|
||||||
|
|
||||||
// Make sure music is still playing
|
// Make sure music is still playing
|
||||||
if(!isMusicPlaying() && !mCurrentPlaylist.empty())
|
if(!isMusicPlaying() && !mCurrentPlaylist.empty())
|
||||||
|
|
|
@ -114,6 +114,8 @@ namespace MWSound
|
||||||
|
|
||||||
RegionSoundSelector mRegionSoundSelector;
|
RegionSoundSelector mRegionSoundSelector;
|
||||||
|
|
||||||
|
float mTimePassed = 0;
|
||||||
|
|
||||||
Sound_Buffer *insertSound(const std::string &soundId, const ESM::Sound *sound);
|
Sound_Buffer *insertSound(const std::string &soundId, const ESM::Sound *sound);
|
||||||
|
|
||||||
Sound_Buffer *lookupSound(const std::string &soundId) const;
|
Sound_Buffer *lookupSound(const std::string &soundId) const;
|
||||||
|
|
Loading…
Reference in a new issue