aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorChris Robinson <[email protected]>2018-07-15 21:01:26 -0700
committerChris Robinson <[email protected]>2018-07-15 21:01:26 -0700
commited1f1d2bf331110ab6cc55797272eeb968760048 (patch)
tree2b79e6e904d0711ac3bedfe618f1d47c6b91c1f0
parentfd3f52ea360ee361f6775812fb7662c697c84bfb (diff)
Start an extension to allow source filter gains greater than 1
-rw-r--r--Alc/ALc.c1
-rw-r--r--OpenAL32/alFilter.c9
2 files changed, 7 insertions, 3 deletions
diff --git a/Alc/ALc.c b/Alc/ALc.c
index 26219752..97d62812 100644
--- a/Alc/ALc.c
+++ b/Alc/ALc.c
@@ -725,6 +725,7 @@ static const ALchar alExtList[] =
"AL_SOFT_deferred_updates "
"AL_SOFT_direct_channels "
"AL_SOFTX_events "
+ "AL_SOFTX_filter_gain_ex "
"AL_SOFT_gain_clamp_ex "
"AL_SOFT_loop_points "
"AL_SOFTX_map_buffer "
diff --git a/OpenAL32/alFilter.c b/OpenAL32/alFilter.c
index 7d8a886c..e57653e0 100644
--- a/OpenAL32/alFilter.c
+++ b/OpenAL32/alFilter.c
@@ -28,6 +28,9 @@
#include "alError.h"
+#define FILTER_MIN_GAIN 0.0f
+#define FILTER_MAX_GAIN 4.0f /* +12dB */
+
extern inline void LockFilterList(ALCdevice *device);
extern inline void UnlockFilterList(ALCdevice *device);
@@ -347,7 +350,7 @@ static void ALlowpass_setParamf(ALfilter *filter, ALCcontext *context, ALenum pa
switch(param)
{
case AL_LOWPASS_GAIN:
- if(!(val >= AL_LOWPASS_MIN_GAIN && val <= AL_LOWPASS_MAX_GAIN))
+ if(!(val >= FILTER_MIN_GAIN && val <= FILTER_MAX_GAIN))
SETERR_RETURN(context, AL_INVALID_VALUE,, "Low-pass gain %f out of range", val);
filter->Gain = val;
break;
@@ -400,7 +403,7 @@ static void ALhighpass_setParamf(ALfilter *filter, ALCcontext *context, ALenum p
switch(param)
{
case AL_HIGHPASS_GAIN:
- if(!(val >= AL_HIGHPASS_MIN_GAIN && val <= AL_HIGHPASS_MAX_GAIN))
+ if(!(val >= FILTER_MIN_GAIN && val <= FILTER_MAX_GAIN))
SETERR_RETURN(context, AL_INVALID_VALUE,, "High-pass gain out of range");
filter->Gain = val;
break;
@@ -453,7 +456,7 @@ static void ALbandpass_setParamf(ALfilter *filter, ALCcontext *context, ALenum p
switch(param)
{
case AL_BANDPASS_GAIN:
- if(!(val >= AL_BANDPASS_MIN_GAIN && val <= AL_BANDPASS_MAX_GAIN))
+ if(!(val >= FILTER_MIN_GAIN && val <= FILTER_MAX_GAIN))
SETERR_RETURN(context, AL_INVALID_VALUE,, "Band-pass gain out of range");
filter->Gain = val;
break;