From 2c06ec709324b7aebdb71961a428362cfcafa68f Mon Sep 17 00:00:00 2001 From: Chris Robinson Date: Sun, 18 Nov 2018 19:19:35 -0800 Subject: Use a regular vector for the enumerated HRTF list --- Alc/panning.cpp | 21 +++++++++------------ 1 file changed, 9 insertions(+), 12 deletions(-) (limited to 'Alc/panning.cpp') diff --git a/Alc/panning.cpp b/Alc/panning.cpp index 020d8237..d5c8bbdf 100644 --- a/Alc/panning.cpp +++ b/Alc/panning.cpp @@ -1104,33 +1104,30 @@ void aluInitRenderer(ALCdevice *device, ALint hrtf_id, enum HrtfRequestMode hrtf device->HrtfStatus = ALC_HRTF_REQUIRED_SOFT; } - if(VECTOR_SIZE(device->HrtfList) == 0) - { - VECTOR_DEINIT(device->HrtfList); + if(device->HrtfList.empty()) device->HrtfList = EnumerateHrtf(device->DeviceName.c_str()); - } - if(hrtf_id >= 0 && (size_t)hrtf_id < VECTOR_SIZE(device->HrtfList)) + if(hrtf_id >= 0 && (size_t)hrtf_id < device->HrtfList.size()) { - const EnumeratedHrtf *entry = &VECTOR_ELEM(device->HrtfList, hrtf_id); - struct Hrtf *hrtf = GetLoadedHrtf(entry->hrtf); + const EnumeratedHrtf &entry = device->HrtfList[hrtf_id]; + struct Hrtf *hrtf = GetLoadedHrtf(entry.hrtf); if(hrtf && hrtf->sampleRate == device->Frequency) { device->HrtfHandle = hrtf; - device->HrtfName = alstrdup(entry->name); + device->HrtfName = alstrdup(entry.name); } else if(hrtf) Hrtf_DecRef(hrtf); } - for(i = 0;!device->HrtfHandle && i < VECTOR_SIZE(device->HrtfList);i++) + for(i = 0;!device->HrtfHandle && i < device->HrtfList.size();i++) { - const EnumeratedHrtf *entry = &VECTOR_ELEM(device->HrtfList, i); - struct Hrtf *hrtf = GetLoadedHrtf(entry->hrtf); + const EnumeratedHrtf &entry = device->HrtfList[i]; + struct Hrtf *hrtf = GetLoadedHrtf(entry.hrtf); if(hrtf && hrtf->sampleRate == device->Frequency) { device->HrtfHandle = hrtf; - device->HrtfName = alstrdup(entry->name); + device->HrtfName = alstrdup(entry.name); } else if(hrtf) Hrtf_DecRef(hrtf); -- cgit v1.2.3