aboutsummaryrefslogtreecommitdiffstats
path: root/alc/alu.cpp
diff options
context:
space:
mode:
authorChris Robinson <chris.kcat@gmail.com>2023-12-24 02:48:20 -0800
committerChris Robinson <chris.kcat@gmail.com>2023-12-24 02:48:20 -0800
commitdae225e88dbf795e776a2c9f2dbe5bb07c2228b9 (patch)
tree8a2e79a24fef5a99b3d0f883ab03cc070a2b584a /alc/alu.cpp
parent29a1001a22891294ab63102e8868bdea52eb7b93 (diff)
Rework effect property handling
To nake EffectProps a variant instead of a union, and avoid manual vtables.
Diffstat (limited to 'alc/alu.cpp')
-rw-r--r--alc/alu.cpp14
1 files changed, 7 insertions, 7 deletions
diff --git a/alc/alu.cpp b/alc/alu.cpp
index 3b4c659f..eb3dee5f 100644
--- a/alc/alu.cpp
+++ b/alc/alu.cpp
@@ -450,14 +450,14 @@ bool CalcEffectSlotParams(EffectSlot *slot, EffectSlot **sorted_slots, ContextBa
slot->Target = props->Target;
slot->EffectType = props->Type;
slot->mEffectProps = props->Props;
- if(props->Type == EffectSlotType::Reverb || props->Type == EffectSlotType::EAXReverb)
+ if(auto *reverbprops = std::get_if<ReverbProps>(&props->Props))
{
- slot->RoomRolloff = props->Props.Reverb.RoomRolloffFactor;
- slot->DecayTime = props->Props.Reverb.DecayTime;
- slot->DecayLFRatio = props->Props.Reverb.DecayLFRatio;
- slot->DecayHFRatio = props->Props.Reverb.DecayHFRatio;
- slot->DecayHFLimit = props->Props.Reverb.DecayHFLimit;
- slot->AirAbsorptionGainHF = props->Props.Reverb.AirAbsorptionGainHF;
+ slot->RoomRolloff = reverbprops->RoomRolloffFactor;
+ slot->DecayTime = reverbprops->DecayTime;
+ slot->DecayLFRatio = reverbprops->DecayLFRatio;
+ slot->DecayHFRatio = reverbprops->DecayHFRatio;
+ slot->DecayHFLimit = reverbprops->DecayHFLimit;
+ slot->AirAbsorptionGainHF = reverbprops->AirAbsorptionGainHF;
}
else
{