diff options
author | Chris Robinson <[email protected]> | 2021-12-12 15:53:53 -0800 |
---|---|---|
committer | Chris Robinson <[email protected]> | 2021-12-12 15:53:53 -0800 |
commit | 953745d38643b62dd10ba6d8c1e2e4c7fa20eb30 (patch) | |
tree | 1b6ced2e22f166513b4c9dbc8b9f53dd46541b98 /alc/alu.cpp | |
parent | 5e3fcb3a934844f1d70aa23a8a871a6915565ed2 (diff) |
Make an inline function to check for 2D ambisonic formats
Diffstat (limited to 'alc/alu.cpp')
-rw-r--r-- | alc/alu.cpp | 10 |
1 files changed, 3 insertions, 7 deletions
diff --git a/alc/alu.cpp b/alc/alu.cpp index 693288df..93e18c94 100644 --- a/alc/alu.cpp +++ b/alc/alu.cpp @@ -777,11 +777,9 @@ void CalcPanningAndFilters(Voice *voice, const float xpos, const float ypos, con } voice->mFlags &= ~(VoiceHasHrtf | VoiceHasNfc); - if(voice->mFmtChannels == FmtBFormat2D || voice->mFmtChannels == FmtBFormat3D - || voice->mFmtChannels == FmtUHJ2 || voice->mFmtChannels == FmtUHJ3 - || voice->mFmtChannels == FmtUHJ4 || voice->mFmtChannels == FmtSuperStereo) + if(IsAmbisonic(voice->mFmtChannels)) { - /* Special handling for B-Format sources. */ + /* Special handling for B-Format and UHJ sources. */ if(Device->AvgSpeakerDist > 0.0f && voice->mFmtChannels != FmtUHJ2 && voice->mFmtChannels != FmtSuperStereo) @@ -883,9 +881,7 @@ void CalcPanningAndFilters(Voice *voice, const float xpos, const float ypos, con /* Convert the rotation matrix for input ordering and scaling, and * whether input is 2D or 3D. */ - const uint8_t *index_map{ - (voice->mFmtChannels == FmtBFormat2D || voice->mFmtChannels == FmtUHJ2 - || voice->mFmtChannels == FmtUHJ3 || voice->mFmtChannels == FmtSuperStereo) ? + const uint8_t *index_map{Is2DAmbisonic(voice->mFmtChannels) ? GetAmbi2DLayout(voice->mAmbiLayout).data() : GetAmbiLayout(voice->mAmbiLayout).data()}; |