aboutsummaryrefslogtreecommitdiffstats
path: root/al/effects/null.cpp
diff options
context:
space:
mode:
authorBoris I. Bendovsky <[email protected]>2022-01-30 14:47:32 +0200
committerGitHub <[email protected]>2022-01-30 04:47:32 -0800
commit19ed994dc30ed84ea7cbbb5152577669fc25caf6 (patch)
treef68933bf8f778806618bd6c0b1bf9ced1b0ccf08 /al/effects/null.cpp
parent619249371a40f03cf988d1f5750d643df797c485 (diff)
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
Diffstat (limited to 'al/effects/null.cpp')
-rw-r--r--al/effects/null.cpp57
1 files changed, 57 insertions, 0 deletions
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<EaxNullEffect>();
+}
+
+
+#endif // ALSOFT_EAX