diff options
author | Chris Robinson <chris.kcat@gmail.com> | 2020-01-15 10:33:56 -0800 |
---|---|---|
committer | Chris Robinson <chris.kcat@gmail.com> | 2020-01-15 10:33:56 -0800 |
commit | 6a8c6eae6f72a31bca2a04e94bc3bc16e10a83be (patch) | |
tree | 1dddfcc426a5ee357901d02a27bc8f788d64d1a4 /alc/panning.cpp | |
parent | fcfcb88b28af65fa6a26257e2e5346ed31abb858 (diff) |
Make a couple helper methods to create BFormatDec
Diffstat (limited to 'alc/panning.cpp')
-rw-r--r-- | alc/panning.cpp | 11 |
1 files changed, 5 insertions, 6 deletions
diff --git a/alc/panning.cpp b/alc/panning.cpp index d6f426f3..f7dfa6d0 100644 --- a/alc/panning.cpp +++ b/alc/panning.cpp @@ -464,8 +464,8 @@ void InitPanning(ALCdevice *device) (coeffcount > 5) ? "third" : (coeffcount > 3) ? "second" : "first", ""); - device->AmbiDecoder.reset(new(FamCount{coeffcount}) BFormatDec{coeffcount, chancoeffs, - al::span<const ALuint>{idxmap, chanmap.size()}}); + device->AmbiDecoder = BFormatDec::Create(coeffcount, chancoeffs, + al::span<const ALuint>{idxmap, chanmap.size()}); } } @@ -505,14 +505,13 @@ void InitCustomPanning(ALCdevice *device, bool hqdec, const AmbDecConf *conf, (conf->ChanMask > AMBI_1ORDER_MASK) ? "second" : "first", (conf->ChanMask&AMBI_PERIPHONIC_MASK) ? " periphonic" : "" ); - device->AmbiDecoder.reset(new(FamCount{count}) BFormatDec{conf, hqdec, count, - device->Frequency, speakermap}); + device->AmbiDecoder = BFormatDec::Create(conf, hqdec, count, device->Frequency, speakermap); auto accum_spkr_dist = std::bind(std::plus<float>{}, _1, std::bind(std::mem_fn(&AmbDecConf::SpeakerConf::Distance), _2)); - const ALfloat avg_dist{ + const float avg_dist{ std::accumulate(conf->Speakers.begin(), conf->Speakers.end(), 0.0f, accum_spkr_dist) / - static_cast<ALfloat>(conf->Speakers.size())}; + static_cast<float>(conf->Speakers.size())}; InitNearFieldCtrl(device, avg_dist, order, !!(conf->ChanMask&AMBI_PERIPHONIC_MASK)); InitDistanceComp(device, conf, speakermap); |