aboutsummaryrefslogtreecommitdiffstats
path: root/al/filter.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'al/filter.cpp')
-rw-r--r--al/filter.cpp15
1 files changed, 15 insertions, 0 deletions
diff --git a/al/filter.cpp b/al/filter.cpp
index 9ad57b54..e6520e6a 100644
--- a/al/filter.cpp
+++ b/al/filter.cpp
@@ -163,6 +163,8 @@ ALfilter *AllocFilter(ALCdevice *device)
void FreeFilter(ALCdevice *device, ALfilter *filter)
{
+ device->mFilterNames.erase(filter->id);
+
const ALuint id{filter->id - 1};
const size_t lidx{id >> 6};
const ALuint slidx{id & 0x3f};
@@ -671,6 +673,19 @@ FORCE_ALIGN void AL_APIENTRY alGetFilterfvDirect(ALCcontext *context, ALuint fil
}
+void ALfilter::SetName(ALCcontext *context, ALuint id, std::string_view name)
+{
+ ALCdevice *device{context->mALDevice.get()};
+ std::lock_guard<std::mutex> _{device->FilterLock};
+
+ auto filter = LookupFilter(device, id);
+ if(!filter) UNLIKELY
+ return context->setError(AL_INVALID_NAME, "Invalid filter ID %u", id);
+
+ device->mFilterNames.insert_or_assign(id, name);
+}
+
+
FilterSubList::~FilterSubList()
{
if(!Filters)