diff options
author | Chris Robinson <[email protected]> | 2023-11-10 20:48:21 -0800 |
---|---|---|
committer | Chris Robinson <[email protected]> | 2023-11-10 20:48:21 -0800 |
commit | 62995788b1fbdf2c64ef23158c60e8e5ddd290b5 (patch) | |
tree | 82a3f9b1036b2b6895c2a9f9f3075ec11a23c548 /alc | |
parent | 33cd77b81b1dce9a5b55ec7e215315c500f9d0bf (diff) |
Remove some explicit template parameters
Diffstat (limited to 'alc')
-rw-r--r-- | alc/alu.cpp | 15 |
1 files changed, 7 insertions, 8 deletions
diff --git a/alc/alu.cpp b/alc/alu.cpp index 203bd7cf..e0858b18 100644 --- a/alc/alu.cpp +++ b/alc/alu.cpp @@ -603,19 +603,18 @@ inline std::array<float,3> ScaleAzimuthFront3_2(std::array<float,3> pos) * precomputed since they're constant. The second-order coefficients are * followed by the third-order coefficients, etc. */ -template<size_t L> -constexpr size_t CalcRotatorSize() -{ return (L*2 + 1)*(L*2 + 1) + CalcRotatorSize<L-1>(); } - -template<> constexpr size_t CalcRotatorSize<0>() = delete; -template<> constexpr size_t CalcRotatorSize<1>() = delete; -template<> constexpr size_t CalcRotatorSize<2>() { return 5*5; } +constexpr size_t CalcRotatorSize(size_t l) noexcept +{ + if(l >= 2) + return (l*2 + 1)*(l*2 + 1) + CalcRotatorSize(l-1); + return 0; +} struct RotatorCoeffs { struct CoeffValues { float u, v, w; }; - std::array<CoeffValues,CalcRotatorSize<MaxAmbiOrder>()> mCoeffs{}; + std::array<CoeffValues,CalcRotatorSize(MaxAmbiOrder)> mCoeffs{}; RotatorCoeffs() { |