From c88c5e6189fda16bdc0f9d87d64f5e11a8f1a40a Mon Sep 17 00:00:00 2001 From: "Boris I. Bendovsky" Date: Thu, 14 Jul 2022 20:24:52 +0300 Subject: [EAX_FX_SLOT] Mark sources as changed instead of commiting them to catch up with changes in FX slot --- alc/context.cpp | 7 +------ 1 file changed, 1 insertion(+), 6 deletions(-) (limited to 'alc/context.cpp') diff --git a/alc/context.cpp b/alc/context.cpp index 403c4fa3..3decb5c4 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 source_lock{mSourceLock}; @@ -626,7 +621,7 @@ void ALCcontext::eax_dispatch_fx_slot(const EaxCall& call) if(fx_slot.eax_dispatch(call)) { std::lock_guard source_lock{mSourceLock}; - eax_update_filters(); + ForEachSource(this, [](ALsource& source){ source.eax_mark_as_changed(); }); } } -- cgit v1.2.3 From 51a48e32bac4b83526ff9d21d7fd07b6832ba28d Mon Sep 17 00:00:00 2001 From: "Boris I. Bendovsky" Date: Fri, 15 Jul 2022 11:21:46 +0300 Subject: [EAX_CONTEXT] Fix defaults for current properties --- alc/context.cpp | 40 ++++++++++++++++++++++++++++++++++++---- alc/context.h | 7 +++++-- 2 files changed, 41 insertions(+), 6 deletions(-) (limited to 'alc/context.cpp') 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(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(); -- cgit v1.2.3