aboutsummaryrefslogtreecommitdiffstats
path: root/alc/effects/pshifter.cpp
diff options
context:
space:
mode:
authorChris Robinson <[email protected]>2023-12-24 02:48:20 -0800
committerChris Robinson <[email protected]>2023-12-24 02:48:20 -0800
commitdae225e88dbf795e776a2c9f2dbe5bb07c2228b9 (patch)
tree8a2e79a24fef5a99b3d0f883ab03cc070a2b584a /alc/effects/pshifter.cpp
parent29a1001a22891294ab63102e8868bdea52eb7b93 (diff)
Rework effect property handling
To nake EffectProps a variant instead of a union, and avoid manual vtables.
Diffstat (limited to 'alc/effects/pshifter.cpp')
-rw-r--r--alc/effects/pshifter.cpp5
1 files changed, 3 insertions, 2 deletions
diff --git a/alc/effects/pshifter.cpp b/alc/effects/pshifter.cpp
index 9714510f..1cc1a18c 100644
--- a/alc/effects/pshifter.cpp
+++ b/alc/effects/pshifter.cpp
@@ -138,9 +138,10 @@ void PshifterState::deviceUpdate(const DeviceBase*, const BufferStorage*)
}
void PshifterState::update(const ContextBase*, const EffectSlot *slot,
- const EffectProps *props, const EffectTarget target)
+ const EffectProps *props_, const EffectTarget target)
{
- const int tune{props->Pshifter.CoarseTune*100 + props->Pshifter.FineTune};
+ auto &props = std::get<PshifterProps>(*props_);
+ const int tune{props.CoarseTune*100 + props.FineTune};
const float pitch{std::pow(2.0f, static_cast<float>(tune) / 1200.0f)};
mPitchShiftI = clampu(fastf2u(pitch*MixerFracOne), MixerFracHalf, MixerFracOne*2);
mPitchShift = static_cast<float>(mPitchShiftI) * float{1.0f/MixerFracOne};