mirror of
https://github.com/ZDoom/gzdoom-gles.git
synced 2025-01-20 23:50:46 +00:00
Always use the pitch multiplier when underwater
This commit is contained in:
parent
b2f9430fb1
commit
075c5d872d
1 changed files with 12 additions and 21 deletions
|
@ -1083,9 +1083,8 @@ FISoundChannel *OpenALSoundRenderer::StartSound(SoundHandle sfx, float vol, int
|
||||||
alSource3i(source, AL_AUXILIARY_SEND_FILTER, 0, 0, AL_FILTER_NULL);
|
alSource3i(source, AL_AUXILIARY_SEND_FILTER, 0, 0, AL_FILTER_NULL);
|
||||||
}
|
}
|
||||||
alSourcef(source, AL_ROOM_ROLLOFF_FACTOR, 0.f);
|
alSourcef(source, AL_ROOM_ROLLOFF_FACTOR, 0.f);
|
||||||
alSourcef(source, AL_PITCH, PITCH(pitch));
|
|
||||||
}
|
}
|
||||||
else if(WasInWater && !(chanflags&SNDF_NOREVERB))
|
if(WasInWater && !(chanflags&SNDF_NOREVERB))
|
||||||
alSourcef(source, AL_PITCH, PITCH(pitch)*PITCH_MULT);
|
alSourcef(source, AL_PITCH, PITCH(pitch)*PITCH_MULT);
|
||||||
else
|
else
|
||||||
alSourcef(source, AL_PITCH, PITCH(pitch));
|
alSourcef(source, AL_PITCH, PITCH(pitch));
|
||||||
|
@ -1258,9 +1257,8 @@ FISoundChannel *OpenALSoundRenderer::StartSound3D(SoundHandle sfx, SoundListener
|
||||||
alSource3i(source, AL_AUXILIARY_SEND_FILTER, 0, 0, AL_FILTER_NULL);
|
alSource3i(source, AL_AUXILIARY_SEND_FILTER, 0, 0, AL_FILTER_NULL);
|
||||||
}
|
}
|
||||||
alSourcef(source, AL_ROOM_ROLLOFF_FACTOR, 0.f);
|
alSourcef(source, AL_ROOM_ROLLOFF_FACTOR, 0.f);
|
||||||
alSourcef(source, AL_PITCH, PITCH(pitch));
|
|
||||||
}
|
}
|
||||||
else if(WasInWater && !(chanflags&SNDF_NOREVERB))
|
if(WasInWater && !(chanflags&SNDF_NOREVERB))
|
||||||
alSourcef(source, AL_PITCH, PITCH(pitch)*PITCH_MULT);
|
alSourcef(source, AL_PITCH, PITCH(pitch)*PITCH_MULT);
|
||||||
else
|
else
|
||||||
alSourcef(source, AL_PITCH, PITCH(pitch));
|
alSourcef(source, AL_PITCH, PITCH(pitch));
|
||||||
|
@ -1519,8 +1517,7 @@ void OpenALSoundRenderer::UpdateListener(SoundListener *listener)
|
||||||
const_cast<ReverbContainer*>(env)->Modified = false;
|
const_cast<ReverbContainer*>(env)->Modified = false;
|
||||||
}
|
}
|
||||||
|
|
||||||
// NOTE: Moving into and out of water will undo pitch variations on sounds
|
// NOTE: Moving into and out of water will undo pitch variations on sounds.
|
||||||
// if either snd_waterreverb or EFX are disabled.
|
|
||||||
if(listener->underwater || env->SoftwareWater)
|
if(listener->underwater || env->SoftwareWater)
|
||||||
{
|
{
|
||||||
if(!WasInWater)
|
if(!WasInWater)
|
||||||
|
@ -1530,13 +1527,11 @@ void OpenALSoundRenderer::UpdateListener(SoundListener *listener)
|
||||||
if(EnvSlot != 0 && *snd_waterreverb)
|
if(EnvSlot != 0 && *snd_waterreverb)
|
||||||
{
|
{
|
||||||
// Find the "Underwater" reverb environment
|
// Find the "Underwater" reverb environment
|
||||||
env = Environments;
|
env = S_FindEnvironment(0x1600);
|
||||||
while(env && env->ID != 0x1600)
|
|
||||||
env = env->Next;
|
|
||||||
LoadReverb(env ? env : DefaultEnvironments[0]);
|
LoadReverb(env ? env : DefaultEnvironments[0]);
|
||||||
|
|
||||||
alFilterf(EnvFilters[0], AL_LOWPASS_GAIN, 0.1f);
|
alFilterf(EnvFilters[0], AL_LOWPASS_GAIN, 1.f);
|
||||||
alFilterf(EnvFilters[0], AL_LOWPASS_GAINHF, 1.f);
|
alFilterf(EnvFilters[0], AL_LOWPASS_GAINHF, 0.125f);
|
||||||
alFilterf(EnvFilters[1], AL_LOWPASS_GAIN, 1.f);
|
alFilterf(EnvFilters[1], AL_LOWPASS_GAIN, 1.f);
|
||||||
alFilterf(EnvFilters[1], AL_LOWPASS_GAINHF, 1.f);
|
alFilterf(EnvFilters[1], AL_LOWPASS_GAINHF, 1.f);
|
||||||
|
|
||||||
|
@ -1547,11 +1542,9 @@ void OpenALSoundRenderer::UpdateListener(SoundListener *listener)
|
||||||
alSource3i(*i, AL_AUXILIARY_SEND_FILTER, EnvSlot, 0, EnvFilters[1]);
|
alSource3i(*i, AL_AUXILIARY_SEND_FILTER, EnvSlot, 0, EnvFilters[1]);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
else
|
|
||||||
{
|
|
||||||
foreach(ALuint, i, ReverbSfx)
|
foreach(ALuint, i, ReverbSfx)
|
||||||
alSourcef(*i, AL_PITCH, PITCH_MULT);
|
alSourcef(*i, AL_PITCH, PITCH_MULT);
|
||||||
}
|
|
||||||
getALError();
|
getALError();
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@ -1573,11 +1566,9 @@ void OpenALSoundRenderer::UpdateListener(SoundListener *listener)
|
||||||
alSource3i(*i, AL_AUXILIARY_SEND_FILTER, EnvSlot, 0, EnvFilters[1]);
|
alSource3i(*i, AL_AUXILIARY_SEND_FILTER, EnvSlot, 0, EnvFilters[1]);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
else
|
|
||||||
{
|
|
||||||
foreach(ALuint, i, ReverbSfx)
|
foreach(ALuint, i, ReverbSfx)
|
||||||
alSourcef(*i, AL_PITCH, 1.f);
|
alSourcef(*i, AL_PITCH, 1.f);
|
||||||
}
|
|
||||||
getALError();
|
getALError();
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in a new issue