- separated the channel number from the flags in the sound interface so that the 8 channel limit can be eliminated.

- added Marisa Kirisame's CHAN_OVERLAP flag.
- exported S_IsActorPlayingSomething to ZScript.

The sound API change required deprecating A_PlaySound and S_Sound. There are now new variants S_StartSound and A_StartSound which have two distinct parameters for channel and flags.
This commit is contained in:
Christoph Oelckers 2019-12-16 23:52:39 +01:00
commit e82565373f
43 changed files with 339 additions and 280 deletions

View file

@ -5910,13 +5910,14 @@ doplaysound: if (funcIndex == ACSF_PlayActorSound)
}
if (sid != 0)
{
// What a mess. I think it's a given that this was used with sound flags so it will forever be restricted to the original 8 channels.
if (!looping)
{
S_PlaySound(spot, chan, sid, vol, atten, !!local);
S_PlaySound(spot, chan&7, EChanFlags::FromInt(chan&~7), sid, vol, atten, !!local);
}
else if (!S_IsActorPlayingSomething(spot, chan & 7, sid))
{
S_PlaySound(spot, chan | CHAN_LOOP, sid, vol, atten, !!local);
S_PlaySound(spot, chan&7, EChanFlags::FromInt(chan & ~7)|CHANF_LOOP, sid, vol, atten, !!local);
}
}
}
@ -8821,7 +8822,7 @@ scriptwait:
{
S_Sound (
activationline->frontsector,
CHAN_AUTO, // Not CHAN_AREA, because that'd probably break existing scripts.
CHAN_AUTO, 0, // Not CHAN_AREA, because that'd probably break existing scripts.
lookup,
(float)(STACK(1)) / 127.f,
ATTN_NORM);
@ -8829,7 +8830,7 @@ scriptwait:
else
{
S_Sound (
CHAN_AUTO,
CHAN_AUTO, 0,
lookup,
(float)(STACK(1)) / 127.f,
ATTN_NORM);
@ -8842,7 +8843,7 @@ scriptwait:
lookup = Level->Behaviors.LookupString (STACK(2));
if (lookup != NULL)
{
S_Sound (CHAN_AUTO,
S_Sound (CHAN_AUTO, 0,
lookup,
(float)(STACK(1)) / 127.f, ATTN_NONE);
}
@ -8853,7 +8854,7 @@ scriptwait:
lookup = Level->Behaviors.LookupString (STACK(2));
if (lookup != NULL && activator && activator->CheckLocalView())
{
S_Sound (CHAN_AUTO,
S_Sound (CHAN_AUTO, 0,
lookup,
(float)(STACK(1)) / 127.f, ATTN_NONE);
}
@ -8866,13 +8867,13 @@ scriptwait:
{
if (activator != NULL)
{
S_Sound (activator, CHAN_AUTO,
S_Sound (activator, CHAN_AUTO, 0,
lookup,
(float)(STACK(1)) / 127.f, ATTN_NORM);
}
else
{
S_Sound (CHAN_AUTO,
S_Sound (CHAN_AUTO, 0,
lookup,
(float)(STACK(1)) / 127.f, ATTN_NONE);
}
@ -9040,7 +9041,7 @@ scriptwait:
while ( (spot = iterator.Next ()) )
{
S_Sound (spot, CHAN_AUTO,
S_Sound (spot, CHAN_AUTO, 0,
lookup,
(float)(STACK(1))/127.f, ATTN_NORM);
}