aboutsummaryrefslogtreecommitdiffstats
path: root/alc
diff options
context:
space:
mode:
authorBoris I. Bendovsky <[email protected]>2022-07-15 11:21:46 +0300
committerBoris I. Bendovsky <[email protected]>2022-07-17 20:59:07 +0300
commit51a48e32bac4b83526ff9d21d7fd07b6832ba28d (patch)
tree2e4af2335a41d77ca5ba9ec8b4663b23f96d813a /alc
parente24f124a89ebba6063e67189c2d4c45bd8946ef3 (diff)
[EAX_CONTEXT] Fix defaults for current properties
Diffstat (limited to 'alc')
-rw-r--r--alc/context.cpp40
-rw-r--r--alc/context.h7
2 files changed, 41 insertions, 6 deletions
diff --git a/alc/context.cpp b/alc/context.cpp
index 3decb5c4..86c76aaa 100644
--- a/alc/context.cpp
+++ b/alc/context.cpp
@@ -595,16 +595,48 @@ void ALCcontext::eax5_context_set_defaults(Eax5State& state) noexcept
state.d = state.i;
}
-void ALCcontext::eax_context_set_defaults() noexcept
+void ALCcontext::eax4_context_set_current_defaults(const Eax4Props& props) noexcept
+{
+ static_cast<Eax4Props&>(eax_) = props;
+ eax_.flMacroFXFactor = EAXCONTEXT_DEFAULTMACROFXFACTOR;
+}
+
+void ALCcontext::eax5_context_set_current_defaults(const Eax5Props& props) noexcept
+{
+ eax_ = props;
+}
+
+void ALCcontext::eax_context_set_current_defaults()
+{
+ switch(eax_version_)
+ {
+ case 1:
+ case 2:
+ case 3:
+ eax5_context_set_current_defaults(eax123_.i);
+ break;
+ case 4:
+ eax4_context_set_current_defaults(eax4_.i);
+ break;
+ case 5:
+ eax5_context_set_current_defaults(eax5_.i);
+ break;
+ default:
+ eax_fail_unknown_version();
+ }
+
+ eax_df_ = ~EaxDirtyFlags{};
+}
+
+void ALCcontext::eax_context_set_defaults()
{
eax5_context_set_defaults(eax123_);
eax4_context_set_defaults(eax4_);
eax5_context_set_defaults(eax5_);
- eax_ = eax5_.i;
- eax_df_ = ~EaxDirtyFlags{};
+ eax_context_set_current_defaults();
}
-void ALCcontext::eax_set_defaults() noexcept
+void ALCcontext::eax_set_defaults()
{
eax_set_last_error_defaults();
eax_session_set_defaults();
diff --git a/alc/context.h b/alc/context.h
index a4a4aea9..448ae980 100644
--- a/alc/context.h
+++ b/alc/context.h
@@ -474,8 +474,11 @@ private:
static void eax4_context_set_defaults(Eax4State& state) noexcept;
static void eax5_context_set_defaults(Eax5Props& props) noexcept;
static void eax5_context_set_defaults(Eax5State& state) noexcept;
- void eax_context_set_defaults() noexcept;
- void eax_set_defaults() noexcept;
+ void eax4_context_set_current_defaults(const Eax4Props& props) noexcept;
+ void eax5_context_set_current_defaults(const Eax5Props& props) noexcept;
+ void eax_context_set_current_defaults();
+ void eax_context_set_defaults();
+ void eax_set_defaults();
void eax_initialize_sources();