Skip to content

Commit

Permalink
🐛 Ensure that limits of reverb parameters are not exceeded if timeste…
Browse files Browse the repository at this point in the history
…p is too large
  • Loading branch information
Hiradur committed Dec 11, 2024
1 parent bc5977a commit f098080
Showing 1 changed file with 2 additions and 1 deletion.
3 changes: 2 additions & 1 deletion source/main/audio/SoundManager.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -526,7 +526,8 @@ void SoundManager::UpdateListenerEffectSlot(const float dt_sec)
void SoundManager::SmoothlyUpdateAlAuxiliaryEffectSlot(const float dt_sec, const ALuint slot_id, const EFXEAXREVERBPROPERTIES* target_efx_properties)
{
const float time_to_target = 0.333f; // seconds to reach the target properties from the current properties
const float step = std::min(dt_sec / time_to_target, 1.0f);
// ensure to not exceed limits of reverb parameters if timestep is too large
const float step = std::min(dt_sec / time_to_target, 0.5f);
static std::map<ALuint, EFXEAXREVERBPROPERTIES> current_efx_properties_of_slot;

if (target_efx_properties == nullptr)
Expand Down

0 comments on commit f098080

Please sign in to comment.