diff options
-rw-r--r-- | al/auxeffectslot.cpp | 15 | ||||
-rw-r--r-- | al/auxeffectslot.h | 23 |
2 files changed, 10 insertions, 28 deletions
diff --git a/al/auxeffectslot.cpp b/al/auxeffectslot.cpp index a83c39f7..9f35142e 100644 --- a/al/auxeffectslot.cpp +++ b/al/auxeffectslot.cpp @@ -1766,18 +1766,10 @@ void ALeffectslot::eax_set_effect_slot_gain( } -EaxAlEffectSlotDeleter::EaxAlEffectSlotDeleter( - ALCcontext& context) noexcept - : - context_{&context} -{ -} - -void EaxAlEffectSlotDeleter::operator()( - ALeffectslot* effect_slot) +void ALeffectslot::EaxDeleter::operator()(ALeffectslot* effect_slot) { assert(effect_slot); - eax_delete_al_effect_slot(*context_, *effect_slot); + eax_delete_al_effect_slot(*effect_slot->eax_al_context_, *effect_slot); } @@ -1802,8 +1794,7 @@ EaxAlEffectSlotUPtr eax_create_al_effect_slot( return nullptr; } - auto effect_slot = EaxAlEffectSlotUPtr{AllocEffectSlot(&context), EaxAlEffectSlotDeleter{context}}; - + auto effect_slot = EaxAlEffectSlotUPtr{AllocEffectSlot(&context)}; if (!effect_slot) { ERR(EAX_PREFIX "%s\n", "Failed to allocate."); diff --git a/al/auxeffectslot.h b/al/auxeffectslot.h index 94a61cfc..2c99f330 100644 --- a/al/auxeffectslot.h +++ b/al/auxeffectslot.h @@ -249,29 +249,20 @@ private: // `alAuxiliaryEffectSlotf(effect_slot, AL_EFFECTSLOT_GAIN, gain)` void eax_set_effect_slot_gain(ALfloat gain); + +public: + class EaxDeleter { + public: + void operator()(ALeffectslot *effect_slot); + }; // EaxAlEffectSlotDeleter #endif // ALSOFT_EAX }; void UpdateAllEffectSlotProps(ALCcontext *context); #ifdef ALSOFT_EAX -class EaxAlEffectSlotDeleter -{ -public: - EaxAlEffectSlotDeleter() noexcept = default; - - EaxAlEffectSlotDeleter( - ALCcontext& context) noexcept; - - void operator()( - ALeffectslot* effect_slot); - - -private: - ALCcontext* context_{}; -}; // EaxAlEffectSlotDeleter -using EaxAlEffectSlotUPtr = std::unique_ptr<ALeffectslot, EaxAlEffectSlotDeleter>; +using EaxAlEffectSlotUPtr = std::unique_ptr<ALeffectslot, ALeffectslot::EaxDeleter>; EaxAlEffectSlotUPtr eax_create_al_effect_slot( |