Skip to content

Commit

Permalink
Try and match formatting to CONTRIBUTING.md guidelines
Browse files Browse the repository at this point in the history
  • Loading branch information
hemebond committed Mar 8, 2024
1 parent e398fe9 commit 5863f8b
Showing 1 changed file with 17 additions and 16 deletions.
33 changes: 17 additions & 16 deletions snd_mix.c
Original file line number Diff line number Diff line change
Expand Up @@ -335,21 +335,20 @@ void S_SetUnderwaterIntensity(void) {
float host_frametime = cl.realframetime;
float target = cl.view_underwater ? 1.f : 0.f;

if (snd_waterfx.value < 0.f) {
if (snd_waterfx.value < 0.f)
target *= 0.f;
}
else if (snd_waterfx.value > 2.f) {
else if (snd_waterfx.value > 2.f)
target *= 2.f;
}
else {
else
target *= snd_waterfx.value;
}

if (underwater.intensity < target) {
if (underwater.intensity < target)
{
underwater.intensity += host_frametime * 4.f;
underwater.intensity = min(underwater.intensity, target);
}
else if (underwater.intensity > target) {
else if (underwater.intensity > target)
{
underwater.intensity -= host_frametime * 4.f;
underwater.intensity = max(underwater.intensity, target);
}
Expand All @@ -363,20 +362,22 @@ static void S_UnderwaterFilter(int endtime)
{
int i;
int sl;
if (!underwater.intensity) {
if (endtime > 0) {
for (sl = 0; sl < SND_LISTENERS; sl++) {

if (!underwater.intensity)
{
if (endtime > 0)
for (sl = 0; sl < SND_LISTENERS; sl++)
underwater.accum[sl] = paintbuffer[endtime-1].sample[sl];
}
}

return;
}
for (i = 0; i < endtime; i++) {
for (sl = 0; sl < SND_LISTENERS; sl++) {

for (i = 0; i < endtime; i++)
for (sl = 0; sl < SND_LISTENERS; sl++)
{
underwater.accum[sl] += underwater.alpha * (paintbuffer[i].sample[sl] - underwater.accum[sl]);
paintbuffer[i].sample[sl] = underwater.accum[sl];
}
}
}


Expand Down

0 comments on commit 5863f8b

Please sign in to comment.