- Added a channel parameter to the sector overload of SN_StopSequence() so

it can be properly paired with calls to SN_StartSequence().


SVN r2043 (trunk)
This commit is contained in:
Randy Heit 2009-12-25 02:19:50 +00:00
parent f667e68c94
commit 9eb5fdd276
8 changed files with 31 additions and 15 deletions

View file

@ -1,4 +1,6 @@
December 24, 2009 December 24, 2009
- Added a channel parameter to the sector overload of SN_StopSequence() so
it can be properly paired with calls to SN_StartSequence().
- Fixed: P_CheckPlayerSprites() ignored the MF4_NOSKIN flag. It now also sets - Fixed: P_CheckPlayerSprites() ignored the MF4_NOSKIN flag. It now also sets
the X scale, so switching skins while morphed does not produce weird the X scale, so switching skins while morphed does not produce weird
stretching upon unmorphing. stretching upon unmorphing.

View file

@ -112,7 +112,7 @@ void DCeiling::Tick ()
m_Sector->SetTexture(sector_t::ceiling, m_Texture); m_Sector->SetTexture(sector_t::ceiling, m_Texture);
// fall through // fall through
default: default:
SN_StopSequence (m_Sector); SN_StopSequence (m_Sector, CHAN_CEILING);
Destroy (); Destroy ();
break; break;
} }
@ -145,7 +145,7 @@ void DCeiling::Tick ()
m_Sector->SetTexture(sector_t::ceiling, m_Texture); m_Sector->SetTexture(sector_t::ceiling, m_Texture);
// fall through // fall through
default: default:
SN_StopSequence (m_Sector); SN_StopSequence (m_Sector, CHAN_CEILING);
Destroy (); Destroy ();
break; break;
} }
@ -500,7 +500,7 @@ bool EV_CeilingCrushStop (int tag)
{ {
if (scan->m_Tag == tag && scan->m_Direction != 0) if (scan->m_Tag == tag && scan->m_Direction != 0)
{ {
SN_StopSequence (scan->m_Sector); SN_StopSequence (scan->m_Sector, CHAN_CEILING);
scan->m_OldDirection = scan->m_Direction; scan->m_OldDirection = scan->m_Direction;
scan->m_Direction = 0; // in-stasis; scan->m_Direction = 0; // in-stasis;
rtn = true; rtn = true;

View file

@ -133,7 +133,7 @@ void DDoor::Tick ()
if (res == pastdest) if (res == pastdest)
{ {
SN_StopSequence (m_Sector); SN_StopSequence (m_Sector, CHAN_CEILING);
switch (m_Type) switch (m_Type)
{ {
case doorRaise: case doorRaise:
@ -179,7 +179,7 @@ void DDoor::Tick ()
if (res == pastdest) if (res == pastdest)
{ {
SN_StopSequence (m_Sector); SN_StopSequence (m_Sector, CHAN_CEILING);
switch (m_Type) switch (m_Type)
{ {
case doorRaise: case doorRaise:

View file

@ -126,7 +126,7 @@ void DFloor::Tick ()
if (res == pastdest) if (res == pastdest)
{ {
SN_StopSequence (m_Sector); SN_StopSequence (m_Sector, CHAN_FLOOR);
if (m_Type == buildStair) if (m_Type == buildStair)
m_Type = waitStair; m_Type = waitStair;
@ -530,7 +530,7 @@ bool EV_FloorCrushStop (int tag)
if (sec->floordata && sec->floordata->IsKindOf (RUNTIME_CLASS(DFloor)) && if (sec->floordata && sec->floordata->IsKindOf (RUNTIME_CLASS(DFloor)) &&
barrier_cast<DFloor *>(sec->floordata)->m_Type == DFloor::floorRaiseAndCrush) barrier_cast<DFloor *>(sec->floordata)->m_Type == DFloor::floorRaiseAndCrush)
{ {
SN_StopSequence (sec); SN_StopSequence (sec, CHAN_FLOOR);
sec->floordata->Destroy (); sec->floordata->Destroy ();
sec->floordata = NULL; sec->floordata = NULL;
} }
@ -959,7 +959,7 @@ void DElevator::Tick ()
if (res == pastdest) // if destination height acheived if (res == pastdest) // if destination height acheived
{ {
// make floor stop sound // make floor stop sound
SN_StopSequence (m_Sector); SN_StopSequence (m_Sector, CHAN_FLOOR);
m_Sector->floordata = NULL; //jff 2/22/98 m_Sector->floordata = NULL; //jff 2/22/98
m_Sector->ceilingdata = NULL; //jff 2/22/98 m_Sector->ceilingdata = NULL; //jff 2/22/98

View file

@ -98,7 +98,7 @@ void DPillar::Tick ()
if (r == pastdest && s == pastdest) if (r == pastdest && s == pastdest)
{ {
SN_StopSequence (m_Sector); SN_StopSequence (m_Sector, CHAN_FLOOR);
Destroy (); Destroy ();
} }
else else

View file

@ -82,7 +82,7 @@ void DPlat::Tick ()
} }
else if (res == pastdest) else if (res == pastdest)
{ {
SN_StopSequence (m_Sector); SN_StopSequence (m_Sector, CHAN_FLOOR);
if (m_Type != platToggle) if (m_Type != platToggle)
{ {
m_Count = m_Wait; m_Count = m_Wait;
@ -121,7 +121,7 @@ void DPlat::Tick ()
if (res == pastdest) if (res == pastdest)
{ {
SN_StopSequence (m_Sector); SN_StopSequence (m_Sector, CHAN_FLOOR);
// if not an instant toggle, start waiting // if not an instant toggle, start waiting
if (m_Type != platToggle) //jff 3/14/98 toggle up down if (m_Type != platToggle) //jff 3/14/98 toggle up down
{ // is silent, instant, no waiting { // is silent, instant, no waiting

View file

@ -849,7 +849,7 @@ DSeqNode *SN_StartSequence (sector_t *sector, int chan, int sequence, seqtype_t
{ {
if (!nostop) if (!nostop)
{ {
SN_StopSequence (sector); SN_StopSequence (sector, chan);
} }
if (TwiddleSeqNum (sequence, type)) if (TwiddleSeqNum (sequence, type))
{ {
@ -963,9 +963,23 @@ void SN_StopSequence (AActor *actor)
SN_DoStop (actor); SN_DoStop (actor);
} }
void SN_StopSequence (sector_t *sector) void SN_StopSequence (sector_t *sector, int chan)
{ {
SN_DoStop (sector); DSeqNode *node;
for (node = DSeqNode::FirstSequence(); node; )
{
DSeqNode *next = node->NextSequence();
if (node->Source() == sector)
{
assert(node->IsKindOf(RUNTIME_CLASS(DSeqSectorNode)));
if ((static_cast<DSeqSectorNode *>(node)->Channel & 7) == chan)
{
node->StopAndDestroy ();
}
}
node = next;
}
} }
void SN_StopSequence (FPolyObj *poly) void SN_StopSequence (FPolyObj *poly)

View file

@ -86,7 +86,7 @@ DSeqNode *SN_StartSequence (sector_t *sec, int chan, FName seqname, int modenum)
DSeqNode *SN_StartSequence (FPolyObj *poly, int sequence, seqtype_t type, int modenum, bool nostop=false); DSeqNode *SN_StartSequence (FPolyObj *poly, int sequence, seqtype_t type, int modenum, bool nostop=false);
DSeqNode *SN_StartSequence (FPolyObj *poly, const char *name, int modenum); DSeqNode *SN_StartSequence (FPolyObj *poly, const char *name, int modenum);
void SN_StopSequence (AActor *mobj); void SN_StopSequence (AActor *mobj);
void SN_StopSequence (sector_t *sector); void SN_StopSequence (sector_t *sector, int chan);
void SN_StopSequence (FPolyObj *poly); void SN_StopSequence (FPolyObj *poly);
void SN_UpdateActiveSequences (void); void SN_UpdateActiveSequences (void);
ptrdiff_t SN_GetSequenceOffset (int sequence, SDWORD *sequencePtr); ptrdiff_t SN_GetSequenceOffset (int sequence, SDWORD *sequencePtr);