mirror of
https://github.com/dhewm/dhewm3.git
synced 2024-11-26 22:31:17 +00:00
Calculate EFX density as in EFX-Util
This commit is contained in:
parent
7297ebcaf6
commit
432b86fdeb
1 changed files with 6 additions and 1 deletions
|
@ -199,8 +199,13 @@ bool idEFXFile::ReadEffect( idLexer &src, idSoundEffect *effect ) {
|
|||
// <+KittyCat> the "environment" token should be ignored (efx has nothing equatable to it)
|
||||
src.ParseInt();
|
||||
} else if ( token == "environment size" ) {
|
||||
//
|
||||
// The formula for density according to Creative's EFX-Util.lib:
|
||||
// density = clamp(pow(size, 3) / 16, 0, 1)
|
||||
//
|
||||
float size = src.ParseFloat();
|
||||
efxf(AL_EAXREVERB_DENSITY, (size < 2.0f) ? (size - 1.0f) : 1.0f);
|
||||
size = idMath::ClampFloat(0.0f, 1.0f, (size * size * size) / 16.0f);
|
||||
efxf(AL_EAXREVERB_DENSITY, size);
|
||||
} else if ( token == "environment diffusion" ) {
|
||||
efxf(AL_EAXREVERB_DIFFUSION, src.ParseFloat());
|
||||
} else if ( token == "room" ) {
|
||||
|
|
Loading…
Reference in a new issue