aboutsummaryrefslogtreecommitdiffstats
path: root/Alc/panning.c
diff options
context:
space:
mode:
authorChris Robinson <[email protected]>2016-03-25 19:57:25 -0700
committerChris Robinson <[email protected]>2016-03-25 19:57:25 -0700
commite23da7a1dea9997f61d23af50ed915ebee98f2e9 (patch)
treed2ba96513c49ca7a299e430d0a44005de7321ddb /Alc/panning.c
parent05dace65257ed8828a2e3a5cc3add0016b1ac72e (diff)
Skip height-related ambisonic channels for 2D rendering
Diffstat (limited to 'Alc/panning.c')
-rw-r--r--Alc/panning.c18
1 files changed, 16 insertions, 2 deletions
diff --git a/Alc/panning.c b/Alc/panning.c
index 6f6db3df..676896d8 100644
--- a/Alc/panning.c
+++ b/Alc/panning.c
@@ -596,6 +596,12 @@ ALvoid aluInitPanning(ALCdevice *device)
{ Aux6, { 0.0f, 0.0f, 0.0f, 0.0f, 0.0f, 0.0f, 1.0f, 0.0f, 0.0f } },
{ Aux7, { 0.0f, 0.0f, 0.0f, 0.0f, 0.0f, 0.0f, 0.0f, 1.0f, 0.0f } },
{ Aux8, { 0.0f, 0.0f, 0.0f, 0.0f, 0.0f, 0.0f, 0.0f, 0.0f, 1.0f } },
+ }, Ambi2D[5] = {
+ { Aux0, { 1.0f, 0.0f, 0.0f, 0.0f, 0.0f, 0.0f, 0.0f, 0.0f, 0.0f } },
+ { Aux1, { 0.0f, 1.0f, 0.0f, 0.0f, 0.0f, 0.0f, 0.0f, 0.0f, 0.0f } },
+ { Aux2, { 0.0f, 0.0f, 0.0f, 1.0f, 0.0f, 0.0f, 0.0f, 0.0f, 0.0f } },
+ { Aux3, { 0.0f, 0.0f, 0.0f, 0.0f, 1.0f, 0.0f, 0.0f, 0.0f, 0.0f } },
+ { Aux4, { 0.0f, 0.0f, 0.0f, 0.0f, 0.0f, 0.0f, 0.0f, 0.0f, 1.0f } },
};
ALuint speakermap[MAX_OUTPUT_CHANNELS];
const char *fname = "";
@@ -631,8 +637,16 @@ ALvoid aluInitPanning(ALCdevice *device)
if(!MakeSpeakerMap(device, &conf, speakermap))
goto ambi_fail;
- count = (conf.ChanMask > 0xf) ? COUNTOF(Ambi3D) : 4;
- chanmap = Ambi3D;
+ if((conf.ChanMask & ~0x831b))
+ {
+ count = (conf.ChanMask > 0xf) ? COUNTOF(Ambi3D) : 4;
+ chanmap = Ambi3D;
+ }
+ else
+ {
+ count = (conf.ChanMask > 0xf) ? COUNTOF(Ambi2D) : 3;
+ chanmap = Ambi2D;
+ }
ambiscale = 1.0f;
for(i = 0;i < count;i++)