aboutsummaryrefslogtreecommitdiffstats
path: root/alc
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
parentc7da1696a4c15910f6b7240ae7cbfc44114bef06 (diff)
Don't change the context's EAX version on every set/get call
Diffstat (limited to 'alc')
-rw-r--r--alc/context.cpp49
-rw-r--r--alc/context.h4
2 files changed, 9 insertions, 44 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)
diff --git a/alc/context.h b/alc/context.h
index d93d63d6..c0f1805c 100644
--- a/alc/context.h
+++ b/alc/context.h
@@ -187,7 +187,6 @@ public:
public:
bool has_eax() const noexcept { return eax_is_initialized_; }
bool eax_is_capable() const noexcept;
- int eax_get_version() const noexcept { return eax_version_; }
void eax_uninitialize() noexcept;
@@ -475,9 +474,6 @@ 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 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();