aboutsummaryrefslogtreecommitdiffstats
path: root/Alc/panning.cpp
diff options
context:
space:
mode:
authorChris Robinson <[email protected]>2019-02-27 23:13:40 -0800
committerChris Robinson <[email protected]>2019-02-27 23:13:40 -0800
commite4b76d26271931d1207538cbfbfb92facad0e9c7 (patch)
tree6401762a02043975aa14b2425b69124637339c26 /Alc/panning.cpp
parent86926f0998c581530177b8c54050fc9d28f561f7 (diff)
Reverse the HRTF field array
Most often a sound's distance will be beyond the farthest field measurement, so It's more efficient to have the farthest field first and avoid looping through the whole field array for them.
Diffstat (limited to 'Alc/panning.cpp')
-rw-r--r--Alc/panning.cpp3
1 files changed, 1 insertions, 2 deletions
diff --git a/Alc/panning.cpp b/Alc/panning.cpp
index 60436e02..25b940a2 100644
--- a/Alc/panning.cpp
+++ b/Alc/panning.cpp
@@ -626,8 +626,7 @@ void InitHrtfPanning(ALCdevice *device)
AmbiMatrix, static_cast<ALsizei>(COUNTOF(AmbiPoints)), AmbiOrderHFGain);
HrtfEntry *Hrtf{device->mHrtf};
- const auto &field = Hrtf->field[Hrtf->fdCount-1];
- InitNearFieldCtrl(device, field.distance, ambi_order, ChansPerOrder);
+ InitNearFieldCtrl(device, Hrtf->field[0].distance, ambi_order, ChansPerOrder);
}
void InitUhjPanning(ALCdevice *device)