aboutsummaryrefslogtreecommitdiffstats
path: root/Alc/ambdec.cpp
diff options
context:
space:
mode:
authorChris Robinson <[email protected]>2018-12-15 03:30:47 -0800
committerChris Robinson <[email protected]>2018-12-15 03:30:47 -0800
commite0f635b20d989a5083112aa70960cc89e6bc553c (patch)
tree9e8f2ca7b87159ad50342938bbe5ec5719c1abeb /Alc/ambdec.cpp
parent0dd13a9dfed47660946fa9d37a1fc35e44b73687 (diff)
Move some ambisonic-related macros to a separate header
Diffstat (limited to 'Alc/ambdec.cpp')
-rw-r--r--Alc/ambdec.cpp7
1 files changed, 6 insertions, 1 deletions
diff --git a/Alc/ambdec.cpp b/Alc/ambdec.cpp
index 8b251187..e37a5a09 100644
--- a/Alc/ambdec.cpp
+++ b/Alc/ambdec.cpp
@@ -12,11 +12,16 @@
#include <fstream>
#include <sstream>
+#include "logging.h"
#include "compat.h"
namespace {
+template<typename T, std::size_t N>
+constexpr inline std::size_t size(const T(&)[N]) noexcept
+{ return N; }
+
int readline(std::istream &f, std::string &output)
{
while(f.good() && f.peek() == '\n')
@@ -148,7 +153,7 @@ bool load_ambdec_matrix(float (&gains)[MAX_AMBI_ORDER+1], al::vector<AmbDecConf:
buffer.c_str()+static_cast<std::size_t>(istr.tellg()));
return false;
}
- if(curgain < countof(gains))
+ if(curgain < size(gains))
gains[curgain++] = value;
}
std::fill(std::begin(gains)+curgain, std::end(gains), 0.0f);