aboutsummaryrefslogtreecommitdiffstats
path: root/Alc/panning.cpp
diff options
context:
space:
mode:
authorChris Robinson <[email protected]>2019-03-31 22:50:30 -0700
committerChris Robinson <[email protected]>2019-03-31 22:50:30 -0700
commitda8494dd8a23a0e2b1c4ca4973e6311f32a5925c (patch)
treec075d41c41f720ffc33a7f1a3008dfc41dd02679 /Alc/panning.cpp
parent0e0e85af72f855627ca043e234949593ff947caf (diff)
Use the existing function to get the ambisonic channel count
Diffstat (limited to 'Alc/panning.cpp')
-rw-r--r--Alc/panning.cpp4
1 files changed, 1 insertions, 3 deletions
diff --git a/Alc/panning.cpp b/Alc/panning.cpp
index 25be847f..f24f59d6 100644
--- a/Alc/panning.cpp
+++ b/Alc/panning.cpp
@@ -386,9 +386,7 @@ void InitPanning(ALCdevice *device)
const std::array<float,MAX_AMBI_CHANNELS> &n3dscale = GetAmbiScales(device->mAmbiScale);
/* For DevFmtAmbi3D, the ambisonic order is already set. */
- count = (device->mAmbiOrder == 3) ? 16 :
- (device->mAmbiOrder == 2) ? 9 :
- (device->mAmbiOrder == 1) ? 4 : 1;
+ count = static_cast<ALsizei>(AmbiChannelsFromOrder(device->mAmbiOrder));
std::transform(acnmap.begin(), acnmap.begin()+count, std::begin(device->Dry.AmbiMap),
[&n3dscale](const ALsizei &acn) noexcept -> BFChannelConfig
{ return BFChannelConfig{1.0f/n3dscale[acn], acn}; }