[EAX_CONTEXT] Fix defaults for current properties

This commit is contained in:
Boris I. Bendovsky 2022-07-15 11:21:46 +03:00
parent e24f124a89
commit 51a48e32ba
No known key found for this signature in database
GPG Key ID: 48CD539C0518594B
2 changed files with 41 additions and 6 deletions

View File

@ -595,16 +595,48 @@ void ALCcontext::eax5_context_set_defaults(Eax5State& state) noexcept
state.d = state.i; 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_); eax5_context_set_defaults(eax123_);
eax4_context_set_defaults(eax4_); eax4_context_set_defaults(eax4_);
eax5_context_set_defaults(eax5_); eax5_context_set_defaults(eax5_);
eax_ = eax5_.i; eax_context_set_current_defaults();
eax_df_ = ~EaxDirtyFlags{};
} }
void ALCcontext::eax_set_defaults() noexcept void ALCcontext::eax_set_defaults()
{ {
eax_set_last_error_defaults(); eax_set_last_error_defaults();
eax_session_set_defaults(); eax_session_set_defaults();

View File

@ -474,8 +474,11 @@ private:
static void eax4_context_set_defaults(Eax4State& state) noexcept; static void eax4_context_set_defaults(Eax4State& state) noexcept;
static void eax5_context_set_defaults(Eax5Props& props) noexcept; static void eax5_context_set_defaults(Eax5Props& props) noexcept;
static void eax5_context_set_defaults(Eax5State& state) noexcept; static void eax5_context_set_defaults(Eax5State& state) noexcept;
void eax_context_set_defaults() noexcept; void eax4_context_set_current_defaults(const Eax4Props& props) noexcept;
void eax_set_defaults() 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(); void eax_initialize_sources();