Use the correct diffusion value for reverb

I don't know what the Density and Diffusion values correspond to, but
EnvDiffusion is the actual diffusion setting.
This commit is contained in:
Chris Robinson 2014-06-22 19:38:47 -07:00
parent a434af92ee
commit b2f9430fb1

View file

@ -1797,8 +1797,7 @@ void OpenALSoundRenderer::LoadReverb(const ReverbContainer *env)
props.ReverbPan2 }; props.ReverbPan2 };
#undef SETPARAM #undef SETPARAM
#define SETPARAM(e,t,v) alEffectf((e), AL_EAXREVERB_##t, clamp((v), AL_EAXREVERB_MIN_##t, AL_EAXREVERB_MAX_##t)) #define SETPARAM(e,t,v) alEffectf((e), AL_EAXREVERB_##t, clamp((v), AL_EAXREVERB_MIN_##t, AL_EAXREVERB_MAX_##t))
SETPARAM(envReverb, DENSITY, props.Density/100.f); SETPARAM(envReverb, DIFFUSION, props.EnvDiffusion);
SETPARAM(envReverb, DIFFUSION, props.Diffusion/100.f);
SETPARAM(envReverb, GAIN, mB2Gain(props.Room)); SETPARAM(envReverb, GAIN, mB2Gain(props.Room));
SETPARAM(envReverb, GAINHF, mB2Gain(props.RoomHF)); SETPARAM(envReverb, GAINHF, mB2Gain(props.RoomHF));
SETPARAM(envReverb, GAINLF, mB2Gain(props.RoomLF)); SETPARAM(envReverb, GAINLF, mB2Gain(props.RoomLF));
@ -1826,8 +1825,7 @@ void OpenALSoundRenderer::LoadReverb(const ReverbContainer *env)
else if(type == AL_EFFECT_REVERB) else if(type == AL_EFFECT_REVERB)
{ {
#define SETPARAM(e,t,v) alEffectf((e), AL_REVERB_##t, clamp((v), AL_REVERB_MIN_##t, AL_REVERB_MAX_##t)) #define SETPARAM(e,t,v) alEffectf((e), AL_REVERB_##t, clamp((v), AL_REVERB_MIN_##t, AL_REVERB_MAX_##t))
SETPARAM(envReverb, DENSITY, props.Density/100.f); SETPARAM(envReverb, DIFFUSION, props.EnvDiffusion);
SETPARAM(envReverb, DIFFUSION, props.Diffusion/100.f);
SETPARAM(envReverb, GAIN, mB2Gain(props.Room)); SETPARAM(envReverb, GAIN, mB2Gain(props.Room));
SETPARAM(envReverb, GAINHF, mB2Gain(props.RoomHF)); SETPARAM(envReverb, GAINHF, mB2Gain(props.RoomHF));
SETPARAM(envReverb, DECAY_TIME, props.DecayTime); SETPARAM(envReverb, DECAY_TIME, props.DecayTime);