aboutsummaryrefslogtreecommitdiffstats
path: root/al/effects/null.cpp
diff options
context:
space:
mode:
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