- Replaced the naive area sound implementation with one that takes into

consideration the size and shape of the sector producing the sound. See
  the lifts on Doom 2 MAP30 and compare with previous versions.
- Fixed: The stop sound for sector-based sound sequences was not played with
  the CHAN_AREA flag.
- Removed the distinction between S_Sound() and S_SoundID() functions. Use
  S_Sound() for both names and IDs from now on.


SVN r1034 (trunk)
This commit is contained in:
Randy Heit 2008-06-15 02:25:09 +00:00
commit 9e42cdaf08
66 changed files with 604 additions and 430 deletions

View file

@ -294,12 +294,12 @@ void AActor::Serialize (FArchive &arc)
<< id
<< FloatBobPhase
<< Translation
<< AR_SOUNDW(SeeSound)
<< AR_SOUNDW(AttackSound)
<< AR_SOUNDW(PainSound)
<< AR_SOUNDW(DeathSound)
<< AR_SOUNDW(ActiveSound)
<< AR_SOUNDW(UseSound)
<< SeeSound
<< AttackSound
<< PainSound
<< DeathSound
<< ActiveSound
<< UseSound
<< Speed
<< FloatSpeed
<< Mass
@ -1148,7 +1148,7 @@ void P_ExplodeMissile (AActor *mo, line_t *line, AActor *target)
if (mo->DeathSound)
{
S_SoundID (mo, CHAN_VOICE, mo->DeathSound, 1,
S_Sound (mo, CHAN_VOICE, mo->DeathSound, 1,
(mo->flags3 & MF3_FULLVOLDEATH) ? ATTN_NONE : ATTN_NORM);
}
}
@ -1208,7 +1208,7 @@ bool AActor::FloorBounceMissile (secplane_t &plane)
if (SeeSound && !(flags4 & MF4_NOBOUNCESOUND))
{
S_SoundID (this, CHAN_VOICE, SeeSound, 1, ATTN_IDLE);
S_Sound (this, CHAN_VOICE, SeeSound, 1, ATTN_IDLE);
}
if ((flags2 & MF2_BOUNCETYPE) == MF2_DOOMBOUNCE)
@ -1624,7 +1624,7 @@ void P_XYMovement (AActor *mo, fixed_t scrollx, fixed_t scrolly)
mo->momy = FixedMul (speed, finesine[angle]);
if (mo->SeeSound && !(mo->flags4&MF4_NOBOUNCESOUND))
{
S_SoundID (mo, CHAN_VOICE, mo->SeeSound, 1, ATTN_IDLE);
S_Sound (mo, CHAN_VOICE, mo->SeeSound, 1, ATTN_IDLE);
}
return;
}
@ -1642,7 +1642,7 @@ void P_XYMovement (AActor *mo, fixed_t scrollx, fixed_t scrolly)
{
if (mo->SeeSound && !(mo->flags3 & MF3_NOWALLBOUNCESND))
{
S_SoundID (mo, CHAN_VOICE, mo->SeeSound, 1, ATTN_IDLE);
S_Sound (mo, CHAN_VOICE, mo->SeeSound, 1, ATTN_IDLE);
}
return;
}
@ -2363,7 +2363,7 @@ void AActor::Howl ()
int howl = GetClass()->Meta.GetMetaInt(AMETA_HowlSound);
if (!S_IsActorPlayingSomething(this, CHAN_BODY, howl))
{
S_SoundID (this, CHAN_BODY, howl, 1, ATTN_NORM);
S_Sound (this, CHAN_BODY, howl, 1, ATTN_NORM);
}
}
@ -2455,7 +2455,7 @@ void AActor::PlayActiveSound ()
{
if (ActiveSound && !S_IsActorPlayingSomething (this, CHAN_VOICE, -1))
{
S_SoundID (this, CHAN_VOICE, ActiveSound, 1,
S_Sound (this, CHAN_VOICE, ActiveSound, 1,
(flags3 & MF3_FULLVOLACTIVE) ? ATTN_NONE : ATTN_IDLE);
}
}
@ -4099,11 +4099,11 @@ AActor *P_SpawnPuff (const PClass *pufftype, fixed_t x, fixed_t y, fixed_t z, an
if ((flags & PF_HITTHING) && puff->SeeSound)
{ // Hit thing sound
S_SoundID (puff, CHAN_BODY, puff->SeeSound, 1, ATTN_NORM);
S_Sound (puff, CHAN_BODY, puff->SeeSound, 1, ATTN_NORM);
}
else if (puff->AttackSound)
{
S_SoundID (puff, CHAN_BODY, puff->AttackSound, 1, ATTN_NORM);
S_Sound (puff, CHAN_BODY, puff->AttackSound, 1, ATTN_NORM);
}
}
@ -4382,13 +4382,13 @@ bool P_HitWater (AActor * thing, sector_t * sec, fixed_t z)
}
if (mo)
{
S_SoundID (mo, CHAN_ITEM, smallsplash ?
S_Sound (mo, CHAN_ITEM, smallsplash ?
splash->SmallSplashSound : splash->NormalSplashSound,
1, ATTN_IDLE);
}
else
{
S_SoundID (thing->x, thing->y, z, CHAN_ITEM, smallsplash ?
S_Sound (thing->x, thing->y, z, CHAN_ITEM, smallsplash ?
splash->SmallSplashSound : splash->NormalSplashSound,
1, ATTN_IDLE);
}
@ -4506,18 +4506,18 @@ void P_PlaySpawnSound(AActor *missile, AActor *spawner)
{
if (!(missile->flags & MF_SPAWNSOUNDSOURCE))
{
S_SoundID (missile, CHAN_VOICE, missile->SeeSound, 1, ATTN_NORM);
S_Sound (missile, CHAN_VOICE, missile->SeeSound, 1, ATTN_NORM);
}
else if (spawner != NULL)
{
S_SoundID (spawner, CHAN_WEAPON, missile->SeeSound, 1, ATTN_NORM);
S_Sound (spawner, CHAN_WEAPON, missile->SeeSound, 1, ATTN_NORM);
}
else
{
// If there is no spawner use the spawn position.
// But not in a silenced sector.
if (!(missile->Sector->Flags & SECF_SILENT))
S_SoundID (&missile->x, CHAN_WEAPON, missile->SeeSound, 1, ATTN_NORM);
S_Sound (&missile->x, CHAN_WEAPON, missile->SeeSound, 1, ATTN_NORM);
}
}
}
@ -4987,25 +4987,3 @@ void AActor::SetIdle()
if (idle == NULL) idle = SpawnState;
SetState(idle);
}
FArchive &operator<< (FArchive &arc, FSoundIndex &snd)
{
if (arc.IsStoring ())
{
arc.WriteName (snd.Index ? S_sfx[snd.Index].name.GetChars() : NULL);
}
else
{
const char *name = arc.ReadName ();
snd.Index = name != NULL ? S_FindSound (name) : 0;
}
return arc;
}
FArchive &operator<< (FArchive &arc, FSoundIndexWord &snd)
{
FSoundIndex snd2 = { snd.Index };
arc << snd2;
snd.Index = snd2.Index;
return arc;
}