- reverb testing code

- toned down the default reverb.
This commit is contained in:
Christoph Oelckers 2020-02-02 20:28:01 +01:00
parent 8412602621
commit 5b83e51ab5
2 changed files with 33 additions and 4 deletions

View file

@ -182,9 +182,20 @@ static ReverbContainer Underwater =
false
};
static ReverbContainer SewerPipe =
static ReverbContainer SewerPipe4 =
{
&Underwater,
"Sewer Pipe 2",
0x1503,
true,
false,
{0,21, 1.7f, 0.80f, -1000, -1000, 0, 1.81f, 0.14f, 1.0f, 229, 0.014f, 0.0f,0.0f,0.0f, 1023, 0.021f, 0.0f,0.0f,0.0f, 0.250f, 0.00f, 0.25f, 0.000f, -5.0f, 5000.0f, 250.0f, 0.0f, 80.0f, 60.0f, 0x3f },
false
};
static ReverbContainer SewerPipe =
{
&SewerPipe4,
"Sewer Pipe",
0x1500,
true,

View file

@ -1735,16 +1735,34 @@ void SoundEngine::AddRandomSound(int Owner, TArray<uint32_t> list)
}
extern ReverbContainer* ForcedEnvironment;
static int LastReverb;
CUSTOM_CVAR(Bool, snd_reverb, true, CVAR_ARCHIVE|CVAR_GLOBALCONFIG)
{
FX_SetReverb(-1);
}
// This is for testing reverb settings.
CUSTOM_CVAR(Int, snd_reverbtype, -1, 0)
{
FX_SetReverb(-1);
}
CVAR(Bool, snd_reverb, true, CVAR_ARCHIVE|CVAR_GLOBALCONFIG)
void FX_SetReverb(int strength)
{
if (snd_reverb && strength > 0)
if (strength == -1) strength = LastReverb;
if (snd_reverbtype > -1)
{
strength = snd_reverbtype;
ForcedEnvironment = S_FindEnvironment(strength);
}
else if (snd_reverb && strength > 0)
{
// todo: optimize environments. The original "reverb" was garbage and not usable as reference.
if (strength < 64) strength = 0x1400;
else if (strength < 192) strength = 0x1500;
else if (strength < 192) strength = 0x1503;
else strength = 0x1900;
LastReverb = strength;
ForcedEnvironment = S_FindEnvironment(strength);
}
else ForcedEnvironment = nullptr;