aboutsummaryrefslogtreecommitdiffstats
path: root/alc/context.cpp
diff options
context:
space:
mode:
authorChris Robinson <[email protected]>2023-03-11 23:03:53 -0800
committerChris Robinson <[email protected]>2023-03-11 23:03:53 -0800
commit01521b684998c43a7bd4d062af9858961379fecb (patch)
treeee634f7dce3d0fa152e9d83329b37cf562389afc /alc/context.cpp
parentc7da1696a4c15910f6b7240ae7cbfc44114bef06 (diff)
Don't change the context's EAX version on every set/get call
Diffstat (limited to 'alc/context.cpp')
-rw-r--r--alc/context.cpp49
1 files changed, 9 insertions, 40 deletions
diff --git a/alc/context.cpp b/alc/context.cpp
index 16acb0e8..352db31d 100644
--- a/alc/context.cpp
+++ b/alc/context.cpp
@@ -327,10 +327,6 @@ ALenum ALCcontext::eax_eax_set(
property_value,
property_value_size);
- const auto eax_version = call.get_version();
- if(eax_version != eax_version_)
- eax_df_ = ~EaxDirtyFlags();
- eax_version_ = eax_version;
eax_initialize();
switch(call.get_property_set_id())
@@ -373,7 +369,7 @@ ALenum ALCcontext::eax_eax_get(
property_source_id,
property_value,
property_value_size);
- eax_version_ = call.get_version();
+
eax_initialize();
switch(call.get_property_set_id())
@@ -609,45 +605,14 @@ void ALCcontext::eax5_context_set_defaults(Eax5State& state) noexcept
state.d = state.i;
}
-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_context_set_current_defaults();
+ eax_ = eax5_.i;
+ eax_version_ = 5;
+ eax_df_ = EaxDirtyFlags{};
}
void ALCcontext::eax_set_defaults()
@@ -941,12 +906,16 @@ void ALCcontext::eax5_defer(const EaxCall& call, Eax5State& state)
void ALCcontext::eax_set(const EaxCall& call)
{
- switch(call.get_version())
+ const auto version = call.get_version();
+ switch(version)
{
case 4: eax4_defer(call, eax4_); break;
case 5: eax5_defer(call, eax5_); break;
default: eax_fail_unknown_version();
}
+ if(version != eax_version_)
+ eax_df_ = ~EaxDirtyFlags();
+ eax_version_ = version;
}
void ALCcontext::eax4_context_commit(Eax4State& state, EaxDirtyFlags& dst_df)