- made most of the EV_* functions part of FLevelLocals.

This commit is contained in:
Christoph Oelckers 2019-01-26 08:28:45 +01:00
parent 28761b4c33
commit 10feb446fa
13 changed files with 282 additions and 351 deletions

View file

@ -1586,7 +1586,7 @@ void FParser::SF_MoveFloor(void)
auto itr = Level->GetSectorTagIterator(tagnum); auto itr = Level->GetSectorTagIterator(tagnum);
while ((secnum = itr.Next()) >= 0) while ((secnum = itr.Next()) >= 0)
{ {
P_CreateFloor(&Level->sectors[secnum], DFloor::floorMoveToValue, NULL, platspeed, destheight, crush, 0, false, false); Level->CreateFloor(&Level->sectors[secnum], DFloor::floorMoveToValue, NULL, platspeed, destheight, crush, 0, false, false);
} }
} }
} }
@ -1678,7 +1678,7 @@ void FParser::SF_MoveCeiling(void)
auto itr = Level->GetSectorTagIterator(tagnum); auto itr = Level->GetSectorTagIterator(tagnum);
while ((secnum = itr.Next()) >= 0) while ((secnum = itr.Next()) >= 0)
{ {
P_CreateCeiling(&Level->sectors[secnum], DCeiling::ceilMoveToValue, NULL, tagnum, platspeed, platspeed, destheight, crush, silent | 4, 0, DCeiling::ECrushMode::crushDoom); Level->CreateCeiling(&Level->sectors[secnum], DCeiling::ceilMoveToValue, NULL, tagnum, platspeed, platspeed, destheight, crush, silent | 4, 0, DCeiling::ECrushMode::crushDoom);
} }
} }
} }
@ -2015,7 +2015,7 @@ void FParser::SF_OpenDoor(void)
if(t_argc > 2) speed = intvalue(t_argv[2]); if(t_argc > 2) speed = intvalue(t_argv[2]);
else speed = 1; // 1= normal speed else speed = 1; // 1= normal speed
EV_DoDoor(wait_time ? DDoor::doorRaise : DDoor::doorOpen, NULL, NULL, sectag, 2. * clamp(speed, 1, 127), wait_time, 0, 0); Level->EV_DoDoor(wait_time ? DDoor::doorRaise : DDoor::doorOpen, NULL, NULL, sectag, 2. * clamp(speed, 1, 127), wait_time, 0, 0);
} }
} }
@ -2040,7 +2040,7 @@ void FParser::SF_CloseDoor(void)
if(t_argc > 1) speed = intvalue(t_argv[1]); if(t_argc > 1) speed = intvalue(t_argv[1]);
else speed = 1; // 1= normal speed else speed = 1; // 1= normal speed
EV_DoDoor(DDoor::doorClose, NULL, NULL, sectag, 2.*clamp(speed, 1, 127), 0, 0, 0); Level->EV_DoDoor(DDoor::doorClose, NULL, NULL, sectag, 2.*clamp(speed, 1, 127), 0, 0, 0);
} }
} }
@ -3617,8 +3617,8 @@ void FParser::SF_ThingCount(void)
// If we want to count map items we must consider actor replacement // If we want to count map items we must consider actor replacement
pClass = pClass->GetReplacement(); pClass = pClass->GetReplacement();
again: again:
TThinkerIterator<AActor> it; auto it = Level->GetThinkerIterator<AActor>();
if (t_argc<2 || intvalue(t_argv[1])==0 || pClass->IsDescendantOf(NAME_Inventory)) if (t_argc<2 || intvalue(t_argv[1])==0 || pClass->IsDescendantOf(NAME_Inventory))
{ {
@ -3759,7 +3759,7 @@ void FParser::SF_KillInSector()
{ {
if (CheckArgs(1)) if (CheckArgs(1))
{ {
TThinkerIterator<AActor> it; auto it = Level->GetThinkerIterator<AActor>();
AActor * mo; AActor * mo;
int tag=intvalue(t_argv[0]); int tag=intvalue(t_argv[0]);

View file

@ -45,6 +45,7 @@
#include "po_man.h" #include "po_man.h"
#include "p_acs.h" #include "p_acs.h"
#include "p_tags.h" #include "p_tags.h"
#include "p_spec.h"
#include "actor.h" #include "actor.h"
#include "p_destructible.h" #include "p_destructible.h"
#include "r_data/r_sections.h" #include "r_data/r_sections.h"
@ -192,6 +193,28 @@ public:
DVector2 GetPortalOffsetPosition(double x, double y, double dx, double dy); DVector2 GetPortalOffsetPosition(double x, double y, double dx, double dy);
bool CollectConnectedGroups(int startgroup, const DVector3 &position, double upperz, double checkradius, FPortalGroupArray &out); bool CollectConnectedGroups(int startgroup, const DVector3 &position, double upperz, double checkradius, FPortalGroupArray &out);
void ActivateInStasisPlat(int tag);
bool CreateCeiling(sector_t *sec, DCeiling::ECeiling type, line_t *line, int tag, double speed, double speed2, double height, int crush, int silent, int change, DCeiling::ECrushMode hexencrush);
void ActivateInStasisCeiling(int tag);
bool CreateFloor(sector_t *sec, DFloor::EFloor floortype, line_t *line, double speed, double height, int crush, int change, bool hexencrush, bool hereticlower);
bool EV_DoPlat(int tag, line_t *line, DPlat::EPlatType type, double height, double speed, int delay, int lip, int change);
void EV_StopPlat(int tag, bool remove);
bool EV_DoPillar(DPillar::EPillar type, line_t *line, int tag, double speed, double height, double height2, int crush, bool hexencrush);
bool EV_DoDoor(DDoor::EVlDoor type, line_t *line, AActor *thing, int tag, double speed, int delay, int lock, int lightTag, bool boomgen = false, int topcountdown = 0);
bool EV_SlidingDoor(line_t *line, AActor *thing, int tag, int speed, int delay, DAnimatedDoor::EADType type);
bool EV_DoCeiling(DCeiling::ECeiling type, line_t *line, int tag, double speed, double speed2, double height, int crush, int silent, int change, DCeiling::ECrushMode hexencrush = DCeiling::ECrushMode::crushDoom);
bool EV_CeilingCrushStop(int tag, bool remove);
bool EV_StopCeiling(int tag, line_t *line);
bool EV_BuildStairs(int tag, DFloor::EStair type, line_t *line, double stairsize, double speed, int delay, int reset, int igntxt, int usespecials);
bool EV_DoFloor(DFloor::EFloor floortype, line_t *line, int tag, double speed, double height, int crush, int change, bool hexencrush, bool hereticlower = false);
bool EV_FloorCrushStop(int tag, line_t *line);
bool EV_StopFloor(int tag, line_t *line);
bool EV_DoDonut(int tag, line_t *line, double pillarspeed, double slimespeed);
bool EV_DoElevator(line_t *line, DElevator::EElevator type, double speed, double height, int tag);
bool EV_StartWaggle(int tag, line_t *line, int height, int speed, int offset, int timer, bool ceiling);
bool EV_DoChange(line_t *line, EChange changetype, int tag);
private: private:
// Work data for CollectConnectedGroups. // Work data for CollectConnectedGroups.
FPortalBits processMask; FPortalBits processMask;

View file

@ -3626,7 +3626,7 @@ do_count:
} }
else else
{ {
TThinkerIterator<AActor> iterator; auto iterator = Level->GetThinkerIterator<AActor>();
while ( (actor = iterator.Next ()) ) while ( (actor = iterator.Next ()) )
{ {
if (actor->health > 0 && if (actor->health > 0 &&
@ -9340,7 +9340,7 @@ scriptwait:
case PCD_CANCELFADE: case PCD_CANCELFADE:
{ {
TThinkerIterator<DFlashFader> iterator; auto iterator = Level->GetThinkerIterator<DFlashFader>();
DFlashFader *fader; DFlashFader *fader;
while ( (fader = iterator.Next()) ) while ( (fader = iterator.Next()) )

View file

@ -47,10 +47,6 @@
IMPLEMENT_CLASS(DCeiling, false, false) IMPLEMENT_CLASS(DCeiling, false, false)
DCeiling::DCeiling ()
{
}
//============================================================================ //============================================================================
// //
// //
@ -235,7 +231,7 @@ DCeiling::DCeiling (sector_t *sec, double speed1, double speed2, int silent)
// //
//============================================================================ //============================================================================
bool P_CreateCeiling(sector_t *sec, DCeiling::ECeiling type, line_t *line, int tag, bool FLevelLocals::CreateCeiling(sector_t *sec, DCeiling::ECeiling type, line_t *line, int tag,
double speed, double speed2, double height, double speed, double speed2, double height,
int crush, int silent, int change, DCeiling::ECrushMode hexencrush) int crush, int silent, int change, DCeiling::ECrushMode hexencrush)
{ {
@ -465,9 +461,9 @@ bool P_CreateCeiling(sector_t *sec, DCeiling::ECeiling type, line_t *line, int t
return ceiling != NULL; return ceiling != NULL;
} }
DEFINE_ACTION_FUNCTION(DCeiling, CreateCeiling) DEFINE_ACTION_FUNCTION(FLevelLocals, CreateCeiling)
{ {
PARAM_PROLOGUE; PARAM_SELF_STRUCT_PROLOGUE(FLevelLocals);
PARAM_POINTER_NOT_NULL(sec, sector_t); PARAM_POINTER_NOT_NULL(sec, sector_t);
PARAM_INT(type); PARAM_INT(type);
PARAM_POINTER(ln, line_t); PARAM_POINTER(ln, line_t);
@ -478,7 +474,7 @@ DEFINE_ACTION_FUNCTION(DCeiling, CreateCeiling)
PARAM_INT(silent); PARAM_INT(silent);
PARAM_INT(change); PARAM_INT(change);
PARAM_INT(crushmode); PARAM_INT(crushmode);
ACTION_RETURN_BOOL(P_CreateCeiling(sec, (DCeiling::ECeiling)type, ln, 0, speed, speed2, height, crush, silent, change, (DCeiling::ECrushMode)crushmode)); ACTION_RETURN_BOOL(self->CreateCeiling(sec, (DCeiling::ECeiling)type, ln, 0, speed, speed2, height, crush, silent, change, (DCeiling::ECrushMode)crushmode));
} }
//============================================================================ //============================================================================
@ -490,7 +486,7 @@ DEFINE_ACTION_FUNCTION(DCeiling, CreateCeiling)
// //
//============================================================================ //============================================================================
bool EV_DoCeiling (DCeiling::ECeiling type, line_t *line, bool FLevelLocals::EV_DoCeiling (DCeiling::ECeiling type, line_t *line,
int tag, double speed, double speed2, double height, int tag, double speed, double speed2, double height,
int crush, int silent, int change, DCeiling::ECrushMode hexencrush) int crush, int silent, int change, DCeiling::ECrushMode hexencrush)
{ {
@ -508,22 +504,22 @@ bool EV_DoCeiling (DCeiling::ECeiling type, line_t *line,
secnum = sec->sectornum; secnum = sec->sectornum;
// [RH] Hack to let manual crushers be retriggerable, too // [RH] Hack to let manual crushers be retriggerable, too
tag ^= secnum | 0x1000000; tag ^= secnum | 0x1000000;
P_ActivateInStasisCeiling (tag); ActivateInStasisCeiling (tag);
return P_CreateCeiling(sec, type, line, tag, speed, speed2, height, crush, silent, change, hexencrush); return CreateCeiling(sec, type, line, tag, speed, speed2, height, crush, silent, change, hexencrush);
} }
// Reactivate in-stasis ceilings...for certain types. // Reactivate in-stasis ceilings...for certain types.
// This restarts a crusher after it has been stopped // This restarts a crusher after it has been stopped
if (type == DCeiling::ceilCrushAndRaise) if (type == DCeiling::ceilCrushAndRaise)
{ {
P_ActivateInStasisCeiling (tag); ActivateInStasisCeiling (tag);
} }
// affects all sectors with the same tag as the linedef // affects all sectors with the same tag as the linedef
auto it = level.GetSectorTagIterator(tag); auto it = GetSectorTagIterator(tag);
while ((secnum = it.Next()) >= 0) while ((secnum = it.Next()) >= 0)
{ {
rtn |= P_CreateCeiling(&level.sectors[secnum], type, line, tag, speed, speed2, height, crush, silent, change, hexencrush); rtn |= CreateCeiling(&sectors[secnum], type, line, tag, speed, speed2, height, crush, silent, change, hexencrush);
} }
return rtn; return rtn;
} }
@ -536,10 +532,10 @@ bool EV_DoCeiling (DCeiling::ECeiling type, line_t *line,
// //
//============================================================================ //============================================================================
void P_ActivateInStasisCeiling (int tag) void FLevelLocals::ActivateInStasisCeiling (int tag)
{ {
DCeiling *scan; DCeiling *scan;
TThinkerIterator<DCeiling> iterator; auto iterator = GetThinkerIterator<DCeiling>();
while ( (scan = iterator.Next ()) ) while ( (scan = iterator.Next ()) )
{ {
@ -559,13 +555,12 @@ void P_ActivateInStasisCeiling (int tag)
// //
//============================================================================ //============================================================================
bool EV_CeilingCrushStop (int tag, bool remove) bool FLevelLocals::EV_CeilingCrushStop (int tag, bool remove)
{ {
bool rtn = false; bool rtn = false;
DCeiling *scan; auto iterator = GetThinkerIterator<DCeiling>();
TThinkerIterator<DCeiling> iterator;
scan = iterator.Next(); auto scan = iterator.Next();
while (scan != nullptr) while (scan != nullptr)
{ {
DCeiling *next = iterator.Next(); DCeiling *next = iterator.Next();
@ -589,17 +584,17 @@ bool EV_CeilingCrushStop (int tag, bool remove)
return rtn; return rtn;
} }
bool EV_StopCeiling(int tag, line_t *line) bool FLevelLocals::EV_StopCeiling(int tag, line_t *line)
{ {
int sec; int sec;
auto it = level.GetSectorTagIterator(tag, line); auto it = GetSectorTagIterator(tag, line);
while ((sec = it.Next()) >= 0) while ((sec = it.Next()) >= 0)
{ {
if (level.sectors[sec].ceilingdata) if (sectors[sec].ceilingdata)
{ {
SN_StopSequence(&level.sectors[sec], CHAN_CEILING); SN_StopSequence(&sectors[sec], CHAN_CEILING);
level.sectors[sec].ceilingdata->Destroy(); sectors[sec].ceilingdata->Destroy();
level.sectors[sec].ceilingdata = nullptr; sectors[sec].ceilingdata = nullptr;
} }
} }
return true; return true;

View file

@ -47,10 +47,6 @@
IMPLEMENT_CLASS(DDoor, false, false) IMPLEMENT_CLASS(DDoor, false, false)
DDoor::DDoor ()
{
}
void DDoor::Serialize(FSerializer &arc) void DDoor::Serialize(FSerializer &arc)
{ {
Super::Serialize (arc); Super::Serialize (arc);
@ -417,7 +413,7 @@ DDoor::DDoor (sector_t *sec, EVlDoor type, double speed, int delay, int lightTag
// //
//============================================================================ //============================================================================
bool EV_DoDoor (DDoor::EVlDoor type, line_t *line, AActor *thing, bool FLevelLocals::EV_DoDoor (DDoor::EVlDoor type, line_t *line, AActor *thing,
int tag, double speed, int delay, int lock, int lightTag, bool boomgen, int topcountdown) int tag, double speed, int delay, int lock, int lightTag, bool boomgen, int topcountdown)
{ {
bool rtn = false; bool rtn = false;
@ -490,10 +486,10 @@ bool EV_DoDoor (DDoor::EVlDoor type, line_t *line, AActor *thing,
else else
{ // [RH] Remote door { // [RH] Remote door
auto it = level.GetSectorTagIterator(tag); auto it = GetSectorTagIterator(tag);
while ((secnum = it.Next()) >= 0) while ((secnum = it.Next()) >= 0)
{ {
sec = &level.sectors[secnum]; sec = &sectors[secnum];
// if the ceiling is already moving, don't start the door action // if the ceiling is already moving, don't start the door action
if (sec->PlaneMoving(sector_t::ceiling)) if (sec->PlaneMoving(sector_t::ceiling))
continue; continue;
@ -514,10 +510,6 @@ bool EV_DoDoor (DDoor::EVlDoor type, line_t *line, AActor *thing,
IMPLEMENT_CLASS(DAnimatedDoor, false, false) IMPLEMENT_CLASS(DAnimatedDoor, false, false)
DAnimatedDoor::DAnimatedDoor ()
{
}
DAnimatedDoor::DAnimatedDoor (sector_t *sec) DAnimatedDoor::DAnimatedDoor (sector_t *sec)
: DMovingCeiling (sec, false) : DMovingCeiling (sec, false)
{ {
@ -748,7 +740,7 @@ DAnimatedDoor::DAnimatedDoor (sector_t *sec, line_t *line, int speed, int delay,
// //
//============================================================================ //============================================================================
bool EV_SlidingDoor (line_t *line, AActor *actor, int tag, int speed, int delay, DAnimatedDoor::EADType type) bool FLevelLocals::EV_SlidingDoor (line_t *line, AActor *actor, int tag, int speed, int delay, DAnimatedDoor::EADType type)
{ {
sector_t *sec; sector_t *sec;
int secnum; int secnum;
@ -787,10 +779,10 @@ bool EV_SlidingDoor (line_t *line, AActor *actor, int tag, int speed, int delay,
return false; return false;
} }
auto it = level.GetSectorTagIterator(tag); auto it = GetSectorTagIterator(tag);
while ((secnum = it.Next()) >= 0) while ((secnum = it.Next()) >= 0)
{ {
sec = &level.sectors[secnum]; sec = &sectors[secnum];
if (sec->ceilingdata != NULL) if (sec->ceilingdata != NULL)
{ {
continue; continue;

View file

@ -3074,9 +3074,10 @@ void A_BossDeath(AActor *self)
// Do generic special death actions first // Do generic special death actions first
bool checked = false; bool checked = false;
for (unsigned i = 0; i < level.info->specialactions.Size(); i++) auto Level = &level;
for (unsigned i = 0; i < Level->info->specialactions.Size(); i++)
{ {
FSpecialAction *sa = &level.info->specialactions[i]; FSpecialAction *sa = &Level->info->specialactions[i];
if (type == sa->Type || mytype == sa->Type) if (type == sa->Type || mytype == sa->Type)
{ {
@ -3094,7 +3095,7 @@ void A_BossDeath(AActor *self)
// [RH] These all depend on the presence of level flags now // [RH] These all depend on the presence of level flags now
// rather than being hard-coded to specific levels/episodes. // rather than being hard-coded to specific levels/episodes.
if ((level.flags & (LEVEL_MAP07SPECIAL| if ((Level->flags & (LEVEL_MAP07SPECIAL|
LEVEL_BRUISERSPECIAL| LEVEL_BRUISERSPECIAL|
LEVEL_CYBORGSPECIAL| LEVEL_CYBORGSPECIAL|
LEVEL_SPIDERSPECIAL| LEVEL_SPIDERSPECIAL|
@ -3104,13 +3105,13 @@ void A_BossDeath(AActor *self)
return; return;
if ((i_compatflags & COMPATF_ANYBOSSDEATH) || ( // [GZ] Added for UAC_DEAD if ((i_compatflags & COMPATF_ANYBOSSDEATH) || ( // [GZ] Added for UAC_DEAD
((level.flags & LEVEL_MAP07SPECIAL) && (type == NAME_Fatso || type == NAME_Arachnotron)) || ((Level->flags & LEVEL_MAP07SPECIAL) && (type == NAME_Fatso || type == NAME_Arachnotron)) ||
((level.flags & LEVEL_BRUISERSPECIAL) && (type == NAME_BaronOfHell)) || ((Level->flags & LEVEL_BRUISERSPECIAL) && (type == NAME_BaronOfHell)) ||
((level.flags & LEVEL_CYBORGSPECIAL) && (type == NAME_Cyberdemon)) || ((Level->flags & LEVEL_CYBORGSPECIAL) && (type == NAME_Cyberdemon)) ||
((level.flags & LEVEL_SPIDERSPECIAL) && (type == NAME_SpiderMastermind)) || ((Level->flags & LEVEL_SPIDERSPECIAL) && (type == NAME_SpiderMastermind)) ||
((level.flags & LEVEL_HEADSPECIAL) && (type == NAME_Ironlich)) || ((Level->flags & LEVEL_HEADSPECIAL) && (type == NAME_Ironlich)) ||
((level.flags & LEVEL_MINOTAURSPECIAL) && (type == NAME_Minotaur)) || ((Level->flags & LEVEL_MINOTAURSPECIAL) && (type == NAME_Minotaur)) ||
((level.flags & LEVEL_SORCERER2SPECIAL) && (type == NAME_Sorcerer2)) ((Level->flags & LEVEL_SORCERER2SPECIAL) && (type == NAME_Sorcerer2))
)) ))
; ;
else else
@ -3122,43 +3123,43 @@ void A_BossDeath(AActor *self)
} }
// victory! // victory!
if (level.flags & LEVEL_SPECKILLMONSTERS) if (Level->flags & LEVEL_SPECKILLMONSTERS)
{ // Kill any remaining monsters { // Kill any remaining monsters
P_Massacre (); P_Massacre ();
} }
if (level.flags & LEVEL_MAP07SPECIAL) if (Level->flags & LEVEL_MAP07SPECIAL)
{ {
if (type == NAME_Fatso) if (type == NAME_Fatso)
{ {
EV_DoFloor (DFloor::floorLowerToLowest, NULL, 666, 1., 0, -1, 0, false); Level->EV_DoFloor (DFloor::floorLowerToLowest, NULL, 666, 1., 0, -1, 0, false);
return; return;
} }
if (type == NAME_Arachnotron) if (type == NAME_Arachnotron)
{ {
EV_DoFloor (DFloor::floorRaiseByTexture, NULL, 667, 1., 0, -1, 0, false); Level->EV_DoFloor (DFloor::floorRaiseByTexture, NULL, 667, 1., 0, -1, 0, false);
return; return;
} }
} }
else else
{ {
switch (level.flags & LEVEL_SPECACTIONSMASK) switch (Level->flags & LEVEL_SPECACTIONSMASK)
{ {
case LEVEL_SPECLOWERFLOOR: case LEVEL_SPECLOWERFLOOR:
EV_DoFloor (DFloor::floorLowerToLowest, NULL, 666, 1., 0, -1, 0, false); Level->EV_DoFloor (DFloor::floorLowerToLowest, NULL, 666, 1., 0, -1, 0, false);
return; return;
case LEVEL_SPECLOWERFLOORTOHIGHEST: case LEVEL_SPECLOWERFLOORTOHIGHEST:
EV_DoFloor (DFloor::floorLowerToHighest, NULL, 666, 1., 0, -1, 0, false); Level->EV_DoFloor (DFloor::floorLowerToHighest, NULL, 666, 1., 0, -1, 0, false);
return; return;
case LEVEL_SPECOPENDOOR: case LEVEL_SPECOPENDOOR:
EV_DoDoor (DDoor::doorOpen, NULL, NULL, 666, 8., 0, 0, 0); Level->EV_DoDoor (DDoor::doorOpen, NULL, NULL, 666, 8., 0, 0, 0);
return; return;
} }
} }
// [RH] If noexit, then don't end the level. // [RH] If noexit, then don't end the Level->
if ((deathmatch || alwaysapplydmflags) && (dmflags & DF_NO_EXIT)) if ((deathmatch || alwaysapplydmflags) && (dmflags & DF_NO_EXIT))
return; return;

View file

@ -73,10 +73,6 @@ static void StartFloorSound (sector_t *sec)
IMPLEMENT_CLASS(DFloor, false, false) IMPLEMENT_CLASS(DFloor, false, false)
DFloor::DFloor ()
{
}
void DFloor::Serialize(FSerializer &arc) void DFloor::Serialize(FSerializer &arc)
{ {
Super::Serialize (arc); Super::Serialize (arc);
@ -270,7 +266,7 @@ DFloor::DFloor (sector_t *sec)
// //
//========================================================================== //==========================================================================
bool P_CreateFloor(sector_t *sec, DFloor::EFloor floortype, line_t *line, bool FLevelLocals::CreateFloor(sector_t *sec, DFloor::EFloor floortype, line_t *line,
double speed, double height, int crush, int change, bool hexencrush, bool hereticlower) double speed, double height, int crush, int change, bool hexencrush, bool hereticlower)
{ {
bool rtn; bool rtn;
@ -502,9 +498,9 @@ bool P_CreateFloor(sector_t *sec, DFloor::EFloor floortype, line_t *line,
return true; return true;
} }
DEFINE_ACTION_FUNCTION(DFloor, CreateFloor) DEFINE_ACTION_FUNCTION(FLevelLocals, CreateFloor)
{ {
PARAM_PROLOGUE; PARAM_SELF_STRUCT_PROLOGUE(FLevelLocals);
PARAM_POINTER_NOT_NULL(sec, sector_t); PARAM_POINTER_NOT_NULL(sec, sector_t);
PARAM_INT(floortype); PARAM_INT(floortype);
PARAM_POINTER(ln, line_t); PARAM_POINTER(ln, line_t);
@ -514,7 +510,7 @@ DEFINE_ACTION_FUNCTION(DFloor, CreateFloor)
PARAM_INT(change); PARAM_INT(change);
PARAM_BOOL(hereticlower); PARAM_BOOL(hereticlower);
PARAM_BOOL(hexencrush); PARAM_BOOL(hexencrush);
ACTION_RETURN_BOOL(P_CreateFloor(sec, (DFloor::EFloor)floortype, ln, speed, height, crush, change, hexencrush, hereticlower)); ACTION_RETURN_BOOL(self->CreateFloor(sec, (DFloor::EFloor)floortype, ln, speed, height, crush, change, hexencrush, hereticlower));
} }
//========================================================================== //==========================================================================
@ -525,17 +521,17 @@ DEFINE_ACTION_FUNCTION(DFloor, CreateFloor)
// //
//========================================================================== //==========================================================================
bool EV_DoFloor (DFloor::EFloor floortype, line_t *line, int tag, bool FLevelLocals::EV_DoFloor (DFloor::EFloor floortype, line_t *line, int tag,
double speed, double height, int crush, int change, bool hexencrush, bool hereticlower) double speed, double height, int crush, int change, bool hexencrush, bool hereticlower)
{ {
int secnum; int secnum;
bool rtn = false; bool rtn = false;
// check if a manual trigger; if so do just the sector on the backside // check if a manual trigger; if so do just the sector on the backside
auto it = level.GetSectorTagIterator(tag, line); auto it = GetSectorTagIterator(tag, line);
while ((secnum = it.Next()) >= 0) while ((secnum = it.Next()) >= 0)
{ {
rtn |= P_CreateFloor(&level.sectors[secnum], floortype, line, speed, height, crush, change, hexencrush, hereticlower); rtn |= CreateFloor(&sectors[secnum], floortype, line, speed, height, crush, change, hexencrush, hereticlower);
} }
return rtn; return rtn;
} }
@ -548,13 +544,13 @@ bool EV_DoFloor (DFloor::EFloor floortype, line_t *line, int tag,
// //
//========================================================================== //==========================================================================
bool EV_FloorCrushStop (int tag, line_t *line) bool FLevelLocals::EV_FloorCrushStop (int tag, line_t *line)
{ {
int secnum; int secnum;
auto it = level.GetSectorTagIterator(tag, line); auto it = GetSectorTagIterator(tag, line);
while ((secnum = it.Next()) >= 0) while ((secnum = it.Next()) >= 0)
{ {
sector_t *sec = &level.sectors[secnum]; sector_t *sec = &sectors[secnum];
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)
@ -568,17 +564,17 @@ bool EV_FloorCrushStop (int tag, line_t *line)
} }
// same as above but stops any floor mover that was active on the given sector. // same as above but stops any floor mover that was active on the given sector.
bool EV_StopFloor(int tag, line_t *line) bool FLevelLocals::EV_StopFloor(int tag, line_t *line)
{ {
int sec; int sec;
auto it = level.GetSectorTagIterator(tag, line); auto it = GetSectorTagIterator(tag, line);
while ((sec = it.Next()) >= 0) while ((sec = it.Next()) >= 0)
{ {
if (level.sectors[sec].floordata) if (sectors[sec].floordata)
{ {
SN_StopSequence(&level.sectors[sec], CHAN_FLOOR); SN_StopSequence(&sectors[sec], CHAN_FLOOR);
level.sectors[sec].floordata->Destroy(); sectors[sec].floordata->Destroy();
level.sectors[sec].floordata = nullptr; sectors[sec].floordata = nullptr;
} }
} }
return true; return true;
@ -593,9 +589,7 @@ bool EV_StopFloor(int tag, line_t *line)
// //
//========================================================================== //==========================================================================
bool EV_BuildStairs (int tag, DFloor::EStair type, line_t *line, bool FLevelLocals::EV_BuildStairs (int tag, DFloor::EStair type, line_t *line, double stairsize, double speed, int delay, int reset, int igntxt, int usespecials)
double stairsize, double speed, int delay, int reset, int igntxt,
int usespecials)
{ {
int secnum = -1; int secnum = -1;
int osecnum; //jff 3/4/98 save old loop index int osecnum; //jff 3/4/98 save old loop index
@ -619,13 +613,13 @@ bool EV_BuildStairs (int tag, DFloor::EStair type, line_t *line,
persteptime = int(stairsize / speed); persteptime = int(stairsize / speed);
// check if a manual trigger, if so do just the sector on the backside // check if a manual trigger, if so do just the sector on the backside
auto itr = level.GetSectorTagIterator(tag, line); auto itr = GetSectorTagIterator(tag, line);
// The compatibility mode doesn't work with a hashing algorithm. // The compatibility mode doesn't work with a hashing algorithm.
// It needs the original linear search method. This was broken in Boom. // It needs the original linear search method. This was broken in Boom.
bool compatible = tag != 0 && (i_compatflags & COMPATF_STAIRINDEX); bool compatible = tag != 0 && (i_compatflags & COMPATF_STAIRINDEX);
while ((secnum = itr.NextCompat(compatible, secnum)) >= 0) while ((secnum = itr.NextCompat(compatible, secnum)) >= 0)
{ {
sec = &level.sectors[secnum]; sec = &sectors[secnum];
// ALREADY MOVING? IF SO, KEEP GOING... // ALREADY MOVING? IF SO, KEEP GOING...
//jff 2/26/98 add special lockout condition to wait for entire //jff 2/26/98 add special lockout condition to wait for entire
@ -770,7 +764,7 @@ bool EV_BuildStairs (int tag, DFloor::EStair type, line_t *line,
} while (ok); } while (ok);
// [RH] make sure the first sector doesn't point to a previous one, otherwise // [RH] make sure the first sector doesn't point to a previous one, otherwise
// it can infinite loop when the first sector stops moving. // it can infinite loop when the first sector stops moving.
level.sectors[osecnum].prevsec = -1; sectors[osecnum].prevsec = -1;
} }
return rtn; return rtn;
} }
@ -781,7 +775,7 @@ bool EV_BuildStairs (int tag, DFloor::EStair type, line_t *line,
// //
//========================================================================== //==========================================================================
bool EV_DoDonut (int tag, line_t *line, double pillarspeed, double slimespeed) bool FLevelLocals::EV_DoDonut (int tag, line_t *line, double pillarspeed, double slimespeed)
{ {
sector_t* s1; sector_t* s1;
sector_t* s2; sector_t* s2;
@ -794,10 +788,10 @@ bool EV_DoDonut (int tag, line_t *line, double pillarspeed, double slimespeed)
rtn = false; rtn = false;
auto itr = level.GetSectorTagIterator(tag, line); auto itr = GetSectorTagIterator(tag, line);
while ((secnum = itr.Next()) >= 0) while ((secnum = itr.Next()) >= 0)
{ {
s1 = &level.sectors[secnum]; // s1 is pillar's sector s1 = &sectors[secnum]; // s1 is pillar's sector
// ALREADY MOVING? IF SO, KEEP GOING... // ALREADY MOVING? IF SO, KEEP GOING...
if (s1->PlaneMoving(sector_t::floor)) if (s1->PlaneMoving(sector_t::floor))
@ -864,10 +858,6 @@ IMPLEMENT_POINTERS_START(DElevator)
IMPLEMENT_POINTER(m_Interp_Ceiling) IMPLEMENT_POINTER(m_Interp_Ceiling)
IMPLEMENT_POINTERS_END IMPLEMENT_POINTERS_END
DElevator::DElevator ()
{
}
DElevator::DElevator (sector_t *sec) DElevator::DElevator (sector_t *sec)
: Super (sec) : Super (sec)
{ {
@ -994,7 +984,7 @@ void DElevator::StartFloorSound ()
// //
//========================================================================== //==========================================================================
bool EV_DoElevator (line_t *line, DElevator::EElevator elevtype, bool FLevelLocals::EV_DoElevator (line_t *line, DElevator::EElevator elevtype,
double speed, double height, int tag) double speed, double height, int tag)
{ {
int secnum; int secnum;
@ -1011,12 +1001,12 @@ bool EV_DoElevator (line_t *line, DElevator::EElevator elevtype,
secnum = -1; secnum = -1;
rtn = false; rtn = false;
auto itr = level.GetSectorTagIterator(tag, line); auto itr = GetSectorTagIterator(tag, line);
// act on all sectors with the same tag as the triggering linedef // act on all sectors with the same tag as the triggering linedef
while ((secnum = itr.Next()) >= 0) while ((secnum = itr.Next()) >= 0)
{ {
sec = &level.sectors[secnum]; sec = &sectors[secnum];
// If either floor or ceiling is already activated, skip it // If either floor or ceiling is already activated, skip it
if (sec->PlaneMoving(sector_t::floor) || sec->ceilingdata) //jff 2/22/98 if (sec->PlaneMoving(sector_t::floor) || sec->ceilingdata) //jff 2/22/98
continue; // the loop used to break at the end if tag were 0, but would miss that step if "continue" occured [FDARI] continue; // the loop used to break at the end if tag were 0, but would miss that step if "continue" occured [FDARI]
@ -1097,7 +1087,7 @@ bool EV_DoElevator (line_t *line, DElevator::EElevator elevtype,
// //
//========================================================================== //==========================================================================
bool EV_DoChange (line_t *line, EChange changetype, int tag) bool FLevelLocals::EV_DoChange (line_t *line, EChange changetype, int tag)
{ {
int secnum; int secnum;
bool rtn; bool rtn;
@ -1106,10 +1096,10 @@ bool EV_DoChange (line_t *line, EChange changetype, int tag)
rtn = false; rtn = false;
// change all sectors with the same tag as the linedef // change all sectors with the same tag as the linedef
auto it = level.GetSectorTagIterator(tag); auto it = GetSectorTagIterator(tag);
while ((secnum = it.Next()) >= 0) while ((secnum = it.Next()) >= 0)
{ {
sec = &level.sectors[secnum]; sec = &sectors[secnum];
rtn = true; rtn = true;
@ -1151,10 +1141,6 @@ IMPLEMENT_CLASS(DWaggleBase, false, false)
IMPLEMENT_CLASS(DFloorWaggle, false, false) IMPLEMENT_CLASS(DFloorWaggle, false, false)
IMPLEMENT_CLASS(DCeilingWaggle, false, false) IMPLEMENT_CLASS(DCeilingWaggle, false, false)
DWaggleBase::DWaggleBase ()
{
}
void DWaggleBase::Serialize(FSerializer &arc) void DWaggleBase::Serialize(FSerializer &arc)
{ {
Super::Serialize (arc); Super::Serialize (arc);
@ -1266,10 +1252,6 @@ void DWaggleBase::DoWaggle (bool ceiling)
// //
//========================================================================== //==========================================================================
DFloorWaggle::DFloorWaggle ()
{
}
DFloorWaggle::DFloorWaggle (sector_t *sec) DFloorWaggle::DFloorWaggle (sector_t *sec)
: Super (sec) : Super (sec)
{ {
@ -1288,10 +1270,6 @@ void DFloorWaggle::Tick ()
// //
//========================================================================== //==========================================================================
DCeilingWaggle::DCeilingWaggle ()
{
}
DCeilingWaggle::DCeilingWaggle (sector_t *sec) DCeilingWaggle::DCeilingWaggle (sector_t *sec)
: Super (sec) : Super (sec)
{ {
@ -1310,8 +1288,7 @@ void DCeilingWaggle::Tick ()
// //
//========================================================================== //==========================================================================
bool EV_StartWaggle (int tag, line_t *line, int height, int speed, int offset, bool FLevelLocals::EV_StartWaggle (int tag, line_t *line, int height, int speed, int offset, int timer, bool ceiling)
int timer, bool ceiling)
{ {
int sectorIndex; int sectorIndex;
sector_t *sector; sector_t *sector;
@ -1320,11 +1297,11 @@ bool EV_StartWaggle (int tag, line_t *line, int height, int speed, int offset,
retCode = false; retCode = false;
auto itr = level.GetSectorTagIterator(tag, line); auto itr = GetSectorTagIterator(tag, line);
while ((sectorIndex = itr.Next()) >= 0) while ((sectorIndex = itr.Next()) >= 0)
{ {
sector = &level.sectors[sectorIndex]; sector = &sectors[sectorIndex];
if ((!ceiling && sector->PlaneMoving(sector_t::floor)) || if ((!ceiling && sector->PlaneMoving(sector_t::floor)) ||
(ceiling && sector->PlaneMoving(sector_t::ceiling))) (ceiling && sector->PlaneMoving(sector_t::ceiling)))
{ // Already busy with another thinker { // Already busy with another thinker

View file

@ -237,19 +237,19 @@ FUNC(LS_Polyobj_Stop)
FUNC(LS_Door_Close) FUNC(LS_Door_Close)
// Door_Close (tag, speed, lighttag) // Door_Close (tag, speed, lighttag)
{ {
return EV_DoDoor (DDoor::doorClose, ln, it, arg0, SPEED(arg1), 0, 0, arg2); return Level->EV_DoDoor (DDoor::doorClose, ln, it, arg0, SPEED(arg1), 0, 0, arg2);
} }
FUNC(LS_Door_Open) FUNC(LS_Door_Open)
// Door_Open (tag, speed, lighttag) // Door_Open (tag, speed, lighttag)
{ {
return EV_DoDoor (DDoor::doorOpen, ln, it, arg0, SPEED(arg1), 0, 0, arg2); return Level->EV_DoDoor (DDoor::doorOpen, ln, it, arg0, SPEED(arg1), 0, 0, arg2);
} }
FUNC(LS_Door_Raise) FUNC(LS_Door_Raise)
// Door_Raise (tag, speed, delay, lighttag) // Door_Raise (tag, speed, delay, lighttag)
{ {
return EV_DoDoor (DDoor::doorRaise, ln, it, arg0, SPEED(arg1), TICS(arg2), 0, arg3); return Level->EV_DoDoor (DDoor::doorRaise, ln, it, arg0, SPEED(arg1), TICS(arg2), 0, arg3);
} }
FUNC(LS_Door_LockedRaise) FUNC(LS_Door_LockedRaise)
@ -258,9 +258,9 @@ FUNC(LS_Door_LockedRaise)
#if 0 #if 0
// In Hexen this originally created a thinker running for nearly 4 years. // In Hexen this originally created a thinker running for nearly 4 years.
// Let's not do this unless it becomes necessary because this can hang tagwait. // Let's not do this unless it becomes necessary because this can hang tagwait.
return EV_DoDoor (arg2 || (Level->flags2 & LEVEL2_HEXENHACK) ? DDoor::doorRaise : DDoor::doorOpen, ln, it, return Level->EV_DoDoor (arg2 || (Level->flags2 & LEVEL2_HEXENHACK) ? DDoor::doorRaise : DDoor::doorOpen, ln, it,
#else #else
return EV_DoDoor (arg2 ? DDoor::doorRaise : DDoor::doorOpen, ln, it, return Level->EV_DoDoor (arg2 ? DDoor::doorRaise : DDoor::doorOpen, ln, it,
#endif #endif
arg0, SPEED(arg1), TICS(arg2), arg3, arg4); arg0, SPEED(arg1), TICS(arg2), arg3, arg4);
} }
@ -268,19 +268,19 @@ FUNC(LS_Door_LockedRaise)
FUNC(LS_Door_CloseWaitOpen) FUNC(LS_Door_CloseWaitOpen)
// Door_CloseWaitOpen (tag, speed, delay, lighttag) // Door_CloseWaitOpen (tag, speed, delay, lighttag)
{ {
return EV_DoDoor (DDoor::doorCloseWaitOpen, ln, it, arg0, SPEED(arg1), OCTICS(arg2), 0, arg3); return Level->EV_DoDoor (DDoor::doorCloseWaitOpen, ln, it, arg0, SPEED(arg1), OCTICS(arg2), 0, arg3);
} }
FUNC(LS_Door_WaitRaise) FUNC(LS_Door_WaitRaise)
// Door_WaitRaise(tag, speed, delay, wait, lighttag) // Door_WaitRaise(tag, speed, delay, wait, lighttag)
{ {
return EV_DoDoor(DDoor::doorWaitRaise, ln, it, arg0, SPEED(arg1), TICS(arg2), 0, arg4, false, TICS(arg3)); return Level->EV_DoDoor(DDoor::doorWaitRaise, ln, it, arg0, SPEED(arg1), TICS(arg2), 0, arg4, false, TICS(arg3));
} }
FUNC(LS_Door_WaitClose) FUNC(LS_Door_WaitClose)
// Door_WaitRaise(tag, speed, wait, lighttag) // Door_WaitRaise(tag, speed, wait, lighttag)
{ {
return EV_DoDoor(DDoor::doorWaitClose, ln, it, arg0, SPEED(arg1), 0, 0, arg3, false, TICS(arg2)); return Level->EV_DoDoor(DDoor::doorWaitClose, ln, it, arg0, SPEED(arg1), 0, 0, arg3, false, TICS(arg2));
} }
FUNC(LS_Door_Animated) FUNC(LS_Door_Animated)
@ -289,13 +289,13 @@ FUNC(LS_Door_Animated)
if (arg3 != 0 && !P_CheckKeys (it, arg3, arg0 != 0)) if (arg3 != 0 && !P_CheckKeys (it, arg3, arg0 != 0))
return false; return false;
return EV_SlidingDoor (ln, it, arg0, arg1, arg2, DAnimatedDoor::adOpenClose); return Level->EV_SlidingDoor (ln, it, arg0, arg1, arg2, DAnimatedDoor::adOpenClose);
} }
FUNC(LS_Door_AnimatedClose) FUNC(LS_Door_AnimatedClose)
// Door_AnimatedClose (tag, speed) // Door_AnimatedClose (tag, speed)
{ {
return EV_SlidingDoor(ln, it, arg0, arg1, -1, DAnimatedDoor::adClose); return Level->EV_SlidingDoor(ln, it, arg0, arg1, -1, DAnimatedDoor::adClose);
} }
FUNC(LS_Generic_Door) FUNC(LS_Generic_Door)
@ -326,203 +326,203 @@ FUNC(LS_Generic_Door)
tag = arg0; tag = arg0;
lightTag = 0; lightTag = 0;
} }
return EV_DoDoor (type, ln, it, tag, SPEED(arg1), OCTICS(arg3), arg4, lightTag, boomgen); return Level->EV_DoDoor (type, ln, it, tag, SPEED(arg1), OCTICS(arg3), arg4, lightTag, boomgen);
} }
FUNC(LS_Floor_LowerByValue) FUNC(LS_Floor_LowerByValue)
// Floor_LowerByValue (tag, speed, height, change) // Floor_LowerByValue (tag, speed, height, change)
{ {
return EV_DoFloor (DFloor::floorLowerByValue, ln, arg0, SPEED(arg1), arg2, -1, CHANGE(arg3), false); return Level->EV_DoFloor (DFloor::floorLowerByValue, ln, arg0, SPEED(arg1), arg2, -1, CHANGE(arg3), false);
} }
FUNC(LS_Floor_LowerToLowest) FUNC(LS_Floor_LowerToLowest)
// Floor_LowerToLowest (tag, speed, change) // Floor_LowerToLowest (tag, speed, change)
{ {
return EV_DoFloor (DFloor::floorLowerToLowest, ln, arg0, SPEED(arg1), 0, -1, CHANGE(arg2), false); return Level->EV_DoFloor (DFloor::floorLowerToLowest, ln, arg0, SPEED(arg1), 0, -1, CHANGE(arg2), false);
} }
FUNC(LS_Floor_LowerToHighest) FUNC(LS_Floor_LowerToHighest)
// Floor_LowerToHighest (tag, speed, adjust, hereticlower) // Floor_LowerToHighest (tag, speed, adjust, hereticlower)
{ {
return EV_DoFloor (DFloor::floorLowerToHighest, ln, arg0, SPEED(arg1), (arg2-128), -1, 0, false, arg3==1); return Level->EV_DoFloor (DFloor::floorLowerToHighest, ln, arg0, SPEED(arg1), (arg2-128), -1, 0, false, arg3==1);
} }
FUNC(LS_Floor_LowerToHighestEE) FUNC(LS_Floor_LowerToHighestEE)
// Floor_LowerToHighestEE (tag, speed, change) // Floor_LowerToHighestEE (tag, speed, change)
{ {
return EV_DoFloor (DFloor::floorLowerToHighest, ln, arg0, SPEED(arg1), 0, -1, CHANGE(arg2), false); return Level->EV_DoFloor (DFloor::floorLowerToHighest, ln, arg0, SPEED(arg1), 0, -1, CHANGE(arg2), false);
} }
FUNC(LS_Floor_LowerToNearest) FUNC(LS_Floor_LowerToNearest)
// Floor_LowerToNearest (tag, speed, change) // Floor_LowerToNearest (tag, speed, change)
{ {
return EV_DoFloor (DFloor::floorLowerToNearest, ln, arg0, SPEED(arg1), 0, -1, CHANGE(arg2), false); return Level->EV_DoFloor (DFloor::floorLowerToNearest, ln, arg0, SPEED(arg1), 0, -1, CHANGE(arg2), false);
} }
FUNC(LS_Floor_RaiseByValue) FUNC(LS_Floor_RaiseByValue)
// Floor_RaiseByValue (tag, speed, height, change, crush) // Floor_RaiseByValue (tag, speed, height, change, crush)
{ {
return EV_DoFloor (DFloor::floorRaiseByValue, ln, arg0, SPEED(arg1), arg2, CRUSH(arg4), CHANGE(arg3), true); return Level->EV_DoFloor (DFloor::floorRaiseByValue, ln, arg0, SPEED(arg1), arg2, CRUSH(arg4), CHANGE(arg3), true);
} }
FUNC(LS_Floor_RaiseToHighest) FUNC(LS_Floor_RaiseToHighest)
// Floor_RaiseToHighest (tag, speed, change, crush) // Floor_RaiseToHighest (tag, speed, change, crush)
{ {
return EV_DoFloor (DFloor::floorRaiseToHighest, ln, arg0, SPEED(arg1), 0, CRUSH(arg3), CHANGE(arg2), true); return Level->EV_DoFloor (DFloor::floorRaiseToHighest, ln, arg0, SPEED(arg1), 0, CRUSH(arg3), CHANGE(arg2), true);
} }
FUNC(LS_Floor_RaiseToNearest) FUNC(LS_Floor_RaiseToNearest)
// Floor_RaiseToNearest (tag, speed, change, crush) // Floor_RaiseToNearest (tag, speed, change, crush)
{ {
return EV_DoFloor (DFloor::floorRaiseToNearest, ln, arg0, SPEED(arg1), 0, CRUSH(arg3), CHANGE(arg2), true); return Level->EV_DoFloor (DFloor::floorRaiseToNearest, ln, arg0, SPEED(arg1), 0, CRUSH(arg3), CHANGE(arg2), true);
} }
FUNC(LS_Floor_RaiseToLowest) FUNC(LS_Floor_RaiseToLowest)
// Floor_RaiseToLowest (tag, change, crush) // Floor_RaiseToLowest (tag, change, crush)
{ {
// This is merely done for completeness as it's a rather pointless addition. // This is merely done for completeness as it's a rather pointless addition.
return EV_DoFloor (DFloor::floorRaiseToLowest, ln, arg0, 2., 0, CRUSH(arg3), CHANGE(arg2), true); return Level->EV_DoFloor (DFloor::floorRaiseToLowest, ln, arg0, 2., 0, CRUSH(arg3), CHANGE(arg2), true);
} }
FUNC(LS_Floor_RaiseAndCrush) FUNC(LS_Floor_RaiseAndCrush)
// Floor_RaiseAndCrush (tag, speed, crush, crushmode) // Floor_RaiseAndCrush (tag, speed, crush, crushmode)
{ {
return EV_DoFloor (DFloor::floorRaiseAndCrush, ln, arg0, SPEED(arg1), 0, arg2, 0, CRUSHTYPE(arg3)); return Level->EV_DoFloor (DFloor::floorRaiseAndCrush, ln, arg0, SPEED(arg1), 0, arg2, 0, CRUSHTYPE(arg3));
} }
FUNC(LS_Floor_RaiseAndCrushDoom) FUNC(LS_Floor_RaiseAndCrushDoom)
// Floor_RaiseAndCrushDoom (tag, speed, crush, crushmode) // Floor_RaiseAndCrushDoom (tag, speed, crush, crushmode)
{ {
return EV_DoFloor (DFloor::floorRaiseAndCrushDoom, ln, arg0, SPEED(arg1), 0, arg2, 0, CRUSHTYPE(arg3)); return Level->EV_DoFloor (DFloor::floorRaiseAndCrushDoom, ln, arg0, SPEED(arg1), 0, arg2, 0, CRUSHTYPE(arg3));
} }
FUNC(LS_Floor_RaiseByValueTimes8) FUNC(LS_Floor_RaiseByValueTimes8)
// FLoor_RaiseByValueTimes8 (tag, speed, height, change, crush) // FLoor_RaiseByValueTimes8 (tag, speed, height, change, crush)
{ {
return EV_DoFloor (DFloor::floorRaiseByValue, ln, arg0, SPEED(arg1), arg2*8, CRUSH(arg4), CHANGE(arg3), true); return Level->EV_DoFloor (DFloor::floorRaiseByValue, ln, arg0, SPEED(arg1), arg2*8, CRUSH(arg4), CHANGE(arg3), true);
} }
FUNC(LS_Floor_LowerByValueTimes8) FUNC(LS_Floor_LowerByValueTimes8)
// Floor_LowerByValueTimes8 (tag, speed, height, change) // Floor_LowerByValueTimes8 (tag, speed, height, change)
{ {
return EV_DoFloor (DFloor::floorLowerByValue, ln, arg0, SPEED(arg1), arg2*8, -1, CHANGE(arg3), false); return Level->EV_DoFloor (DFloor::floorLowerByValue, ln, arg0, SPEED(arg1), arg2*8, -1, CHANGE(arg3), false);
} }
FUNC(LS_Floor_CrushStop) FUNC(LS_Floor_CrushStop)
// Floor_CrushStop (tag) // Floor_CrushStop (tag)
{ {
return EV_FloorCrushStop (arg0, ln); return Level->EV_FloorCrushStop (arg0, ln);
} }
FUNC(LS_Floor_LowerInstant) FUNC(LS_Floor_LowerInstant)
// Floor_LowerInstant (tag, unused, height, change) // Floor_LowerInstant (tag, unused, height, change)
{ {
return EV_DoFloor (DFloor::floorLowerInstant, ln, arg0, 0., arg2*8, -1, CHANGE(arg3), false); return Level->EV_DoFloor (DFloor::floorLowerInstant, ln, arg0, 0., arg2*8, -1, CHANGE(arg3), false);
} }
FUNC(LS_Floor_RaiseInstant) FUNC(LS_Floor_RaiseInstant)
// Floor_RaiseInstant (tag, unused, height, change, crush) // Floor_RaiseInstant (tag, unused, height, change, crush)
{ {
return EV_DoFloor (DFloor::floorRaiseInstant, ln, arg0, 0., arg2*8, CRUSH(arg4), CHANGE(arg3), true); return Level->EV_DoFloor (DFloor::floorRaiseInstant, ln, arg0, 0., arg2*8, CRUSH(arg4), CHANGE(arg3), true);
} }
FUNC(LS_Floor_ToCeilingInstant) FUNC(LS_Floor_ToCeilingInstant)
// Floor_ToCeilingInstant (tag, change, crush, gap) // Floor_ToCeilingInstant (tag, change, crush, gap)
{ {
return EV_DoFloor (DFloor::floorLowerToCeiling, ln, arg0, 0, arg3, CRUSH(arg2), CHANGE(arg1), true); return Level->EV_DoFloor (DFloor::floorLowerToCeiling, ln, arg0, 0, arg3, CRUSH(arg2), CHANGE(arg1), true);
} }
FUNC(LS_Floor_MoveToValueTimes8) FUNC(LS_Floor_MoveToValueTimes8)
// Floor_MoveToValueTimes8 (tag, speed, height, negative, change) // Floor_MoveToValueTimes8 (tag, speed, height, negative, change)
{ {
return EV_DoFloor (DFloor::floorMoveToValue, ln, arg0, SPEED(arg1), return Level->EV_DoFloor (DFloor::floorMoveToValue, ln, arg0, SPEED(arg1),
arg2*8*(arg3?-1:1), -1, CHANGE(arg4), false); arg2*8*(arg3?-1:1), -1, CHANGE(arg4), false);
} }
FUNC(LS_Floor_MoveToValue) FUNC(LS_Floor_MoveToValue)
// Floor_MoveToValue (tag, speed, height, negative, change) // Floor_MoveToValue (tag, speed, height, negative, change)
{ {
return EV_DoFloor (DFloor::floorMoveToValue, ln, arg0, SPEED(arg1), return Level->EV_DoFloor (DFloor::floorMoveToValue, ln, arg0, SPEED(arg1),
arg2*(arg3?-1:1), -1, CHANGE(arg4), false); arg2*(arg3?-1:1), -1, CHANGE(arg4), false);
} }
FUNC(LS_Floor_MoveToValueAndCrush) FUNC(LS_Floor_MoveToValueAndCrush)
// Floor_MoveToValueAndCrush (tag, speed, height, crush, crushmode) // Floor_MoveToValueAndCrush (tag, speed, height, crush, crushmode)
{ {
return EV_DoFloor(DFloor::floorMoveToValue, ln, arg0, SPEED(arg1), return Level->EV_DoFloor(DFloor::floorMoveToValue, ln, arg0, SPEED(arg1),
arg2, CRUSH(arg3) -1, 0, CRUSHTYPE(arg4), false); arg2, CRUSH(arg3) -1, 0, CRUSHTYPE(arg4), false);
} }
FUNC(LS_Floor_RaiseToLowestCeiling) FUNC(LS_Floor_RaiseToLowestCeiling)
// Floor_RaiseToLowestCeiling (tag, speed, change, crush) // Floor_RaiseToLowestCeiling (tag, speed, change, crush)
{ {
return EV_DoFloor (DFloor::floorRaiseToLowestCeiling, ln, arg0, SPEED(arg1), 0, CRUSH(arg3), CHANGE(arg2), true); return Level->EV_DoFloor (DFloor::floorRaiseToLowestCeiling, ln, arg0, SPEED(arg1), 0, CRUSH(arg3), CHANGE(arg2), true);
} }
FUNC(LS_Floor_LowerToLowestCeiling) FUNC(LS_Floor_LowerToLowestCeiling)
// Floor_LowerToLowestCeiling (tag, speed, change) // Floor_LowerToLowestCeiling (tag, speed, change)
{ {
return EV_DoFloor (DFloor::floorLowerToLowestCeiling, ln, arg0, SPEED(arg1), arg4, -1, CHANGE(arg2), true); return Level->EV_DoFloor (DFloor::floorLowerToLowestCeiling, ln, arg0, SPEED(arg1), arg4, -1, CHANGE(arg2), true);
} }
FUNC(LS_Floor_RaiseByTexture) FUNC(LS_Floor_RaiseByTexture)
// Floor_RaiseByTexture (tag, speed, change, crush) // Floor_RaiseByTexture (tag, speed, change, crush)
{ {
return EV_DoFloor (DFloor::floorRaiseByTexture, ln, arg0, SPEED(arg1), 0, CRUSH(arg3), CHANGE(arg2), true); return Level->EV_DoFloor (DFloor::floorRaiseByTexture, ln, arg0, SPEED(arg1), 0, CRUSH(arg3), CHANGE(arg2), true);
} }
FUNC(LS_Floor_LowerByTexture) FUNC(LS_Floor_LowerByTexture)
// Floor_LowerByTexture (tag, speed, change, crush) // Floor_LowerByTexture (tag, speed, change, crush)
{ {
return EV_DoFloor (DFloor::floorLowerByTexture, ln, arg0, SPEED(arg1), 0, -1, CHANGE(arg2), true); return Level->EV_DoFloor (DFloor::floorLowerByTexture, ln, arg0, SPEED(arg1), 0, -1, CHANGE(arg2), true);
} }
FUNC(LS_Floor_RaiseToCeiling) FUNC(LS_Floor_RaiseToCeiling)
// Floor_RaiseToCeiling (tag, speed, change, crush, gap) // Floor_RaiseToCeiling (tag, speed, change, crush, gap)
{ {
return EV_DoFloor (DFloor::floorRaiseToCeiling, ln, arg0, SPEED(arg1), arg4, CRUSH(arg3), CHANGE(arg2), true); return Level->EV_DoFloor (DFloor::floorRaiseToCeiling, ln, arg0, SPEED(arg1), arg4, CRUSH(arg3), CHANGE(arg2), true);
} }
FUNC(LS_Floor_RaiseByValueTxTy) FUNC(LS_Floor_RaiseByValueTxTy)
// Floor_RaiseByValueTxTy (tag, speed, height) // Floor_RaiseByValueTxTy (tag, speed, height)
{ {
return EV_DoFloor (DFloor::floorRaiseAndChange, ln, arg0, SPEED(arg1), arg2, -1, 0, false); return Level->EV_DoFloor (DFloor::floorRaiseAndChange, ln, arg0, SPEED(arg1), arg2, -1, 0, false);
} }
FUNC(LS_Floor_LowerToLowestTxTy) FUNC(LS_Floor_LowerToLowestTxTy)
// Floor_LowerToLowestTxTy (tag, speed) // Floor_LowerToLowestTxTy (tag, speed)
{ {
return EV_DoFloor (DFloor::floorLowerAndChange, ln, arg0, SPEED(arg1), arg2, -1, 0, false); return Level->EV_DoFloor (DFloor::floorLowerAndChange, ln, arg0, SPEED(arg1), arg2, -1, 0, false);
} }
FUNC(LS_Floor_Waggle) FUNC(LS_Floor_Waggle)
// Floor_Waggle (tag, amplitude, frequency, delay, time) // Floor_Waggle (tag, amplitude, frequency, delay, time)
{ {
return EV_StartWaggle (arg0, ln, arg1, arg2, arg3, arg4, false); return Level->EV_StartWaggle (arg0, ln, arg1, arg2, arg3, arg4, false);
} }
FUNC(LS_Ceiling_Waggle) FUNC(LS_Ceiling_Waggle)
// Ceiling_Waggle (tag, amplitude, frequency, delay, time) // Ceiling_Waggle (tag, amplitude, frequency, delay, time)
{ {
return EV_StartWaggle (arg0, ln, arg1, arg2, arg3, arg4, true); return Level->EV_StartWaggle (arg0, ln, arg1, arg2, arg3, arg4, true);
} }
FUNC(LS_Floor_TransferTrigger) FUNC(LS_Floor_TransferTrigger)
// Floor_TransferTrigger (tag) // Floor_TransferTrigger (tag)
{ {
return EV_DoChange (ln, trigChangeOnly, arg0); return Level->EV_DoChange (ln, trigChangeOnly, arg0);
} }
FUNC(LS_Floor_TransferNumeric) FUNC(LS_Floor_TransferNumeric)
// Floor_TransferNumeric (tag) // Floor_TransferNumeric (tag)
{ {
return EV_DoChange (ln, numChangeOnly, arg0); return Level->EV_DoChange (ln, numChangeOnly, arg0);
} }
FUNC(LS_Floor_Donut) FUNC(LS_Floor_Donut)
// Floor_Donut (pillartag, pillarspeed, slimespeed) // Floor_Donut (pillartag, pillarspeed, slimespeed)
{ {
return EV_DoDonut (arg0, ln, SPEED(arg1), SPEED(arg2)); return Level->EV_DoDonut (arg0, ln, SPEED(arg1), SPEED(arg2));
} }
FUNC(LS_Generic_Floor) FUNC(LS_Generic_Floor)
@ -557,7 +557,7 @@ FUNC(LS_Generic_Floor)
} }
} }
return EV_DoFloor (type, ln, arg0, SPEED(arg1), arg2, return Level->EV_DoFloor (type, ln, arg0, SPEED(arg1), arg2,
(arg4 & 16) ? 20 : -1, arg4 & 7, false); (arg4 & 16) ? 20 : -1, arg4 & 7, false);
} }
@ -565,70 +565,70 @@ FUNC(LS_Generic_Floor)
FUNC(LS_Floor_Stop) FUNC(LS_Floor_Stop)
// Floor_Stop (tag) // Floor_Stop (tag)
{ {
return EV_StopFloor(arg0, ln); return Level->EV_StopFloor(arg0, ln);
} }
FUNC(LS_Stairs_BuildDown) FUNC(LS_Stairs_BuildDown)
// Stair_BuildDown (tag, speed, height, delay, reset) // Stair_BuildDown (tag, speed, height, delay, reset)
{ {
return EV_BuildStairs (arg0, DFloor::buildDown, ln, return Level->EV_BuildStairs (arg0, DFloor::buildDown, ln,
arg2, SPEED(arg1), TICS(arg3), arg4, 0, DFloor::stairUseSpecials); arg2, SPEED(arg1), TICS(arg3), arg4, 0, DFloor::stairUseSpecials);
} }
FUNC(LS_Stairs_BuildUp) FUNC(LS_Stairs_BuildUp)
// Stairs_BuildUp (tag, speed, height, delay, reset) // Stairs_BuildUp (tag, speed, height, delay, reset)
{ {
return EV_BuildStairs (arg0, DFloor::buildUp, ln, return Level->EV_BuildStairs (arg0, DFloor::buildUp, ln,
arg2, SPEED(arg1), TICS(arg3), arg4, 0, DFloor::stairUseSpecials); arg2, SPEED(arg1), TICS(arg3), arg4, 0, DFloor::stairUseSpecials);
} }
FUNC(LS_Stairs_BuildDownSync) FUNC(LS_Stairs_BuildDownSync)
// Stairs_BuildDownSync (tag, speed, height, reset) // Stairs_BuildDownSync (tag, speed, height, reset)
{ {
return EV_BuildStairs (arg0, DFloor::buildDown, ln, return Level->EV_BuildStairs (arg0, DFloor::buildDown, ln,
arg2, SPEED(arg1), 0, arg3, 0, DFloor::stairUseSpecials|DFloor::stairSync); arg2, SPEED(arg1), 0, arg3, 0, DFloor::stairUseSpecials|DFloor::stairSync);
} }
FUNC(LS_Stairs_BuildUpSync) FUNC(LS_Stairs_BuildUpSync)
// Stairs_BuildUpSync (tag, speed, height, reset) // Stairs_BuildUpSync (tag, speed, height, reset)
{ {
return EV_BuildStairs (arg0, DFloor::buildUp, ln, return Level->EV_BuildStairs (arg0, DFloor::buildUp, ln,
arg2, SPEED(arg1), 0, arg3, 0, DFloor::stairUseSpecials|DFloor::stairSync); arg2, SPEED(arg1), 0, arg3, 0, DFloor::stairUseSpecials|DFloor::stairSync);
} }
FUNC(LS_Stairs_BuildUpDoom) FUNC(LS_Stairs_BuildUpDoom)
// Stairs_BuildUpDoom (tag, speed, height, delay, reset) // Stairs_BuildUpDoom (tag, speed, height, delay, reset)
{ {
return EV_BuildStairs (arg0, DFloor::buildUp, ln, return Level->EV_BuildStairs (arg0, DFloor::buildUp, ln,
arg2, SPEED(arg1), TICS(arg3), arg4, 0, 0); arg2, SPEED(arg1), TICS(arg3), arg4, 0, 0);
} }
FUNC(LS_Stairs_BuildUpDoomCrush) FUNC(LS_Stairs_BuildUpDoomCrush)
// Stairs_BuildUpDoom (tag, speed, height, delay, reset) // Stairs_BuildUpDoom (tag, speed, height, delay, reset)
{ {
return EV_BuildStairs(arg0, DFloor::buildUp, ln, return Level->EV_BuildStairs(arg0, DFloor::buildUp, ln,
arg2, SPEED(arg1), TICS(arg3), arg4, 0, DFloor::stairCrush); arg2, SPEED(arg1), TICS(arg3), arg4, 0, DFloor::stairCrush);
} }
FUNC(LS_Stairs_BuildDownDoom) FUNC(LS_Stairs_BuildDownDoom)
// Stair_BuildDownDoom (tag, speed, height, delay, reset) // Stair_BuildDownDoom (tag, speed, height, delay, reset)
{ {
return EV_BuildStairs (arg0, DFloor::buildDown, ln, return Level->EV_BuildStairs (arg0, DFloor::buildDown, ln,
arg2, SPEED(arg1), TICS(arg3), arg4, 0, 0); arg2, SPEED(arg1), TICS(arg3), arg4, 0, 0);
} }
FUNC(LS_Stairs_BuildDownDoomSync) FUNC(LS_Stairs_BuildDownDoomSync)
// Stairs_BuildDownDoomSync (tag, speed, height, reset) // Stairs_BuildDownDoomSync (tag, speed, height, reset)
{ {
return EV_BuildStairs (arg0, DFloor::buildDown, ln, return Level->EV_BuildStairs (arg0, DFloor::buildDown, ln,
arg2, SPEED(arg1), 0, arg3, 0, DFloor::stairSync); arg2, SPEED(arg1), 0, arg3, 0, DFloor::stairSync);
} }
FUNC(LS_Stairs_BuildUpDoomSync) FUNC(LS_Stairs_BuildUpDoomSync)
// Stairs_BuildUpDoomSync (tag, speed, height, reset) // Stairs_BuildUpDoomSync (tag, speed, height, reset)
{ {
return EV_BuildStairs (arg0, DFloor::buildUp, ln, return Level->EV_BuildStairs (arg0, DFloor::buildUp, ln,
arg2, SPEED(arg1), 0, arg3, 0, DFloor::stairSync); arg2, SPEED(arg1), 0, arg3, 0, DFloor::stairSync);
} }
@ -637,7 +637,7 @@ FUNC(LS_Generic_Stairs)
// Generic_Stairs (tag, speed, step, dir/igntxt, reset) // Generic_Stairs (tag, speed, step, dir/igntxt, reset)
{ {
DFloor::EStair type = (arg3 & 1) ? DFloor::buildUp : DFloor::buildDown; DFloor::EStair type = (arg3 & 1) ? DFloor::buildUp : DFloor::buildDown;
bool res = EV_BuildStairs (arg0, type, ln, bool res = Level->EV_BuildStairs (arg0, type, ln,
arg2, SPEED(arg1), 0, arg4, arg3 & 2, 0); arg2, SPEED(arg1), 0, arg4, arg3 & 2, 0);
if (res && ln && (ln->flags & ML_REPEAT_SPECIAL) && ln->special == Generic_Stairs) if (res && ln && (ln->flags & ML_REPEAT_SPECIAL) && ln->special == Generic_Stairs)
@ -650,61 +650,61 @@ FUNC(LS_Generic_Stairs)
FUNC(LS_Pillar_Build) FUNC(LS_Pillar_Build)
// Pillar_Build (tag, speed, height) // Pillar_Build (tag, speed, height)
{ {
return EV_DoPillar (DPillar::pillarBuild, ln, arg0, SPEED(arg1), arg2, 0, -1, false); return Level->EV_DoPillar (DPillar::pillarBuild, ln, arg0, SPEED(arg1), arg2, 0, -1, false);
} }
FUNC(LS_Pillar_BuildAndCrush) FUNC(LS_Pillar_BuildAndCrush)
// Pillar_BuildAndCrush (tag, speed, height, crush, crushtype) // Pillar_BuildAndCrush (tag, speed, height, crush, crushtype)
{ {
return EV_DoPillar (DPillar::pillarBuild, ln, arg0, SPEED(arg1), arg2, 0, arg3, CRUSHTYPE(arg4)); return Level->EV_DoPillar (DPillar::pillarBuild, ln, arg0, SPEED(arg1), arg2, 0, arg3, CRUSHTYPE(arg4));
} }
FUNC(LS_Pillar_Open) FUNC(LS_Pillar_Open)
// Pillar_Open (tag, speed, f_height, c_height) // Pillar_Open (tag, speed, f_height, c_height)
{ {
return EV_DoPillar (DPillar::pillarOpen, ln, arg0, SPEED(arg1), arg2, arg3, -1, false); return Level->EV_DoPillar (DPillar::pillarOpen, ln, arg0, SPEED(arg1), arg2, arg3, -1, false);
} }
FUNC(LS_Ceiling_LowerByValue) FUNC(LS_Ceiling_LowerByValue)
// Ceiling_LowerByValue (tag, speed, height, change, crush) // Ceiling_LowerByValue (tag, speed, height, change, crush)
{ {
return EV_DoCeiling (DCeiling::ceilLowerByValue, ln, arg0, SPEED(arg1), 0, arg2, CRUSH(arg4), 0, CHANGE(arg3)); return Level->EV_DoCeiling (DCeiling::ceilLowerByValue, ln, arg0, SPEED(arg1), 0, arg2, CRUSH(arg4), 0, CHANGE(arg3));
} }
FUNC(LS_Ceiling_RaiseByValue) FUNC(LS_Ceiling_RaiseByValue)
// Ceiling_RaiseByValue (tag, speed, height, change) // Ceiling_RaiseByValue (tag, speed, height, change)
{ {
return EV_DoCeiling (DCeiling::ceilRaiseByValue, ln, arg0, SPEED(arg1), 0, arg2, CRUSH(arg4), 0, CHANGE(arg3)); return Level->EV_DoCeiling (DCeiling::ceilRaiseByValue, ln, arg0, SPEED(arg1), 0, arg2, CRUSH(arg4), 0, CHANGE(arg3));
} }
FUNC(LS_Ceiling_LowerByValueTimes8) FUNC(LS_Ceiling_LowerByValueTimes8)
// Ceiling_LowerByValueTimes8 (tag, speed, height, change, crush) // Ceiling_LowerByValueTimes8 (tag, speed, height, change, crush)
{ {
return EV_DoCeiling (DCeiling::ceilLowerByValue, ln, arg0, SPEED(arg1), 0, arg2*8, -1, 0, CHANGE(arg3)); return Level->EV_DoCeiling (DCeiling::ceilLowerByValue, ln, arg0, SPEED(arg1), 0, arg2*8, -1, 0, CHANGE(arg3));
} }
FUNC(LS_Ceiling_RaiseByValueTimes8) FUNC(LS_Ceiling_RaiseByValueTimes8)
// Ceiling_RaiseByValueTimes8 (tag, speed, height, change) // Ceiling_RaiseByValueTimes8 (tag, speed, height, change)
{ {
return EV_DoCeiling (DCeiling::ceilRaiseByValue, ln, arg0, SPEED(arg1), 0, arg2*8, -1, 0, CHANGE(arg3)); return Level->EV_DoCeiling (DCeiling::ceilRaiseByValue, ln, arg0, SPEED(arg1), 0, arg2*8, -1, 0, CHANGE(arg3));
} }
FUNC(LS_Ceiling_CrushAndRaise) FUNC(LS_Ceiling_CrushAndRaise)
// Ceiling_CrushAndRaise (tag, speed, crush, crushtype) // Ceiling_CrushAndRaise (tag, speed, crush, crushtype)
{ {
return EV_DoCeiling (DCeiling::ceilCrushAndRaise, ln, arg0, SPEED(arg1), SPEED(arg1)/2, 8, arg2, 0, 0, CRUSHTYPE(arg3, false)); return Level->EV_DoCeiling (DCeiling::ceilCrushAndRaise, ln, arg0, SPEED(arg1), SPEED(arg1)/2, 8, arg2, 0, 0, CRUSHTYPE(arg3, false));
} }
FUNC(LS_Ceiling_LowerAndCrush) FUNC(LS_Ceiling_LowerAndCrush)
// Ceiling_LowerAndCrush (tag, speed, crush, crushtype) // Ceiling_LowerAndCrush (tag, speed, crush, crushtype)
{ {
return EV_DoCeiling (DCeiling::ceilLowerAndCrush, ln, arg0, SPEED(arg1), SPEED(arg1), 8, arg2, 0, 0, CRUSHTYPE(arg3, arg1 == 8)); return Level->EV_DoCeiling (DCeiling::ceilLowerAndCrush, ln, arg0, SPEED(arg1), SPEED(arg1), 8, arg2, 0, 0, CRUSHTYPE(arg3, arg1 == 8));
} }
FUNC(LS_Ceiling_LowerAndCrushDist) FUNC(LS_Ceiling_LowerAndCrushDist)
// Ceiling_LowerAndCrush (tag, speed, crush, dist, crushtype) // Ceiling_LowerAndCrush (tag, speed, crush, dist, crushtype)
{ {
return EV_DoCeiling (DCeiling::ceilLowerAndCrush, ln, arg0, SPEED(arg1), SPEED(arg1), arg3, arg2, 0, 0, CRUSHTYPE(arg4, arg1 == 8)); return Level->EV_DoCeiling (DCeiling::ceilLowerAndCrush, ln, arg0, SPEED(arg1), SPEED(arg1), arg3, arg2, 0, 0, CRUSHTYPE(arg4, arg1 == 8));
} }
FUNC(LS_Ceiling_CrushStop) FUNC(LS_Ceiling_CrushStop)
@ -723,160 +723,160 @@ FUNC(LS_Ceiling_CrushStop)
remove = gameinfo.gametype == GAME_Hexen; remove = gameinfo.gametype == GAME_Hexen;
break; break;
} }
return EV_CeilingCrushStop (arg0, remove); return Level->EV_CeilingCrushStop (arg0, remove);
} }
FUNC(LS_Ceiling_CrushRaiseAndStay) FUNC(LS_Ceiling_CrushRaiseAndStay)
// Ceiling_CrushRaiseAndStay (tag, speed, crush, crushtype) // Ceiling_CrushRaiseAndStay (tag, speed, crush, crushtype)
{ {
return EV_DoCeiling (DCeiling::ceilCrushRaiseAndStay, ln, arg0, SPEED(arg1), SPEED(arg1)/2, 8, arg2, 0, 0, CRUSHTYPE(arg3, false)); return Level->EV_DoCeiling (DCeiling::ceilCrushRaiseAndStay, ln, arg0, SPEED(arg1), SPEED(arg1)/2, 8, arg2, 0, 0, CRUSHTYPE(arg3, false));
} }
FUNC(LS_Ceiling_MoveToValueTimes8) FUNC(LS_Ceiling_MoveToValueTimes8)
// Ceiling_MoveToValueTimes8 (tag, speed, height, negative, change) // Ceiling_MoveToValueTimes8 (tag, speed, height, negative, change)
{ {
return EV_DoCeiling (DCeiling::ceilMoveToValue, ln, arg0, SPEED(arg1), 0, return Level->EV_DoCeiling (DCeiling::ceilMoveToValue, ln, arg0, SPEED(arg1), 0,
arg2*8*((arg3) ? -1 : 1), -1, 0, CHANGE(arg4)); arg2*8*((arg3) ? -1 : 1), -1, 0, CHANGE(arg4));
} }
FUNC(LS_Ceiling_MoveToValue) FUNC(LS_Ceiling_MoveToValue)
// Ceiling_MoveToValue (tag, speed, height, negative, change) // Ceiling_MoveToValue (tag, speed, height, negative, change)
{ {
return EV_DoCeiling (DCeiling::ceilMoveToValue, ln, arg0, SPEED(arg1), 0, return Level->EV_DoCeiling (DCeiling::ceilMoveToValue, ln, arg0, SPEED(arg1), 0,
arg2*((arg3) ? -1 : 1), -1, 0, CHANGE(arg4)); arg2*((arg3) ? -1 : 1), -1, 0, CHANGE(arg4));
} }
FUNC(LS_Ceiling_MoveToValueAndCrush) FUNC(LS_Ceiling_MoveToValueAndCrush)
// Ceiling_MoveToValueAndCrush (tag, speed, height, crush, crushmode) // Ceiling_MoveToValueAndCrush (tag, speed, height, crush, crushmode)
{ {
return EV_DoCeiling (DCeiling::ceilMoveToValue, ln, arg0, SPEED(arg1), 0, return Level->EV_DoCeiling (DCeiling::ceilMoveToValue, ln, arg0, SPEED(arg1), 0,
arg2, CRUSH(arg3), 0, 0, CRUSHTYPE(arg4, arg1 == 8)); arg2, CRUSH(arg3), 0, 0, CRUSHTYPE(arg4, arg1 == 8));
} }
FUNC(LS_Ceiling_LowerToHighestFloor) FUNC(LS_Ceiling_LowerToHighestFloor)
// Ceiling_LowerToHighestFloor (tag, speed, change, crush, gap) // Ceiling_LowerToHighestFloor (tag, speed, change, crush, gap)
{ {
return EV_DoCeiling (DCeiling::ceilLowerToHighestFloor, ln, arg0, SPEED(arg1), 0, arg4, CRUSH(arg3), 0, CHANGE(arg2)); return Level->EV_DoCeiling (DCeiling::ceilLowerToHighestFloor, ln, arg0, SPEED(arg1), 0, arg4, CRUSH(arg3), 0, CHANGE(arg2));
} }
FUNC(LS_Ceiling_LowerInstant) FUNC(LS_Ceiling_LowerInstant)
// Ceiling_LowerInstant (tag, unused, height, change, crush) // Ceiling_LowerInstant (tag, unused, height, change, crush)
{ {
return EV_DoCeiling (DCeiling::ceilLowerInstant, ln, arg0, 0, 0, arg2*8, CRUSH(arg4), 0, CHANGE(arg3)); return Level->EV_DoCeiling (DCeiling::ceilLowerInstant, ln, arg0, 0, 0, arg2*8, CRUSH(arg4), 0, CHANGE(arg3));
} }
FUNC(LS_Ceiling_RaiseInstant) FUNC(LS_Ceiling_RaiseInstant)
// Ceiling_RaiseInstant (tag, unused, height, change) // Ceiling_RaiseInstant (tag, unused, height, change)
{ {
return EV_DoCeiling (DCeiling::ceilRaiseInstant, ln, arg0, 0, 0, arg2*8, -1, 0, CHANGE(arg3)); return Level->EV_DoCeiling (DCeiling::ceilRaiseInstant, ln, arg0, 0, 0, arg2*8, -1, 0, CHANGE(arg3));
} }
FUNC(LS_Ceiling_CrushRaiseAndStayA) FUNC(LS_Ceiling_CrushRaiseAndStayA)
// Ceiling_CrushRaiseAndStayA (tag, dnspeed, upspeed, damage, crushtype) // Ceiling_CrushRaiseAndStayA (tag, dnspeed, upspeed, damage, crushtype)
{ {
return EV_DoCeiling (DCeiling::ceilCrushRaiseAndStay, ln, arg0, SPEED(arg1), SPEED(arg2), 0, arg3, 0, 0, CRUSHTYPE(arg4, false)); return Level->EV_DoCeiling (DCeiling::ceilCrushRaiseAndStay, ln, arg0, SPEED(arg1), SPEED(arg2), 0, arg3, 0, 0, CRUSHTYPE(arg4, false));
} }
FUNC(LS_Ceiling_CrushRaiseAndStaySilA) FUNC(LS_Ceiling_CrushRaiseAndStaySilA)
// Ceiling_CrushRaiseAndStaySilA (tag, dnspeed, upspeed, damage, crushtype) // Ceiling_CrushRaiseAndStaySilA (tag, dnspeed, upspeed, damage, crushtype)
{ {
return EV_DoCeiling (DCeiling::ceilCrushRaiseAndStay, ln, arg0, SPEED(arg1), SPEED(arg2), 0, arg3, 1, 0, CRUSHTYPE(arg4, false)); return Level->EV_DoCeiling (DCeiling::ceilCrushRaiseAndStay, ln, arg0, SPEED(arg1), SPEED(arg2), 0, arg3, 1, 0, CRUSHTYPE(arg4, false));
} }
FUNC(LS_Ceiling_CrushAndRaiseA) FUNC(LS_Ceiling_CrushAndRaiseA)
// Ceiling_CrushAndRaiseA (tag, dnspeed, upspeed, damage, crushtype) // Ceiling_CrushAndRaiseA (tag, dnspeed, upspeed, damage, crushtype)
{ {
return EV_DoCeiling (DCeiling::ceilCrushAndRaise, ln, arg0, SPEED(arg1), SPEED(arg2), 0, arg3, 0, 0, CRUSHTYPE(arg4, arg1 == 8 && arg2 == 8)); return Level->EV_DoCeiling (DCeiling::ceilCrushAndRaise, ln, arg0, SPEED(arg1), SPEED(arg2), 0, arg3, 0, 0, CRUSHTYPE(arg4, arg1 == 8 && arg2 == 8));
} }
FUNC(LS_Ceiling_CrushAndRaiseDist) FUNC(LS_Ceiling_CrushAndRaiseDist)
// Ceiling_CrushAndRaiseDist (tag, dist, speed, damage, crushtype) // Ceiling_CrushAndRaiseDist (tag, dist, speed, damage, crushtype)
{ {
return EV_DoCeiling (DCeiling::ceilCrushAndRaise, ln, arg0, SPEED(arg2), SPEED(arg2), arg1, arg3, 0, 0, CRUSHTYPE(arg4, arg2 == 8)); return Level->EV_DoCeiling (DCeiling::ceilCrushAndRaise, ln, arg0, SPEED(arg2), SPEED(arg2), arg1, arg3, 0, 0, CRUSHTYPE(arg4, arg2 == 8));
} }
FUNC(LS_Ceiling_CrushAndRaiseSilentA) FUNC(LS_Ceiling_CrushAndRaiseSilentA)
// Ceiling_CrushAndRaiseSilentA (tag, dnspeed, upspeed, damage, crushtype) // Ceiling_CrushAndRaiseSilentA (tag, dnspeed, upspeed, damage, crushtype)
{ {
return EV_DoCeiling (DCeiling::ceilCrushAndRaise, ln, arg0, SPEED(arg1), SPEED(arg2), 0, arg3, 1, 0, CRUSHTYPE(arg4, arg1 == 8 && arg2 == 8)); return Level->EV_DoCeiling (DCeiling::ceilCrushAndRaise, ln, arg0, SPEED(arg1), SPEED(arg2), 0, arg3, 1, 0, CRUSHTYPE(arg4, arg1 == 8 && arg2 == 8));
} }
FUNC(LS_Ceiling_CrushAndRaiseSilentDist) FUNC(LS_Ceiling_CrushAndRaiseSilentDist)
// Ceiling_CrushAndRaiseSilentDist (tag, dist, upspeed, damage, crushtype) // Ceiling_CrushAndRaiseSilentDist (tag, dist, upspeed, damage, crushtype)
{ {
return EV_DoCeiling (DCeiling::ceilCrushAndRaise, ln, arg0, SPEED(arg2), SPEED(arg2), arg1, arg3, 1, 0, CRUSHTYPE(arg4, arg2 == 8)); return Level->EV_DoCeiling (DCeiling::ceilCrushAndRaise, ln, arg0, SPEED(arg2), SPEED(arg2), arg1, arg3, 1, 0, CRUSHTYPE(arg4, arg2 == 8));
} }
FUNC(LS_Ceiling_RaiseToNearest) FUNC(LS_Ceiling_RaiseToNearest)
// Ceiling_RaiseToNearest (tag, speed, change) // Ceiling_RaiseToNearest (tag, speed, change)
{ {
return EV_DoCeiling (DCeiling::ceilRaiseToNearest, ln, arg0, SPEED(arg1), 0, 0, -1, CHANGE(arg2), 0); return Level->EV_DoCeiling (DCeiling::ceilRaiseToNearest, ln, arg0, SPEED(arg1), 0, 0, -1, CHANGE(arg2), 0);
} }
FUNC(LS_Ceiling_RaiseToHighest) FUNC(LS_Ceiling_RaiseToHighest)
// Ceiling_RaiseToHighest (tag, speed, change) // Ceiling_RaiseToHighest (tag, speed, change)
{ {
return EV_DoCeiling (DCeiling::ceilRaiseToHighest, ln, arg0, SPEED(arg1), 0, 0, -1, CHANGE(arg2), 0); return Level->EV_DoCeiling (DCeiling::ceilRaiseToHighest, ln, arg0, SPEED(arg1), 0, 0, -1, CHANGE(arg2), 0);
} }
FUNC(LS_Ceiling_RaiseToLowest) FUNC(LS_Ceiling_RaiseToLowest)
// Ceiling_RaiseToLowest (tag, speed, change) // Ceiling_RaiseToLowest (tag, speed, change)
{ {
return EV_DoCeiling (DCeiling::ceilRaiseToLowest, ln, arg0, SPEED(arg1), 0, 0, -1, CHANGE(arg2), 0); return Level->EV_DoCeiling (DCeiling::ceilRaiseToLowest, ln, arg0, SPEED(arg1), 0, 0, -1, CHANGE(arg2), 0);
} }
FUNC(LS_Ceiling_RaiseToHighestFloor) FUNC(LS_Ceiling_RaiseToHighestFloor)
// Ceiling_RaiseToHighestFloor (tag, speed, change) // Ceiling_RaiseToHighestFloor (tag, speed, change)
{ {
return EV_DoCeiling (DCeiling::ceilRaiseToHighestFloor, ln, arg0, SPEED(arg1), 0, 0, -1, CHANGE(arg2), 0); return Level->EV_DoCeiling (DCeiling::ceilRaiseToHighestFloor, ln, arg0, SPEED(arg1), 0, 0, -1, CHANGE(arg2), 0);
} }
FUNC(LS_Ceiling_RaiseByTexture) FUNC(LS_Ceiling_RaiseByTexture)
// Ceiling_RaiseByTexture (tag, speed, change) // Ceiling_RaiseByTexture (tag, speed, change)
{ {
return EV_DoCeiling (DCeiling::ceilRaiseByTexture, ln, arg0, SPEED(arg1), 0, 0, -1, CHANGE(arg2), 0); return Level->EV_DoCeiling (DCeiling::ceilRaiseByTexture, ln, arg0, SPEED(arg1), 0, 0, -1, CHANGE(arg2), 0);
} }
FUNC(LS_Ceiling_LowerToLowest) FUNC(LS_Ceiling_LowerToLowest)
// Ceiling_LowerToLowest (tag, speed, change, crush) // Ceiling_LowerToLowest (tag, speed, change, crush)
{ {
return EV_DoCeiling (DCeiling::ceilLowerToLowest, ln, arg0, SPEED(arg1), 0, 0, CRUSH(arg3), 0, CHANGE(arg2)); return Level->EV_DoCeiling (DCeiling::ceilLowerToLowest, ln, arg0, SPEED(arg1), 0, 0, CRUSH(arg3), 0, CHANGE(arg2));
} }
FUNC(LS_Ceiling_LowerToNearest) FUNC(LS_Ceiling_LowerToNearest)
// Ceiling_LowerToNearest (tag, speed, change, crush) // Ceiling_LowerToNearest (tag, speed, change, crush)
{ {
return EV_DoCeiling (DCeiling::ceilLowerToNearest, ln, arg0, SPEED(arg1), 0, 0, CRUSH(arg3), 0, CHANGE(arg2)); return Level->EV_DoCeiling (DCeiling::ceilLowerToNearest, ln, arg0, SPEED(arg1), 0, 0, CRUSH(arg3), 0, CHANGE(arg2));
} }
FUNC(LS_Ceiling_ToHighestInstant) FUNC(LS_Ceiling_ToHighestInstant)
// Ceiling_ToHighestInstant (tag, change, crush) // Ceiling_ToHighestInstant (tag, change, crush)
{ {
return EV_DoCeiling (DCeiling::ceilLowerToHighest, ln, arg0, 2, 0, 0, CRUSH(arg2), 0, CHANGE(arg1)); return Level->EV_DoCeiling (DCeiling::ceilLowerToHighest, ln, arg0, 2, 0, 0, CRUSH(arg2), 0, CHANGE(arg1));
} }
FUNC(LS_Ceiling_ToFloorInstant) FUNC(LS_Ceiling_ToFloorInstant)
// Ceiling_ToFloorInstant (tag, change, crush, gap) // Ceiling_ToFloorInstant (tag, change, crush, gap)
{ {
return EV_DoCeiling (DCeiling::ceilRaiseToFloor, ln, arg0, 2, 0, arg3, CRUSH(arg2), 0, CHANGE(arg1)); return Level->EV_DoCeiling (DCeiling::ceilRaiseToFloor, ln, arg0, 2, 0, arg3, CRUSH(arg2), 0, CHANGE(arg1));
} }
FUNC(LS_Ceiling_LowerToFloor) FUNC(LS_Ceiling_LowerToFloor)
// Ceiling_LowerToFloor (tag, speed, change, crush, gap) // Ceiling_LowerToFloor (tag, speed, change, crush, gap)
{ {
return EV_DoCeiling (DCeiling::ceilLowerToFloor, ln, arg0, SPEED(arg1), 0, arg4, CRUSH(arg3), 0, CHANGE(arg2)); return Level->EV_DoCeiling (DCeiling::ceilLowerToFloor, ln, arg0, SPEED(arg1), 0, arg4, CRUSH(arg3), 0, CHANGE(arg2));
} }
FUNC(LS_Ceiling_LowerByTexture) FUNC(LS_Ceiling_LowerByTexture)
// Ceiling_LowerByTexture (tag, speed, change, crush) // Ceiling_LowerByTexture (tag, speed, change, crush)
{ {
return EV_DoCeiling (DCeiling::ceilLowerByTexture, ln, arg0, SPEED(arg1), 0, 0, CRUSH(arg3), 0, CHANGE(arg2)); return Level->EV_DoCeiling (DCeiling::ceilLowerByTexture, ln, arg0, SPEED(arg1), 0, 0, CRUSH(arg3), 0, CHANGE(arg2));
} }
FUNC(LS_Ceiling_Stop) FUNC(LS_Ceiling_Stop)
// Ceiling_Stop (tag) // Ceiling_Stop (tag)
{ {
return EV_StopCeiling(arg0, ln); return Level->EV_StopCeiling(arg0, ln);
} }
@ -907,14 +907,14 @@ FUNC(LS_Generic_Ceiling)
} }
} }
return EV_DoCeiling (type, ln, arg0, SPEED(arg1), SPEED(arg1), arg2, return Level->EV_DoCeiling (type, ln, arg0, SPEED(arg1), SPEED(arg1), arg2,
(arg4 & 16) ? 20 : -1, 0, arg4 & 7); (arg4 & 16) ? 20 : -1, 0, arg4 & 7);
} }
FUNC(LS_Generic_Crusher) FUNC(LS_Generic_Crusher)
// Generic_Crusher (tag, dnspeed, upspeed, silent, damage) // Generic_Crusher (tag, dnspeed, upspeed, silent, damage)
{ {
return EV_DoCeiling (DCeiling::ceilCrushAndRaise, ln, arg0, SPEED(arg1), return Level->EV_DoCeiling (DCeiling::ceilCrushAndRaise, ln, arg0, SPEED(arg1),
SPEED(arg2), 0, arg4, arg3 ? 2 : 0, 0, (arg1 <= 24 && arg2 <= 24)? DCeiling::ECrushMode::crushSlowdown : DCeiling::ECrushMode::crushDoom); SPEED(arg2), 0, arg4, arg3 ? 2 : 0, 0, (arg1 <= 24 && arg2 <= 24)? DCeiling::ECrushMode::crushSlowdown : DCeiling::ECrushMode::crushDoom);
} }
@ -922,20 +922,20 @@ FUNC(LS_Generic_Crusher2)
// Generic_Crusher2 (tag, dnspeed, upspeed, silent, damage) // Generic_Crusher2 (tag, dnspeed, upspeed, silent, damage)
{ {
// same as above but uses Hexen's crushing method. // same as above but uses Hexen's crushing method.
return EV_DoCeiling (DCeiling::ceilCrushAndRaise, ln, arg0, SPEED(arg1), return Level->EV_DoCeiling (DCeiling::ceilCrushAndRaise, ln, arg0, SPEED(arg1),
SPEED(arg2), 0, arg4, arg3 ? 2 : 0, 0, DCeiling::ECrushMode::crushHexen); SPEED(arg2), 0, arg4, arg3 ? 2 : 0, 0, DCeiling::ECrushMode::crushHexen);
} }
FUNC(LS_Plat_PerpetualRaise) FUNC(LS_Plat_PerpetualRaise)
// Plat_PerpetualRaise (tag, speed, delay) // Plat_PerpetualRaise (tag, speed, delay)
{ {
return EV_DoPlat (arg0, ln, DPlat::platPerpetualRaise, 0, SPEED(arg1), TICS(arg2), 8, 0); return Level->EV_DoPlat (arg0, ln, DPlat::platPerpetualRaise, 0, SPEED(arg1), TICS(arg2), 8, 0);
} }
FUNC(LS_Plat_PerpetualRaiseLip) FUNC(LS_Plat_PerpetualRaiseLip)
// Plat_PerpetualRaiseLip (tag, speed, delay, lip) // Plat_PerpetualRaiseLip (tag, speed, delay, lip)
{ {
return EV_DoPlat (arg0, ln, DPlat::platPerpetualRaise, 0, SPEED(arg1), TICS(arg2), arg3, 0); return Level->EV_DoPlat (arg0, ln, DPlat::platPerpetualRaise, 0, SPEED(arg1), TICS(arg2), arg3, 0);
} }
FUNC(LS_Plat_Stop) FUNC(LS_Plat_Stop)
@ -954,20 +954,20 @@ FUNC(LS_Plat_Stop)
remove = gameinfo.gametype == GAME_Hexen; remove = gameinfo.gametype == GAME_Hexen;
break; break;
} }
EV_StopPlat(arg0, remove); Level->EV_StopPlat(arg0, remove);
return true; return true;
} }
FUNC(LS_Plat_DownWaitUpStay) FUNC(LS_Plat_DownWaitUpStay)
// Plat_DownWaitUpStay (tag, speed, delay) // Plat_DownWaitUpStay (tag, speed, delay)
{ {
return EV_DoPlat (arg0, ln, DPlat::platDownWaitUpStay, 0, SPEED(arg1), TICS(arg2), 8, 0); return Level->EV_DoPlat (arg0, ln, DPlat::platDownWaitUpStay, 0, SPEED(arg1), TICS(arg2), 8, 0);
} }
FUNC(LS_Plat_DownWaitUpStayLip) FUNC(LS_Plat_DownWaitUpStayLip)
// Plat_DownWaitUpStayLip (tag, speed, delay, lip, floor-sound?) // Plat_DownWaitUpStayLip (tag, speed, delay, lip, floor-sound?)
{ {
return EV_DoPlat (arg0, ln, return Level->EV_DoPlat (arg0, ln,
arg4 ? DPlat::platDownWaitUpStayStone : DPlat::platDownWaitUpStay, arg4 ? DPlat::platDownWaitUpStayStone : DPlat::platDownWaitUpStay,
0, SPEED(arg1), TICS(arg2), arg3, 0); 0, SPEED(arg1), TICS(arg2), arg3, 0);
} }
@ -975,25 +975,25 @@ FUNC(LS_Plat_DownWaitUpStayLip)
FUNC(LS_Plat_DownByValue) FUNC(LS_Plat_DownByValue)
// Plat_DownByValue (tag, speed, delay, height) // Plat_DownByValue (tag, speed, delay, height)
{ {
return EV_DoPlat (arg0, ln, DPlat::platDownByValue, arg3*8, SPEED(arg1), TICS(arg2), 0, 0); return Level->EV_DoPlat (arg0, ln, DPlat::platDownByValue, arg3*8, SPEED(arg1), TICS(arg2), 0, 0);
} }
FUNC(LS_Plat_UpByValue) FUNC(LS_Plat_UpByValue)
// Plat_UpByValue (tag, speed, delay, height) // Plat_UpByValue (tag, speed, delay, height)
{ {
return EV_DoPlat (arg0, ln, DPlat::platUpByValue, arg3*8, SPEED(arg1), TICS(arg2), 0, 0); return Level->EV_DoPlat (arg0, ln, DPlat::platUpByValue, arg3*8, SPEED(arg1), TICS(arg2), 0, 0);
} }
FUNC(LS_Plat_UpWaitDownStay) FUNC(LS_Plat_UpWaitDownStay)
// Plat_UpWaitDownStay (tag, speed, delay) // Plat_UpWaitDownStay (tag, speed, delay)
{ {
return EV_DoPlat (arg0, ln, DPlat::platUpWaitDownStay, 0, SPEED(arg1), TICS(arg2), 0, 0); return Level->EV_DoPlat (arg0, ln, DPlat::platUpWaitDownStay, 0, SPEED(arg1), TICS(arg2), 0, 0);
} }
FUNC(LS_Plat_UpNearestWaitDownStay) FUNC(LS_Plat_UpNearestWaitDownStay)
// Plat_UpNearestWaitDownStay (tag, speed, delay) // Plat_UpNearestWaitDownStay (tag, speed, delay)
{ {
return EV_DoPlat (arg0, ln, DPlat::platUpNearestWaitDownStay, 0, SPEED(arg1), TICS(arg2), 0, 0); return Level->EV_DoPlat (arg0, ln, DPlat::platUpNearestWaitDownStay, 0, SPEED(arg1), TICS(arg2), 0, 0);
} }
FUNC(LS_Plat_RaiseAndStayTx0) FUNC(LS_Plat_RaiseAndStayTx0)
@ -1015,19 +1015,19 @@ FUNC(LS_Plat_RaiseAndStayTx0)
} }
return EV_DoPlat (arg0, ln, type, 0, SPEED(arg1), 0, 0, 1); return Level->EV_DoPlat (arg0, ln, type, 0, SPEED(arg1), 0, 0, 1);
} }
FUNC(LS_Plat_UpByValueStayTx) FUNC(LS_Plat_UpByValueStayTx)
// Plat_UpByValueStayTx (tag, speed, height) // Plat_UpByValueStayTx (tag, speed, height)
{ {
return EV_DoPlat (arg0, ln, DPlat::platUpByValueStay, arg2*8, SPEED(arg1), 0, 0, 2); return Level->EV_DoPlat (arg0, ln, DPlat::platUpByValueStay, arg2*8, SPEED(arg1), 0, 0, 2);
} }
FUNC(LS_Plat_ToggleCeiling) FUNC(LS_Plat_ToggleCeiling)
// Plat_ToggleCeiling (tag) // Plat_ToggleCeiling (tag)
{ {
return EV_DoPlat (arg0, ln, DPlat::platToggle, 0, 0, 0, 0, 0); return Level->EV_DoPlat (arg0, ln, DPlat::platToggle, 0, 0, 0, 0, 0);
} }
FUNC(LS_Generic_Lift) FUNC(LS_Generic_Lift)
@ -1054,7 +1054,7 @@ FUNC(LS_Generic_Lift)
break; break;
} }
return EV_DoPlat (arg0, ln, type, arg4*8, SPEED(arg1), OCTICS(arg2), 0, 0); return Level->EV_DoPlat (arg0, ln, type, arg4*8, SPEED(arg1), OCTICS(arg2), 0, 0);
} }
FUNC(LS_Exit_Normal) FUNC(LS_Exit_Normal)
@ -2024,26 +2024,26 @@ FUNC(LS_FS_Execute)
FUNC(LS_FloorAndCeiling_LowerByValue) FUNC(LS_FloorAndCeiling_LowerByValue)
// FloorAndCeiling_LowerByValue (tag, speed, height) // FloorAndCeiling_LowerByValue (tag, speed, height)
{ {
return EV_DoElevator (ln, DElevator::elevateLower, SPEED(arg1), arg2, arg0); return Level->EV_DoElevator (ln, DElevator::elevateLower, SPEED(arg1), arg2, arg0);
} }
FUNC(LS_FloorAndCeiling_RaiseByValue) FUNC(LS_FloorAndCeiling_RaiseByValue)
// FloorAndCeiling_RaiseByValue (tag, speed, height) // FloorAndCeiling_RaiseByValue (tag, speed, height)
{ {
return EV_DoElevator (ln, DElevator::elevateRaise, SPEED(arg1), arg2, arg0); return Level->EV_DoElevator (ln, DElevator::elevateRaise, SPEED(arg1), arg2, arg0);
} }
FUNC(LS_FloorAndCeiling_LowerRaise) FUNC(LS_FloorAndCeiling_LowerRaise)
// FloorAndCeiling_LowerRaise (tag, fspeed, cspeed, boomemu) // FloorAndCeiling_LowerRaise (tag, fspeed, cspeed, boomemu)
{ {
bool res = EV_DoCeiling (DCeiling::ceilRaiseToHighest, ln, arg0, SPEED(arg2), 0, 0, 0, 0, 0); bool res = Level->EV_DoCeiling (DCeiling::ceilRaiseToHighest, ln, arg0, SPEED(arg2), 0, 0, 0, 0, 0);
// The switch based Boom equivalents of FloorandCeiling_LowerRaise do incorrect checks // The switch based Boom equivalents of FloorandCeiling_LowerRaise do incorrect checks
// which cause the floor only to move when the ceiling fails to do so. // which cause the floor only to move when the ceiling fails to do so.
// To avoid problems with maps that have incorrect args this only uses a // To avoid problems with maps that have incorrect args this only uses a
// more or less unintuitive value for the fourth arg to trigger Boom's broken behavior // more or less unintuitive value for the fourth arg to trigger Boom's broken behavior
if (arg3 != 1998 || !res) // (1998 for the year in which Boom was released... :P) if (arg3 != 1998 || !res) // (1998 for the year in which Boom was released... :P)
{ {
res |= EV_DoFloor (DFloor::floorLowerToLowest, ln, arg0, SPEED(arg1), 0, -1, 0, false); res |= Level->EV_DoFloor (DFloor::floorLowerToLowest, ln, arg0, SPEED(arg1), 0, -1, 0, false);
} }
return res; return res;
} }
@ -2051,19 +2051,19 @@ FUNC(LS_FloorAndCeiling_LowerRaise)
FUNC(LS_Elevator_MoveToFloor) FUNC(LS_Elevator_MoveToFloor)
// Elevator_MoveToFloor (tag, speed) // Elevator_MoveToFloor (tag, speed)
{ {
return EV_DoElevator (ln, DElevator::elevateCurrent, SPEED(arg1), 0, arg0); return Level->EV_DoElevator (ln, DElevator::elevateCurrent, SPEED(arg1), 0, arg0);
} }
FUNC(LS_Elevator_RaiseToNearest) FUNC(LS_Elevator_RaiseToNearest)
// Elevator_RaiseToNearest (tag, speed) // Elevator_RaiseToNearest (tag, speed)
{ {
return EV_DoElevator (ln, DElevator::elevateUp, SPEED(arg1), 0, arg0); return Level->EV_DoElevator (ln, DElevator::elevateUp, SPEED(arg1), 0, arg0);
} }
FUNC(LS_Elevator_LowerToNearest) FUNC(LS_Elevator_LowerToNearest)
// Elevator_LowerToNearest (tag, speed) // Elevator_LowerToNearest (tag, speed)
{ {
return EV_DoElevator (ln, DElevator::elevateDown, SPEED(arg1), 0, arg0); return Level->EV_DoElevator (ln, DElevator::elevateDown, SPEED(arg1), 0, arg0);
} }
FUNC(LS_Light_ForceLightning) FUNC(LS_Light_ForceLightning)

View file

@ -48,10 +48,6 @@ IMPLEMENT_POINTERS_START(DPillar)
IMPLEMENT_POINTER(m_Interp_Ceiling) IMPLEMENT_POINTER(m_Interp_Ceiling)
IMPLEMENT_POINTERS_END IMPLEMENT_POINTERS_END
DPillar::DPillar ()
{
}
void DPillar::OnDestroy() void DPillar::OnDestroy()
{ {
if (m_Interp_Ceiling != nullptr) if (m_Interp_Ceiling != nullptr)
@ -210,7 +206,7 @@ DPillar::DPillar (sector_t *sector, EPillar type, double speed,
} }
} }
bool EV_DoPillar (DPillar::EPillar type, line_t *line, int tag, bool FLevelLocals::EV_DoPillar (DPillar::EPillar type, line_t *line, int tag,
double speed, double height, double height2, int crush, bool hexencrush) double speed, double height, double height2, int crush, bool hexencrush)
{ {
int secnum; int secnum;
@ -218,10 +214,10 @@ bool EV_DoPillar (DPillar::EPillar type, line_t *line, int tag,
bool rtn = false; bool rtn = false;
// check if a manual trigger; if so do just the sector on the backside // check if a manual trigger; if so do just the sector on the backside
auto itr = level.GetSectorTagIterator(tag, line); auto itr = GetSectorTagIterator(tag, line);
while ((secnum = itr.Next()) >= 0) while ((secnum = itr.Next()) >= 0)
{ {
sec = &level.sectors[secnum]; sec = &sectors[secnum];
if (sec->PlaneMoving(sector_t::floor) || sec->PlaneMoving(sector_t::ceiling)) if (sec->PlaneMoving(sector_t::floor) || sec->PlaneMoving(sector_t::ceiling))
continue; continue;

View file

@ -41,10 +41,6 @@ static FRandom pr_doplat ("DoPlat");
IMPLEMENT_CLASS(DPlat, false, false) IMPLEMENT_CLASS(DPlat, false, false)
DPlat::DPlat ()
{
}
void DPlat::Serialize(FSerializer &arc) void DPlat::Serialize(FSerializer &arc)
{ {
Super::Serialize (arc); Super::Serialize (arc);
@ -204,6 +200,21 @@ void DPlat::Tick ()
} }
} }
void DPlat::Reactivate()
{
if (m_Type == platToggle) //jff 3/14/98 reactivate toggle type
m_Status = m_OldStatus == up ? down : up;
else
m_Status = m_OldStatus;
}
void DPlat::Stop()
{
m_OldStatus = m_Status;
m_Status = in_stasis;
}
DPlat::DPlat (sector_t *sector) DPlat::DPlat (sector_t *sector)
: DMovingFloor (sector) : DMovingFloor (sector)
{ {
@ -214,8 +225,7 @@ DPlat::DPlat (sector_t *sector)
// [RH] Changed amount to height and added delay, // [RH] Changed amount to height and added delay,
// lip, change, tag, and speed parameters. // lip, change, tag, and speed parameters.
// //
bool EV_DoPlat (int tag, line_t *line, DPlat::EPlatType type, double height, bool FLevelLocals::EV_DoPlat (int tag, line_t *line, DPlat::EPlatType type, double height, double speed, int delay, int lip, int change)
double speed, int delay, int lip, int change)
{ {
DPlat *plat; DPlat *plat;
int secnum; int secnum;
@ -233,7 +243,7 @@ bool EV_DoPlat (int tag, line_t *line, DPlat::EPlatType type, double height,
case DPlat::platToggle: case DPlat::platToggle:
rtn = true; rtn = true;
case DPlat::platPerpetualRaise: case DPlat::platPerpetualRaise:
P_ActivateInStasis (tag); ActivateInStasisPlat (tag);
break; break;
default: default:
@ -244,10 +254,10 @@ bool EV_DoPlat (int tag, line_t *line, DPlat::EPlatType type, double height,
// [RH] If tag is zero, use the sector on the back side // [RH] If tag is zero, use the sector on the back side
// of the activating line (if any). // of the activating line (if any).
auto itr = level.GetSectorTagIterator(tag, line); auto itr = GetSectorTagIterator(tag, line);
while ((secnum = itr.Next()) >= 0) while ((secnum = itr.Next()) >= 0)
{ {
sec = &level.sectors[secnum]; sec = &sectors[secnum];
if (sec->PlaneMoving(sector_t::floor)) if (sec->PlaneMoving(sector_t::floor))
{ {
@ -392,18 +402,10 @@ bool EV_DoPlat (int tag, line_t *line, DPlat::EPlatType type, double height,
return rtn; return rtn;
} }
void DPlat::Reactivate () void FLevelLocals::ActivateInStasisPlat (int tag)
{
if (m_Type == platToggle) //jff 3/14/98 reactivate toggle type
m_Status = m_OldStatus == up ? down : up;
else
m_Status = m_OldStatus;
}
void P_ActivateInStasis (int tag)
{ {
DPlat *scan; DPlat *scan;
TThinkerIterator<DPlat> iterator; auto iterator = GetThinkerIterator<DPlat>();
while ( (scan = iterator.Next ()) ) while ( (scan = iterator.Next ()) )
{ {
@ -412,16 +414,10 @@ void P_ActivateInStasis (int tag)
} }
} }
void DPlat::Stop () void FLevelLocals::EV_StopPlat (int tag, bool remove)
{
m_OldStatus = m_Status;
m_Status = in_stasis;
}
void EV_StopPlat (int tag, bool remove)
{ {
DPlat *scan; DPlat *scan;
TThinkerIterator<DPlat> iterator; auto iterator = GetThinkerIterator<DPlat>();
scan = iterator.Next(); scan = iterator.Next();
while (scan != nullptr) while (scan != nullptr)

View file

@ -210,19 +210,11 @@ protected:
void Stop (); void Stop ();
private: private:
DPlat (); DPlat() = default;
friend bool EV_DoPlat (int tag, line_t *line, EPlatType type, friend struct FLevelLocals;
double height, double speed, int delay, int lip, int change);
friend void EV_StopPlat (int tag, bool remove);
friend void P_ActivateInStasis (int tag);
}; };
bool EV_DoPlat (int tag, line_t *line, DPlat::EPlatType type,
double height, double speed, int delay, int lip, int change);
void EV_StopPlat (int tag, bool remove);
void P_ActivateInStasis (int tag);
// //
// [RH] // [RH]
// P_PILLAR // P_PILLAR
@ -259,11 +251,9 @@ protected:
TObjPtr<DInterpolation*> m_Interp_Floor; TObjPtr<DInterpolation*> m_Interp_Floor;
private: private:
DPillar (); DPillar() = default;
}; };
bool EV_DoPillar (DPillar::EPillar type, line_t *line, int tag,
double speed, double height, double height2, int crush, bool hexencrush);
// //
// P_DOORS // P_DOORS
@ -307,19 +297,12 @@ protected:
void DoorSound (bool raise, class DSeqNode *curseq=NULL) const; void DoorSound (bool raise, class DSeqNode *curseq=NULL) const;
friend bool EV_DoDoor (DDoor::EVlDoor type, line_t *line, AActor *thing,
int tag, double speed, int delay, int lock,
int lightTag, bool boomgen, int topcountdown);
private: private:
DDoor (); friend struct FLevelLocals;
DDoor() = default;
}; };
bool EV_DoDoor (DDoor::EVlDoor type, line_t *line, AActor *thing,
int tag, double speed, int delay, int lock,
int lightTag, bool boomgen = false, int topcountdown = 0);
class DAnimatedDoor : public DMovingCeiling class DAnimatedDoor : public DMovingCeiling
{ {
DECLARE_CLASS (DAnimatedDoor, DMovingCeiling) DECLARE_CLASS (DAnimatedDoor, DMovingCeiling)
@ -357,15 +340,13 @@ protected:
int m_Delay; int m_Delay;
bool m_SetBlocking1, m_SetBlocking2; bool m_SetBlocking1, m_SetBlocking2;
friend bool EV_SlidingDoor (line_t *line, AActor *thing, int tag, int speed, int delay, EADType type); friend struct FLevelLocals;
private: private:
DAnimatedDoor (); DAnimatedDoor() = default;
}; };
bool EV_SlidingDoor (line_t *line, AActor *thing, int tag, int speed, int delay, DAnimatedDoor::EADType type);
// //
// P_CEILNG // P_CEILING
// //
// [RH] Changed these // [RH] Changed these
@ -441,22 +422,11 @@ protected:
void PlayCeilingSound (); void PlayCeilingSound ();
private: private:
DCeiling (); DCeiling() = default;
friend struct FLevelLocals;
friend bool P_CreateCeiling(sector_t *sec, DCeiling::ECeiling type, line_t *line, int tag, double speed, double speed2, double height, int crush, int silent, int change, DCeiling::ECrushMode hexencrush);
friend bool EV_CeilingCrushStop (int tag, bool remove);
friend void P_ActivateInStasisCeiling (int tag);
}; };
bool P_CreateCeiling(sector_t *sec, DCeiling::ECeiling type, line_t *line, int tag, double speed, double speed2, double height, int crush, int silent, int change, DCeiling::ECrushMode hexencrush);
bool EV_DoCeiling (DCeiling::ECeiling type, line_t *line, int tag, double speed, double speed2, double height, int crush, int silent, int change, DCeiling::ECrushMode hexencrush = DCeiling::ECrushMode::crushDoom);
bool EV_CeilingCrushStop (int tag, bool remove);
bool EV_StopCeiling(int tag, line_t *line);
void P_ActivateInStasisCeiling (int tag);
// //
// P_FLOOR // P_FLOOR
// //
@ -544,30 +514,12 @@ public:
void StartFloorSound (); void StartFloorSound ();
void SetFloorChangeType (sector_t *sec, int change); void SetFloorChangeType (sector_t *sec, int change);
friend struct FLevelLocals;
friend bool EV_BuildStairs (int tag, DFloor::EStair type, line_t *line,
double stairsize, double speed, int delay, int reset, int igntxt,
int usespecials);
friend bool EV_DoFloor (DFloor::EFloor floortype, line_t *line, int tag,
double speed, double height, int crush, int change, bool hexencrush, bool hereticlower);
friend bool EV_DoDonut (int tag, line_t *line, double pillarspeed, double slimespeed);
private: private:
DFloor (); DFloor() = default;
}; };
bool P_CreateFloor(sector_t *sec, DFloor::EFloor floortype, line_t *line,
double speed, double height, int crush, int change, bool hexencrush, bool hereticlower);
bool EV_BuildStairs (int tag, DFloor::EStair type, line_t *line,
double stairsize, double speed, int delay, int reset, int igntxt,
int usespecials);
bool EV_DoFloor(DFloor::EFloor floortype, line_t *line, int tag,
double speed, double height, int crush, int change, bool hexencrush, bool hereticlower = false);
bool EV_FloorCrushStop (int tag, line_t *line);
bool EV_StopFloor(int tag, line_t *line);
bool EV_DoDonut (int tag, line_t *line, double pillarspeed, double slimespeed);
class DElevator : public DMover class DElevator : public DMover
{ {
DECLARE_CLASS (DElevator, DMover) DECLARE_CLASS (DElevator, DMover)
@ -599,13 +551,11 @@ protected:
TObjPtr<DInterpolation*> m_Interp_Floor; TObjPtr<DInterpolation*> m_Interp_Floor;
void StartFloorSound (); void StartFloorSound ();
friend struct FLevelLocals;
friend bool EV_DoElevator (line_t *line, DElevator::EElevator type, double speed, double height, int tag);
private: private:
DElevator (); DElevator() = default;
}; };
bool EV_DoElevator (line_t *line, DElevator::EElevator type, double speed, double height, int tag);
class DWaggleBase : public DMover class DWaggleBase : public DMover
{ {
@ -626,16 +576,11 @@ protected:
int m_Ticker; int m_Ticker;
int m_State; int m_State;
friend bool EV_StartWaggle (int tag, line_t *line, int height, int speed, friend struct FLevelLocals;
int offset, int timer, bool ceiling);
void DoWaggle (bool ceiling); void DoWaggle (bool ceiling);
DWaggleBase (); DWaggleBase() = default;
}; };
bool EV_StartWaggle (int tag, line_t *line, int height, int speed,
int offset, int timer, bool ceiling);
class DFloorWaggle : public DWaggleBase class DFloorWaggle : public DWaggleBase
{ {
DECLARE_CLASS (DFloorWaggle, DWaggleBase) DECLARE_CLASS (DFloorWaggle, DWaggleBase)
@ -643,7 +588,7 @@ public:
DFloorWaggle (sector_t *sec); DFloorWaggle (sector_t *sec);
void Tick (); void Tick ();
private: private:
DFloorWaggle (); DFloorWaggle() = default;
}; };
class DCeilingWaggle : public DWaggleBase class DCeilingWaggle : public DWaggleBase
@ -653,7 +598,7 @@ public:
DCeilingWaggle (sector_t *sec); DCeilingWaggle (sector_t *sec);
void Tick (); void Tick ();
private: private:
DCeilingWaggle (); DCeilingWaggle() = default;
}; };
//jff 3/15/98 pure texture/type change for better generalized support //jff 3/15/98 pure texture/type change for better generalized support
@ -663,10 +608,6 @@ enum EChange
numChangeOnly, numChangeOnly,
}; };
bool EV_DoChange (line_t *line, EChange changetype, int tag);
// //
// P_TELEPT // P_TELEPT
// //

View file

@ -721,6 +721,10 @@ struct LevelLocals native
int sec = Thinker.Tics2Seconds(totals? totaltime : time); int sec = Thinker.Tics2Seconds(totals? totaltime : time);
return String.Format("%02d:%02d:%02d", sec / 3600, (sec % 3600) / 60, sec % 60); return String.Format("%02d:%02d:%02d", sec / 3600, (sec % 3600) / 60, sec % 60);
} }
native bool CreateCeiling(sector sec, int type, line ln, double speed, double speed2, double height = 0, int crush = -1, int silent = 0, int change = 0, int crushmode = crushDoom);
native bool CreateFloor(sector sec, EFloor floortype, line ln, double speed, double height = 0, int crush = -1, int change = 0, bool crushmode = false, bool hereticlower = false);
} }
struct StringTable native struct StringTable native
@ -922,7 +926,10 @@ class Floor : MovingFloor native
genFloorChg genFloorChg
}; };
native static bool CreateFloor(sector sec, EFloor floortype, line ln, double speed, double height = 0, int crush = -1, int change = 0, bool crushmode = false, bool hereticlower = false); deprecated("3.8") static bool CreateFloor(sector sec, EFloor floortype, line ln, double speed, double height = 0, int crush = -1, int change = 0, bool crushmode = false, bool hereticlower = false)
{
return level.CreateFloor(sec, floortype, ln, speed, height, crush, change, crushmode, hereticlower);
}
} }
class Ceiling : MovingCeiling native class Ceiling : MovingCeiling native
@ -965,7 +972,10 @@ class Ceiling : MovingCeiling native
crushSlowdown = 2 crushSlowdown = 2
} }
native static bool CreateCeiling(sector sec, int type, line ln, double speed, double speed2, double height = 0, int crush = -1, int silent = 0, int change = 0, int crushmode = crushDoom); deprecated("3.8") static bool CreateCeiling(sector sec, int type, line ln, double speed, double speed2, double height = 0, int crush = -1, int silent = 0, int change = 0, int crushmode = crushDoom)
{
return level.CreateCeiling(sec, type, ln, speed, speed2, height, crush, silent, change, crushmode);
}
} }

View file

@ -213,7 +213,7 @@ class PowerCrystal : Actor
sec.Flags |= Sector.SECF_SILENTMOVE; sec.Flags |= Sector.SECF_SILENTMOVE;
sec.lightlevel = 0; sec.lightlevel = 0;
// Do this right with proper checks instead of just hacking the floor height. // Do this right with proper checks instead of just hacking the floor height.
Floor.CreateFloor(sec, Floor.floorLowerToLowest, null, 65536.); level.CreateFloor(sec, Floor.floorLowerToLowest, null, 65536.);
for (int i = 0; i < 8; ++i) for (int i = 0; i < 8; ++i)