diff options
Diffstat (limited to 'al/auxeffectslot.cpp')
-rw-r--r-- | al/auxeffectslot.cpp | 13 |
1 files changed, 13 insertions, 0 deletions
diff --git a/al/auxeffectslot.cpp b/al/auxeffectslot.cpp index 6f82db71..09db0736 100644 --- a/al/auxeffectslot.cpp +++ b/al/auxeffectslot.cpp @@ -286,6 +286,8 @@ ALeffectslot *AllocEffectSlot(ALCcontext *context) void FreeEffectSlot(ALCcontext *context, ALeffectslot *slot) { + context->mEffectSlotNames.erase(slot->id); + const ALuint id{slot->id - 1}; const size_t lidx{id >> 6}; const ALuint slidx{id & 0x3f}; @@ -962,6 +964,17 @@ void ALeffectslot::updateProps(ALCcontext *context) } } +void ALeffectslot::SetName(ALCcontext* context, ALuint id, std::string_view name) +{ + std::lock_guard<std::mutex> _{context->mEffectSlotLock}; + + auto slot = LookupEffectSlot(context, id); + if(!slot) UNLIKELY + return context->setError(AL_INVALID_NAME, "Invalid effect slot ID %u", id); + + context->mEffectSlotNames.insert_or_assign(id, name); +} + void UpdateAllEffectSlotProps(ALCcontext *context) { std::lock_guard<std::mutex> _{context->mEffectSlotLock}; |