diff options
author | Chris Robinson <[email protected]> | 2022-07-13 05:09:42 -0700 |
---|---|---|
committer | Chris Robinson <[email protected]> | 2022-07-13 05:19:51 -0700 |
commit | c843efd3225e53317d955dfe3550d2669f11639e (patch) | |
tree | e55b74e0d9e3aa8193b446115a4ac3e2965775fb /alc/context.h | |
parent | 86094e87a575ef621d5d2550ed807ffeb6e5036d (diff) |
Don't track dirty flags per EAX version
Only the current version's flags are used, and they're all reset when changing
versions, making it unnecessary to track non-current version flags.
Diffstat (limited to 'alc/context.h')
-rw-r--r-- | alc/context.h | 23 |
1 files changed, 7 insertions, 16 deletions
diff --git a/alc/context.h b/alc/context.h index 9317455d..9095b00a 100644 --- a/alc/context.h +++ b/alc/context.h @@ -234,7 +234,6 @@ private: struct Eax4State { Eax4Props i; // Immediate. Eax4Props d; // Deferred. - EaxDirtyFlags df; // Dirty flags. }; using Eax5Props = EAX50CONTEXTPROPERTIES; @@ -242,7 +241,6 @@ private: struct Eax5State { Eax5Props i; // Immediate. Eax5Props d; // Deferred. - EaxDirtyFlags df; // Dirty flags. }; class ContextException : public EaxException @@ -397,6 +395,7 @@ private: EaxFxSlots eax_fx_slots_{}; int eax_version_{}; // Current EAX version. + EaxDirtyFlags eax_df_{}; // Dirty flags for the current EAX version. Eax5State eax123_{}; // EAX1/EAX2/EAX3 state. Eax4State eax4_{}; // EAX4 state. Eax5State eax5_{}; // EAX5 state. @@ -432,10 +431,7 @@ private: typename TMemberResult, typename TProps, typename TState> - static void eax_defer( - const EaxCall& call, - TState& state, - TMemberResult TProps::*member) noexcept + void eax_defer(const EaxCall& call, TState& state, TMemberResult TProps::*member) noexcept { const auto& src = call.get_value<ContextException, const TMemberResult>(); TValidator{}(src); @@ -444,7 +440,7 @@ private: dst_d = src; if(dst_i != dst_d) - state.df |= TDirtyBit; + eax_df_ |= TDirtyBit; } template< @@ -452,18 +448,13 @@ private: typename TMemberResult, typename TProps, typename TState> - void eax_context_commit_property( - TState& state, - EaxDirtyFlags& dst_df, + void eax_context_commit_property(TState& state, EaxDirtyFlags& dst_df, TMemberResult TProps::*member) noexcept { - auto& src_i = state.i; - auto& src_df = state.df; - auto& dst_i = eax_; - - if ((src_df & TDirtyBit) != EaxDirtyFlags{}) { + if((eax_df_ & TDirtyBit) != EaxDirtyFlags{}) + { dst_df |= TDirtyBit; - dst_i.*member = src_i.*member; + eax_.*member = state.i.*member; } } |