mirror of
https://github.com/ZDoom/qzdoom.git
synced 2025-02-17 17:41:23 +00:00
- 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:
parent
cb6e9b90fb
commit
9137ef04f6
11 changed files with 48 additions and 2 deletions
|
@ -417,6 +417,7 @@ xx(Gravity)
|
||||||
xx(Lightcolor)
|
xx(Lightcolor)
|
||||||
xx(Fadecolor)
|
xx(Fadecolor)
|
||||||
xx(Desaturation)
|
xx(Desaturation)
|
||||||
|
xx(SoundSequence)
|
||||||
xx(Silent)
|
xx(Silent)
|
||||||
xx(Nofallingdamage)
|
xx(Nofallingdamage)
|
||||||
xx(Dropactors)
|
xx(Dropactors)
|
||||||
|
|
|
@ -432,6 +432,7 @@ static void LoadSectors (sectortype *bsec)
|
||||||
sec->lightlevel = (sec->GetPlaneLight(sector_t::floor) + sec->GetPlaneLight(sector_t::ceiling)) / 2;
|
sec->lightlevel = (sec->GetPlaneLight(sector_t::floor) + sec->GetPlaneLight(sector_t::ceiling)) / 2;
|
||||||
|
|
||||||
sec->seqType = -1;
|
sec->seqType = -1;
|
||||||
|
sec->SeqName = NAME_None;
|
||||||
sec->nextsec = -1;
|
sec->nextsec = -1;
|
||||||
sec->prevsec = -1;
|
sec->prevsec = -1;
|
||||||
sec->gravity = 1.f;
|
sec->gravity = 1.f;
|
||||||
|
|
|
@ -65,6 +65,10 @@ void DCeiling::PlayCeilingSound ()
|
||||||
{
|
{
|
||||||
SN_StartSequence (m_Sector, CHAN_CEILING, m_Sector->seqType, SEQ_PLATFORM, 0, false);
|
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
|
else
|
||||||
{
|
{
|
||||||
if (m_Silent == 2)
|
if (m_Silent == 2)
|
||||||
|
|
|
@ -237,6 +237,10 @@ void DDoor::DoorSound (bool raise) const
|
||||||
{
|
{
|
||||||
SN_StartSequence (m_Sector, CHAN_CEILING, m_Sector->seqType, SEQ_DOOR, choice);
|
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
|
else
|
||||||
{
|
{
|
||||||
const char *snd;
|
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.
|
// Otherwise, just let the current one continue.
|
||||||
// FIXME: This should be check if the sound sequence has separate up/down
|
// FIXME: This should be check if the sound sequence has separate up/down
|
||||||
// paths, not if it was manually set.
|
// 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);
|
door->DoorSound (false);
|
||||||
}
|
}
|
||||||
|
|
|
@ -44,6 +44,10 @@ static void StartFloorSound (sector_t *sec)
|
||||||
{
|
{
|
||||||
SN_StartSequence (sec, CHAN_FLOOR, sec->seqType, SEQ_PLATFORM, 0);
|
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
|
else
|
||||||
{
|
{
|
||||||
SN_StartSequence (sec, CHAN_FLOOR, "Floor", 0);
|
SN_StartSequence (sec, CHAN_FLOOR, "Floor", 0);
|
||||||
|
|
|
@ -190,9 +190,17 @@ DPillar::DPillar (sector_t *sector, EPillar type, fixed_t speed,
|
||||||
}
|
}
|
||||||
|
|
||||||
if (sector->seqType >= 0)
|
if (sector->seqType >= 0)
|
||||||
|
{
|
||||||
SN_StartSequence (sector, CHAN_FLOOR, sector->seqType, SEQ_PLATFORM, 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
|
else
|
||||||
|
{
|
||||||
SN_StartSequence (sector, CHAN_FLOOR, "Floor", 0);
|
SN_StartSequence (sector, CHAN_FLOOR, "Floor", 0);
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
bool EV_DoPillar (DPillar::EPillar type, int tag, fixed_t speed, fixed_t height,
|
bool EV_DoPillar (DPillar::EPillar type, int tag, fixed_t speed, fixed_t height,
|
||||||
|
|
|
@ -57,9 +57,17 @@ void DPlat::Serialize (FArchive &arc)
|
||||||
void DPlat::PlayPlatSound (const char *sound)
|
void DPlat::PlayPlatSound (const char *sound)
|
||||||
{
|
{
|
||||||
if (m_Sector->seqType >= 0)
|
if (m_Sector->seqType >= 0)
|
||||||
|
{
|
||||||
SN_StartSequence (m_Sector, CHAN_FLOOR, m_Sector->seqType, SEQ_PLATFORM, 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
|
else
|
||||||
|
{
|
||||||
SN_StartSequence (m_Sector, CHAN_FLOOR, sound, 0);
|
SN_StartSequence (m_Sector, CHAN_FLOOR, sound, 0);
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
//
|
//
|
||||||
|
|
|
@ -348,6 +348,15 @@ void P_SerializeWorld (FArchive &arc)
|
||||||
<< sec->interpolations[2]
|
<< sec->interpolations[2]
|
||||||
<< sec->interpolations[3];
|
<< sec->interpolations[3];
|
||||||
|
|
||||||
|
if (SaveVersion < 2492)
|
||||||
|
{
|
||||||
|
sec->SeqName = NAME_None;
|
||||||
|
}
|
||||||
|
else
|
||||||
|
{
|
||||||
|
arc << sec->SeqName;
|
||||||
|
}
|
||||||
|
|
||||||
sec->e->Serialize(arc);
|
sec->e->Serialize(arc);
|
||||||
if (arc.IsStoring ())
|
if (arc.IsStoring ())
|
||||||
{
|
{
|
||||||
|
|
|
@ -1407,6 +1407,7 @@ void P_LoadSectors (MapData * map)
|
||||||
ss->thinglist = NULL;
|
ss->thinglist = NULL;
|
||||||
ss->touching_thinglist = NULL; // phares 3/14/98
|
ss->touching_thinglist = NULL; // phares 3/14/98
|
||||||
ss->seqType = defSeqType;
|
ss->seqType = defSeqType;
|
||||||
|
ss->SeqName = NAME_None;
|
||||||
ss->nextsec = -1; //jff 2/26/98 add fields to support locking out
|
ss->nextsec = -1; //jff 2/26/98 add fields to support locking out
|
||||||
ss->prevsec = -1; // stair retriggering until build completes
|
ss->prevsec = -1; // stair retriggering until build completes
|
||||||
|
|
||||||
|
|
|
@ -1024,7 +1024,7 @@ struct UDMFParser
|
||||||
sec->SetYScale(sector_t::ceiling, FRACUNIT);
|
sec->SetYScale(sector_t::ceiling, FRACUNIT);
|
||||||
sec->thinglist = NULL;
|
sec->thinglist = NULL;
|
||||||
sec->touching_thinglist = NULL; // phares 3/14/98
|
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->nextsec = -1; //jff 2/26/98 add fields to support locking out
|
||||||
sec->prevsec = -1; // stair retriggering until build completes
|
sec->prevsec = -1; // stair retriggering until build completes
|
||||||
sec->heightsec = NULL; // sector used to get floor and ceiling height
|
sec->heightsec = NULL; // sector used to get floor and ceiling height
|
||||||
|
@ -1175,6 +1175,11 @@ struct UDMFParser
|
||||||
Flag(sec->Flags, SECF_FLOORDROP, key);
|
Flag(sec->Flags, SECF_FLOORDROP, key);
|
||||||
continue;
|
continue;
|
||||||
|
|
||||||
|
case NAME_SoundSequence:
|
||||||
|
sec->SeqName = CheckString(key);
|
||||||
|
sec->seqType = -1;
|
||||||
|
continue;
|
||||||
|
|
||||||
default:
|
default:
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
|
|
|
@ -640,6 +640,7 @@ struct sector_t
|
||||||
|
|
||||||
int sky;
|
int sky;
|
||||||
short seqType; // this sector's sound sequence
|
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
|
fixed_t soundorg[2]; // origin for any sounds played by the sector
|
||||||
int validcount; // if == validcount, already checked
|
int validcount; // if == validcount, already checked
|
||||||
|
|
Loading…
Reference in a new issue