diff options
author | Chris Robinson <[email protected]> | 2023-03-09 19:58:42 -0800 |
---|---|---|
committer | Chris Robinson <[email protected]> | 2023-03-09 19:58:42 -0800 |
commit | 5b3c27ea587d84c2a49150b032f5d4dec5eb50b9 (patch) | |
tree | 76c8dfe3bf3a9a30d0d08ebb730bcf9fd5b5bdd4 /al/effects/null.cpp | |
parent | 869778979787320bf254942936f7fb1e951e57ed (diff) |
Store the per-version EAX effect state in the base class
This is the start of the refactoring for holding separable per-version EAX
effects. Currently the effect state is stored in the effect object, which is
instantiated per-type. This makes it impossible for different effects to be
assigned on different EAX versions for a given effect slot (e.g. if the app
sets a Chorus effect on EAX4 Slot0, it would fail to get or set the EAX1/2/3
reverb properties since it's a Chorus effect object).
Seperate per-version effects will allow for switching the OpenAL effect by
switching versions. This will provide an extra benefit in being able to delay
OpenAL effect initialization until some EAX version has been set, avoiding an
extraneous reverb and/or chorus processor for apps that only query some EAX
properties but don't set anything (or which only use Slot0, leaving Slot1 with
a defaulted Chorus effect running).
Diffstat (limited to 'al/effects/null.cpp')
-rw-r--r-- | al/effects/null.cpp | 10 |
1 files changed, 5 insertions, 5 deletions
diff --git a/al/effects/null.cpp b/al/effects/null.cpp index 2243dfe1..5bbcdd62 100644 --- a/al/effects/null.cpp +++ b/al/effects/null.cpp @@ -102,7 +102,7 @@ namespace { class EaxNullEffect final : public EaxEffect { public: - EaxNullEffect() noexcept; + EaxNullEffect(int eax_version) noexcept; void dispatch(const EaxCall& call) override; /*[[nodiscard]]*/ bool commit() override; @@ -117,8 +117,8 @@ public: {} }; // EaxNullEffectException -EaxNullEffect::EaxNullEffect() noexcept - : EaxEffect{AL_EFFECT_NULL} +EaxNullEffect::EaxNullEffect(int eax_version) noexcept + : EaxEffect{AL_EFFECT_NULL, eax_version} {} void EaxNullEffect::dispatch(const EaxCall& call) @@ -134,9 +134,9 @@ bool EaxNullEffect::commit() } // namespace -EaxEffectUPtr eax_create_eax_null_effect() +EaxEffectUPtr eax_create_eax_null_effect(int eax_version) { - return std::make_unique<EaxNullEffect>(); + return std::make_unique<EaxNullEffect>(eax_version); } #endif // ALSOFT_EAX |