aboutsummaryrefslogtreecommitdiffstats
path: root/alc/context.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'alc/context.cpp')
-rw-r--r--alc/context.cpp47
1 files changed, 37 insertions, 10 deletions
diff --git a/alc/context.cpp b/alc/context.cpp
index 403c4fa3..86c76aaa 100644
--- a/alc/context.cpp
+++ b/alc/context.cpp
@@ -384,11 +384,6 @@ ALenum ALCcontext::eax_eax_get(
return AL_NO_ERROR;
}
-void ALCcontext::eax_update_filters()
-{
- ForEachSource(this, [](ALsource& source){ source.eax_commit(); });
-}
-
void ALCcontext::eax_commit_and_update_sources()
{
std::unique_lock<std::mutex> source_lock{mSourceLock};
@@ -600,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();
@@ -626,7 +653,7 @@ void ALCcontext::eax_dispatch_fx_slot(const EaxCall& call)
if(fx_slot.eax_dispatch(call))
{
std::lock_guard<std::mutex> source_lock{mSourceLock};
- eax_update_filters();
+ ForEachSource(this, [](ALsource& source){ source.eax_mark_as_changed(); });
}
}