From 20f5e7c1fafcd40cdee2f7226ae81480ae049d1a Mon Sep 17 00:00:00 2001 From: Chris Robinson Date: Thu, 21 Jan 2021 02:05:55 -0800 Subject: Avoid global constexpr arrays --- alc/effects/convolution.cpp | 22 +++++++++++----------- 1 file changed, 11 insertions(+), 11 deletions(-) (limited to 'alc/effects/convolution.cpp') diff --git a/alc/effects/convolution.cpp b/alc/effects/convolution.cpp index 4e10b62a..2dec0dc6 100644 --- a/alc/effects/convolution.cpp +++ b/alc/effects/convolution.cpp @@ -76,23 +76,23 @@ void LoadSamples(double *RESTRICT dst, const al::byte *src, const size_t srcstep } -auto GetAmbiScales(AmbiScaling scaletype) noexcept -> const std::array& +inline auto& GetAmbiScales(AmbiScaling scaletype) noexcept { - if(scaletype == AmbiScaling::FuMa) return AmbiScale::FromFuMa; - if(scaletype == AmbiScaling::SN3D) return AmbiScale::FromSN3D; - return AmbiScale::FromN3D; + if(scaletype == AmbiScaling::FuMa) return AmbiScale::FromFuMa(); + if(scaletype == AmbiScaling::SN3D) return AmbiScale::FromSN3D(); + return AmbiScale::FromN3D(); } -auto GetAmbiLayout(AmbiLayout layouttype) noexcept -> const std::array& +inline auto& GetAmbiLayout(AmbiLayout layouttype) noexcept { - if(layouttype == AmbiLayout::FuMa) return AmbiIndex::FromFuMa; - return AmbiIndex::FromACN; + if(layouttype == AmbiLayout::FuMa) return AmbiIndex::FromFuMa(); + return AmbiIndex::FromACN(); } -auto GetAmbi2DLayout(AmbiLayout layouttype) noexcept -> const std::array& +inline auto& GetAmbi2DLayout(AmbiLayout layouttype) noexcept { - if(layouttype == AmbiLayout::FuMa) return AmbiIndex::FromFuMa2D; - return AmbiIndex::FromACN2D; + if(layouttype == AmbiLayout::FuMa) return AmbiIndex::FromFuMa2D(); + return AmbiIndex::FromACN2D(); } @@ -387,7 +387,7 @@ void ConvolutionState::update(const ALCcontext *context, const EffectSlot *slot, } mOutTarget = target.Main->Buffer; - const auto &scales = GetAmbiScales(mAmbiScaling); + auto&& scales = GetAmbiScales(mAmbiScaling); const uint8_t *index_map{(mChannels == FmtBFormat2D) ? GetAmbi2DLayout(mAmbiLayout).data() : GetAmbiLayout(mAmbiLayout).data()}; -- cgit v1.2.3