diff options
author | Kae <80987908+Novaenia@users.noreply.github.com> | 2023-07-21 00:58:49 +1000 |
---|---|---|
committer | Kae <80987908+Novaenia@users.noreply.github.com> | 2023-07-21 00:58:49 +1000 |
commit | 4b0bc220e4da1173f742a4973939b139bef562db (patch) | |
tree | 0ff66d5957575fa814fc10b8cd93e3dd378f45dc /source/base/StarMixer.hpp | |
parent | 607be749451aa40e3619e7ceab0927d1fcec8233 (diff) |
Support for changing the game's timescale
Context-specific (like per-world) timescales can also be added later
Diffstat (limited to 'source/base/StarMixer.hpp')
-rw-r--r-- | source/base/StarMixer.hpp | 6 |
1 files changed, 5 insertions, 1 deletions
diff --git a/source/base/StarMixer.hpp b/source/base/StarMixer.hpp index d369cfb..f87f5be 100644 --- a/source/base/StarMixer.hpp +++ b/source/base/StarMixer.hpp @@ -115,6 +115,9 @@ public: StringList currentEffects(); bool hasEffect(String const& effectName); + // Global speed + void setSpeed(float speed); + // Global volume void setVolume(float volume, float rampTime); @@ -131,7 +134,7 @@ public: // Call within the main loop of the program using Mixer, calculates // positional attenuation of audio and does cleanup. - void update(PositionalAttenuationFunction positionalAttenuationFunction = {}); + void update(float dt, PositionalAttenuationFunction positionalAttenuationFunction = {}); private: struct EffectInfo { @@ -161,6 +164,7 @@ private: List<int16_t> m_mixBuffer; Map<MixerGroup, RampedValue> m_groupVolumes; + atomic<float> m_speed; }; } |