Skip to content

Commit

Permalink
Proper sound clipping for map 08
Browse files Browse the repository at this point in the history
JNechaevsky committed Apr 5, 2023

Verified

This commit was created on GitHub.com and signed with GitHub’s verified signature.
1 parent b53e7c1 commit 8052e66
Showing 1 changed file with 4 additions and 1 deletion.
5 changes: 4 additions & 1 deletion src/doom/s_sound.c
Original file line number Diff line number Diff line change
@@ -414,6 +414,9 @@ static int S_AdjustSoundParams(mobj_t *listener, mobj_t *source,
fixed_t ady;
angle_t angle;

// [crispy] proper sound clipping in Doom 2 MAP08 and The Ultimate Doom E4M8
const boolean doom1map8 = (gamemap == 8 && ((gamemode != commercial && gameepisode < 4)));

// calculate the distance to sound origin
// and clip it if necessary
adx = abs(listener->x - source->x);
@@ -422,7 +425,7 @@ static int S_AdjustSoundParams(mobj_t *listener, mobj_t *source,
// From _GG1_ p.428. Appox. eucledian distance fast.
approx_dist = adx + ady - ((adx < ady ? adx : ady)>>1);

if (gamemap != 8 && approx_dist > S_CLIPPING_DIST)
if (!doom1map8 && approx_dist > S_CLIPPING_DIST)
{
return 0;
}

0 comments on commit 8052e66

Please sign in to comment.