diff options
author | Chris Robinson <[email protected]> | 2011-07-20 22:26:16 -0700 |
---|---|---|
committer | Chris Robinson <[email protected]> | 2011-07-20 22:26:16 -0700 |
commit | 1e8a379a03b80dbfc621855fd819f73487bcc7de (patch) | |
tree | 2198063858999a79b476039f852da42916239249 /Alc | |
parent | b889823b2164c652560485dc66dd913b85e0c297 (diff) |
Add a config option to boost reverb output
Diffstat (limited to 'Alc')
-rw-r--r-- | Alc/ALc.c | 3 | ||||
-rw-r--r-- | Alc/alcReverb.c | 10 |
2 files changed, 12 insertions, 1 deletions
@@ -564,6 +564,9 @@ static void alc_initconfig(void) if(DefaultResampler >= RESAMPLER_MAX || DefaultResampler <= RESAMPLER_MIN) DefaultResampler = RESAMPLER_DEFAULT; + ReverbBoost *= aluPow(10.0f, GetConfigValueFloat("reverb", "boost", 0.0f) / + 20.0f); + devs = GetConfigValue(NULL, "drivers", ""); if(devs[0]) { diff --git a/Alc/alcReverb.c b/Alc/alcReverb.c index 38586357..4b7aa1c4 100644 --- a/Alc/alcReverb.c +++ b/Alc/alcReverb.c @@ -135,6 +135,11 @@ typedef struct ALverbState { ALfloat *Gain; } ALverbState; +/* This is a user config option for modifying the overall output of the reverb + * effect. + */ +ALfloat ReverbBoost = 1.0f; + /* This coefficient is used to define the maximum frequency range controlled * by the modulation depth. The current value of 0.1 will allow it to swing * from 0.9x to 1.1x. This value must be below 1. At 1 it will cause the @@ -602,6 +607,8 @@ static ALvoid Update3DPanning(const ALCdevice *Device, const ALfloat *Reflection ALuint index; ALint pos; + Gain *= ReverbBoost; + // Attenuate non-directional reverb according to the number of channels ambientGain = aluSqrt(2.0f/Device->NumChan); @@ -1106,7 +1113,8 @@ static ALvoid VerbUpdate(ALeffectState *effect, ALCcontext *Context, const ALeff // Update channel gains gain = Slot->Gain; - gain *= aluSqrt(2.0/Device->NumChan); + gain *= aluSqrt(2.0f/Device->NumChan); + gain *= ReverbBoost; for(index = 0;index < MAXCHANNELS;index++) State->Gain[index] = 0.0f; for(index = 0;index < Device->NumChan;index++) |