From 19ed994dc30ed84ea7cbbb5152577669fc25caf6 Mon Sep 17 00:00:00 2001 From: "Boris I. Bendovsky" Date: Sun, 30 Jan 2022 14:47:32 +0200 Subject: Add EAX extensions (EAX 2.0-5.0, X-RAM) (#632) * Add EAX extensions (EAX 2.0-5.0, X-RAM) * Comment out C++17 leftovers * Remove everything related to patching * Update alsoftrc.sample * Rewrite integration * Fix GCC compilation under Linux * Always reset EAX effect properties when loading it into FX slot --- al/effects/null.cpp | 57 +++++++++++++++++++++++++++++++++++++++++++++++++++++ 1 file changed, 57 insertions(+) (limited to 'al/effects/null.cpp') diff --git a/al/effects/null.cpp b/al/effects/null.cpp index 516446db..44595208 100644 --- a/al/effects/null.cpp +++ b/al/effects/null.cpp @@ -7,6 +7,10 @@ #include "alc/effects/base.h" #include "effects.h" +#if ALSOFT_EAX +#include "al/eax_exception.h" +#endif // ALSOFT_EAX + namespace { @@ -91,3 +95,56 @@ EffectProps genDefaultProps() noexcept DEFINE_ALEFFECT_VTABLE(Null); const EffectProps NullEffectProps{genDefaultProps()}; + + +#if ALSOFT_EAX +namespace +{ + + +class EaxNullEffect final : + public EaxEffect +{ +public: + // [[nodiscard]] + bool dispatch( + const EaxEaxCall& eax_call) override; +}; // EaxNullEffect + + +class EaxNullEffectException : + public EaxException +{ +public: + explicit EaxNullEffectException( + const char* message) + : + EaxException{"EAX_NULL_EFFECT", message} + { + } +}; // EaxNullEffectException + + +// [[nodiscard]] +bool EaxNullEffect::dispatch( + const EaxEaxCall& eax_call) +{ + if (eax_call.get_property_id() != 0) + { + throw EaxNullEffectException{"Unsupported property id."}; + } + + return false; +} + + +} // namespace + + +EaxEffectUPtr eax_create_eax_null_effect() +{ + return std::make_unique(); +} + + +#endif // ALSOFT_EAX -- cgit v1.2.3