diff options
author | Chris Robinson <[email protected]> | 2018-11-18 19:19:35 -0800 |
---|---|---|
committer | Chris Robinson <[email protected]> | 2018-11-18 19:19:35 -0800 |
commit | 2c06ec709324b7aebdb71961a428362cfcafa68f (patch) | |
tree | d1ae5d23fdb13bd2997593f02901e45cb2d002f1 /Alc/panning.cpp | |
parent | bafcba7194c36eaf4fa1cb09b000170f8a138055 (diff) |
Use a regular vector for the enumerated HRTF list
Diffstat (limited to 'Alc/panning.cpp')
-rw-r--r-- | Alc/panning.cpp | 21 |
1 files changed, 9 insertions, 12 deletions
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); |