aboutsummaryrefslogtreecommitdiffstats
path: root/OpenAL32
diff options
context:
space:
mode:
authorChris Robinson <[email protected]>2013-10-03 05:02:16 -0700
committerChris Robinson <[email protected]>2013-10-03 05:02:16 -0700
commit764ea95781486f86c7be956e84cf97ab893ac07b (patch)
treea6fc6b17121a2f4cab499b97a59378470fb3cb75 /OpenAL32
parent99fa5911bc9f427c96fe800f94d31e4942805fd2 (diff)
Use helpers to set channel gain arrays
Also avoid unnecessary clearing.
Diffstat (limited to 'OpenAL32')
-rw-r--r--OpenAL32/Include/alu.h19
1 files changed, 18 insertions, 1 deletions
diff --git a/OpenAL32/Include/alu.h b/OpenAL32/Include/alu.h
index b389ec1e..076abea6 100644
--- a/OpenAL32/Include/alu.h
+++ b/OpenAL32/Include/alu.h
@@ -105,7 +105,24 @@ static inline ALfloat cubic(ALfloat val0, ALfloat val1, ALfloat val2, ALfloat va
ALvoid aluInitPanning(ALCdevice *Device);
-ALvoid ComputeAngleGains(const ALCdevice *device, ALfloat angle, ALfloat hwidth, ALfloat ingain, ALfloat *gains);
+/**
+ * ComputeAngleGains
+ *
+ * Sets channel gains based on a given source's angle and its half-width. The
+ * angle and hwidth parameters are in radians.
+ */
+void ComputeAngleGains(const ALCdevice *device, ALfloat angle, ALfloat hwidth, ALfloat ingain, ALfloat gains[MaxChannels]);
+
+/**
+ * SetGains
+ *
+ * Helper to set the appropriate channels to the specified gain.
+ */
+static inline void SetGains(const ALCdevice *device, ALfloat ingain, ALfloat gains[MaxChannels])
+{
+ ComputeAngleGains(device, 0.0f, F_PI, ingain, gains);
+}
+
ALvoid CalcSourceParams(struct ALsource *ALSource, const ALCcontext *ALContext);
ALvoid CalcNonAttnSourceParams(struct ALsource *ALSource, const ALCcontext *ALContext);