diff options
author | Chris Robinson <[email protected]> | 2018-12-15 02:42:04 -0800 |
---|---|---|
committer | Chris Robinson <[email protected]> | 2018-12-15 02:56:19 -0800 |
commit | 0dd13a9dfed47660946fa9d37a1fc35e44b73687 (patch) | |
tree | d2a0644a466ee0c3def10c8af725451ce6e902c7 /Alc/ambdec.h | |
parent | 640c06c292632f2ac78d349b0ad3b8b5f000c61a (diff) |
Make the AmbDec speaker and matrix arrays dynamic
Diffstat (limited to 'Alc/ambdec.h')
-rw-r--r-- | Alc/ambdec.h | 31 |
1 files changed, 17 insertions, 14 deletions
diff --git a/Alc/ambdec.h b/Alc/ambdec.h index 99caf9a2..5ec5eb0c 100644 --- a/Alc/ambdec.h +++ b/Alc/ambdec.h @@ -1,9 +1,11 @@ #ifndef AMBDEC_H #define AMBDEC_H +#include <array> #include <string> #include "alMain.h" +#include "vector.h" /* Helpers to read .ambdec configuration files. */ @@ -14,30 +16,31 @@ enum class AmbDecScale { }; struct AmbDecConf { std::string Description; - ALuint Version; /* Must be 3 */ + int Version; /* Must be 3 */ - ALuint ChanMask; - ALuint FreqBands; /* Must be 1 or 2 */ - ALsizei NumSpeakers; + unsigned int ChanMask; + unsigned int FreqBands; /* Must be 1 or 2 */ AmbDecScale CoeffScale; - ALfloat XOverFreq; - ALfloat XOverRatio; + float XOverFreq; + float XOverRatio; struct SpeakerConf { std::string Name; - ALfloat Distance; - ALfloat Azimuth; - ALfloat Elevation; + float Distance{0.0f}; + float Azimuth{0.0f}; + float Elevation{0.0f}; std::string Connection; - } Speakers[MAX_OUTPUT_CHANNELS]; + }; + al::vector<SpeakerConf> Speakers; + using CoeffArray = std::array<float,MAX_AMBI_COEFFS>; /* Unused when FreqBands == 1 */ - ALfloat LFOrderGain[MAX_AMBI_ORDER+1]; - ALfloat LFMatrix[MAX_OUTPUT_CHANNELS][MAX_AMBI_COEFFS]; + float LFOrderGain[MAX_AMBI_ORDER+1]; + al::vector<CoeffArray> LFMatrix; - ALfloat HFOrderGain[MAX_AMBI_ORDER+1]; - ALfloat HFMatrix[MAX_OUTPUT_CHANNELS][MAX_AMBI_COEFFS]; + float HFOrderGain[MAX_AMBI_ORDER+1]; + al::vector<CoeffArray> HFMatrix; int load(const char *fname) noexcept; }; |