aboutsummaryrefslogtreecommitdiffstats
path: root/Alc/panning.c
diff options
context:
space:
mode:
authorChris Robinson <[email protected]>2014-11-04 03:33:35 -0800
committerChris Robinson <[email protected]>2014-11-04 03:33:35 -0800
commit6083a684d1cad2ea97ce966b7b2ca011d1f37fe1 (patch)
tree2f419e5de632b2caadd7bed1b934f4afdd96c902 /Alc/panning.c
parentd8cfdb3f348b3e4dd545a5ebd7f282aa2b4ee585 (diff)
Use a method to set omni-directional channel gains
Diffstat (limited to 'Alc/panning.c')
-rw-r--r--Alc/panning.c15
1 files changed, 13 insertions, 2 deletions
diff --git a/Alc/panning.c b/Alc/panning.c
index 2e979049..9f05203f 100644
--- a/Alc/panning.c
+++ b/Alc/panning.c
@@ -31,8 +31,6 @@
#include "AL/alc.h"
#include "alu.h"
-extern inline void SetGains(const ALCdevice *device, ALfloat ingain, ALfloat gains[MaxChannels]);
-
void ComputeAngleGains(const ALCdevice *device, ALfloat angle, ALfloat elevation, ALfloat ingain, ALfloat gains[MaxChannels])
{
@@ -81,6 +79,19 @@ void ComputeDirectionalGains(const ALCdevice *device, const ALfloat dir[3], ALfl
}
}
+void ComputeAmbientGains(const ALCdevice *device, ALfloat ingain, ALfloat gains[MaxChannels])
+{
+ ALuint i;
+
+ for(i = 0;i < MaxChannels;i++)
+ gains[i] = 0.0f;
+ for(i = 0;i < device->NumSpeakers;i++)
+ {
+ enum Channel chan = device->Speaker[i].ChanName;
+ gains[chan] = device->Speaker[i].HOACoeff[0] * ingain;
+ }
+}
+
void ComputeBFormatGains(const ALCdevice *device, const ALfloat mtx[4], ALfloat ingain, ALfloat gains[MaxChannels])
{
ALuint i, j;