From e23da7a1dea9997f61d23af50ed915ebee98f2e9 Mon Sep 17 00:00:00 2001 From: Chris Robinson Date: Fri, 25 Mar 2016 19:57:25 -0700 Subject: Skip height-related ambisonic channels for 2D rendering --- Alc/panning.c | 18 ++++++++++++++++-- 1 file changed, 16 insertions(+), 2 deletions(-) (limited to 'Alc/panning.c') 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++) -- cgit v1.2.3