- Added "SoundSequence" UDMF sector property. This is the name of the sound sequence to play for

the sector. Note that this contrasts with sound sequence things in that it takes a name and
  not a number. Also, placing a sound sequence thing in a sector will override this property.

SVN r2492 (trunk)
This commit is contained in:
Randy Heit 2010-08-07 04:32:18 +00:00
parent cb6e9b90fb
commit 9137ef04f6
11 changed files with 48 additions and 2 deletions

View file

@ -417,6 +417,7 @@ xx(Gravity)
xx(Lightcolor)
xx(Fadecolor)
xx(Desaturation)
xx(SoundSequence)
xx(Silent)
xx(Nofallingdamage)
xx(Dropactors)

View file

@ -432,6 +432,7 @@ static void LoadSectors (sectortype *bsec)
sec->lightlevel = (sec->GetPlaneLight(sector_t::floor) + sec->GetPlaneLight(sector_t::ceiling)) / 2;
sec->seqType = -1;
sec->SeqName = NAME_None;
sec->nextsec = -1;
sec->prevsec = -1;
sec->gravity = 1.f;

View file

@ -65,6 +65,10 @@ void DCeiling::PlayCeilingSound ()
{
SN_StartSequence (m_Sector, CHAN_CEILING, m_Sector->seqType, SEQ_PLATFORM, 0, false);
}
else if (m_Sector->SeqName != NAME_None)
{
SN_StartSequence (m_Sector, CHAN_CEILING, m_Sector->SeqName, 0);
}
else
{
if (m_Silent == 2)

View file

@ -237,6 +237,10 @@ void DDoor::DoorSound (bool raise) const
{
SN_StartSequence (m_Sector, CHAN_CEILING, m_Sector->seqType, SEQ_DOOR, choice);
}
else if (m_Sector->SeqName != NAME_None)
{
SN_StartSequence (m_Sector, CHAN_CEILING, m_Sector->SeqName, choice);
}
else
{
const char *snd;
@ -424,7 +428,7 @@ bool EV_DoDoor (DDoor::EVlDoor type, line_t *line, AActor *thing,
// Otherwise, just let the current one continue.
// FIXME: This should be check if the sound sequence has separate up/down
// paths, not if it was manually set.
if (sec->seqType == -1 || SN_CheckSequence(sec, CHAN_CEILING) == NULL)
if ((sec->seqType < 0 && sec->SeqName == NAME_None) || SN_CheckSequence(sec, CHAN_CEILING) == NULL)
{
door->DoorSound (false);
}

View file

@ -44,6 +44,10 @@ static void StartFloorSound (sector_t *sec)
{
SN_StartSequence (sec, CHAN_FLOOR, sec->seqType, SEQ_PLATFORM, 0);
}
else if (sec->SeqName != NAME_None)
{
SN_StartSequence (sec, CHAN_FLOOR, sec->SeqName, 0);
}
else
{
SN_StartSequence (sec, CHAN_FLOOR, "Floor", 0);

View file

@ -190,9 +190,17 @@ DPillar::DPillar (sector_t *sector, EPillar type, fixed_t speed,
}
if (sector->seqType >= 0)
{
SN_StartSequence (sector, CHAN_FLOOR, sector->seqType, SEQ_PLATFORM, 0);
}
else if (sector->SeqName != NAME_None)
{
SN_StartSequence (sector, CHAN_FLOOR, sector->SeqName, 0);
}
else
{
SN_StartSequence (sector, CHAN_FLOOR, "Floor", 0);
}
}
bool EV_DoPillar (DPillar::EPillar type, int tag, fixed_t speed, fixed_t height,

View file

@ -57,9 +57,17 @@ void DPlat::Serialize (FArchive &arc)
void DPlat::PlayPlatSound (const char *sound)
{
if (m_Sector->seqType >= 0)
{
SN_StartSequence (m_Sector, CHAN_FLOOR, m_Sector->seqType, SEQ_PLATFORM, 0);
}
else if (m_Sector->SeqName != NAME_None)
{
SN_StartSequence (m_Sector, CHAN_FLOOR, m_Sector->SeqName, 0);
}
else
{
SN_StartSequence (m_Sector, CHAN_FLOOR, sound, 0);
}
}
//

View file

@ -348,6 +348,15 @@ void P_SerializeWorld (FArchive &arc)
<< sec->interpolations[2]
<< sec->interpolations[3];
if (SaveVersion < 2492)
{
sec->SeqName = NAME_None;
}
else
{
arc << sec->SeqName;
}
sec->e->Serialize(arc);
if (arc.IsStoring ())
{

View file

@ -1407,6 +1407,7 @@ void P_LoadSectors (MapData * map)
ss->thinglist = NULL;
ss->touching_thinglist = NULL; // phares 3/14/98
ss->seqType = defSeqType;
ss->SeqName = NAME_None;
ss->nextsec = -1; //jff 2/26/98 add fields to support locking out
ss->prevsec = -1; // stair retriggering until build completes

View file

@ -1024,7 +1024,7 @@ struct UDMFParser
sec->SetYScale(sector_t::ceiling, FRACUNIT);
sec->thinglist = NULL;
sec->touching_thinglist = NULL; // phares 3/14/98
sec->seqType = (level.flags & LEVEL_SNDSEQTOTALCTRL)? 0:-1;
sec->seqType = (level.flags & LEVEL_SNDSEQTOTALCTRL) ? 0 : -1;
sec->nextsec = -1; //jff 2/26/98 add fields to support locking out
sec->prevsec = -1; // stair retriggering until build completes
sec->heightsec = NULL; // sector used to get floor and ceiling height
@ -1175,6 +1175,11 @@ struct UDMFParser
Flag(sec->Flags, SECF_FLOORDROP, key);
continue;
case NAME_SoundSequence:
sec->SeqName = CheckString(key);
sec->seqType = -1;
continue;
default:
break;
}

View file

@ -640,6 +640,7 @@ struct sector_t
int sky;
short seqType; // this sector's sound sequence
FNameNoInit SeqName; // Sound sequence name. Setting seqType non-negative will override this.
fixed_t soundorg[2]; // origin for any sounds played by the sector
int validcount; // if == validcount, already checked