mirror of
https://github.com/DrBeef/Raze.git
synced 2025-02-21 03:01:36 +00:00
- use tickstat for all thinker loops that have no more special cases.
This commit is contained in:
parent
6de147b77f
commit
3ee28eb600
4 changed files with 10 additions and 130 deletions
|
@ -569,18 +569,17 @@ void moveplayers(void)
|
|||
//
|
||||
//---------------------------------------------------------------------------
|
||||
|
||||
void tickstat(int stat)
|
||||
void tickstat(int stat, bool deleteinvalid)
|
||||
{
|
||||
DukeStatIterator iti(stat);
|
||||
while (auto act = iti.Next())
|
||||
{
|
||||
if (actorflag(act, SFLAG2_DIENOW))
|
||||
if (actorflag(act, SFLAG2_DIENOW) || act->sector() == nullptr || (deleteinvalid && act->spr.scale.X == 0))
|
||||
{
|
||||
act->Destroy();
|
||||
continue;
|
||||
}
|
||||
if (act->GetClass() != RUNTIME_CLASS(DDukeActor))
|
||||
CallTick(act);
|
||||
CallTick(act);
|
||||
}
|
||||
}
|
||||
|
||||
|
|
|
@ -689,52 +689,6 @@ void movefallers_d(void)
|
|||
}
|
||||
|
||||
|
||||
//---------------------------------------------------------------------------
|
||||
//
|
||||
//
|
||||
//
|
||||
//---------------------------------------------------------------------------
|
||||
|
||||
void movestandables_d(void)
|
||||
{
|
||||
DukeStatIterator it(STAT_STANDABLE);
|
||||
while (auto act = it.Next())
|
||||
{
|
||||
int picnum = act->spr.picnum;
|
||||
|
||||
if (!act->insector() || actorflag(act, SFLAG2_DIENOW))
|
||||
{
|
||||
act->Destroy();
|
||||
}
|
||||
else
|
||||
{
|
||||
CallTick(act);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
//---------------------------------------------------------------------------
|
||||
//
|
||||
//
|
||||
//
|
||||
//---------------------------------------------------------------------------
|
||||
|
||||
void moveweapons_d(void)
|
||||
{
|
||||
DukeStatIterator it(STAT_PROJECTILE);
|
||||
while (auto act = it.Next())
|
||||
{
|
||||
if (!act->insector() || actorflag(act, SFLAG2_DIENOW))
|
||||
{
|
||||
act->Destroy();
|
||||
}
|
||||
else
|
||||
{
|
||||
CallTick(act);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
//---------------------------------------------------------------------------
|
||||
//
|
||||
//
|
||||
|
@ -1781,7 +1735,7 @@ void think_d(void)
|
|||
thinktime.Clock();
|
||||
|
||||
movefta(); //ST 2
|
||||
moveweapons_d(); //ST 4
|
||||
tickstat(STAT_PROJECTILE); //ST 4
|
||||
moveplayers(); //ST 10
|
||||
movefallers_d(); //ST 12
|
||||
moveexplosions_d(); //ST 5
|
||||
|
@ -1792,7 +1746,7 @@ void think_d(void)
|
|||
actortime.Unclock();
|
||||
|
||||
moveeffectors_d(); //ST 3
|
||||
movestandables_d(); //ST 6
|
||||
tickstat(STAT_STANDABLE); //ST 6
|
||||
doanimations();
|
||||
tickstat(STAT_FX); //ST 11
|
||||
|
||||
|
|
|
@ -549,52 +549,6 @@ void movefallers_r(void)
|
|||
}
|
||||
}
|
||||
|
||||
//---------------------------------------------------------------------------
|
||||
//
|
||||
//
|
||||
//
|
||||
//---------------------------------------------------------------------------
|
||||
|
||||
void movestandables_r(void)
|
||||
{
|
||||
DukeStatIterator it(STAT_STANDABLE);
|
||||
while (auto act = it.Next())
|
||||
{
|
||||
int picnum = act->spr.picnum;
|
||||
|
||||
if (!act->insector() || actorflag(act, SFLAG2_DIENOW))
|
||||
{
|
||||
act->Destroy();
|
||||
}
|
||||
else
|
||||
{
|
||||
CallTick(act);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
//---------------------------------------------------------------------------
|
||||
//
|
||||
//
|
||||
//
|
||||
//---------------------------------------------------------------------------
|
||||
|
||||
void moveweapons_r(void)
|
||||
{
|
||||
DukeStatIterator it(STAT_PROJECTILE);
|
||||
while (auto act = it.Next())
|
||||
{
|
||||
if (!act->insector() || actorflag(act, SFLAG2_DIENOW))
|
||||
{
|
||||
act->Destroy();
|
||||
}
|
||||
else
|
||||
{
|
||||
CallTick(act);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
//---------------------------------------------------------------------------
|
||||
//
|
||||
//
|
||||
|
@ -1051,11 +1005,7 @@ static void rrra_specialstats()
|
|||
enemysizecheat = 0;
|
||||
}
|
||||
|
||||
it.Reset(STAT_RABBITSPAWN);
|
||||
while (auto act = it.Next())
|
||||
{
|
||||
CallTick(act);
|
||||
}
|
||||
tickstat(STAT_RABBITSPAWN);
|
||||
}
|
||||
|
||||
//---------------------------------------------------------------------------
|
||||
|
@ -1163,29 +1113,6 @@ void moveactors_r(void)
|
|||
//
|
||||
//---------------------------------------------------------------------------
|
||||
|
||||
void moveexplosions_r(void) // STATNUM 5
|
||||
{
|
||||
|
||||
DukeStatIterator it(STAT_MISC);
|
||||
while (auto act = it.Next())
|
||||
{
|
||||
if (act->spr.scale.X == 0 || act->spr.sectp == nullptr || actorflag(act, SFLAG2_DIENOW))
|
||||
{
|
||||
act->Destroy();
|
||||
}
|
||||
else
|
||||
{
|
||||
CallTick(act);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
//---------------------------------------------------------------------------
|
||||
//
|
||||
//
|
||||
//
|
||||
//---------------------------------------------------------------------------
|
||||
|
||||
void handle_se06_r(DDukeActor *actor)
|
||||
{
|
||||
auto sc = actor->sector();
|
||||
|
@ -2038,10 +1965,10 @@ void think_r(void)
|
|||
thinktime.Clock();
|
||||
|
||||
movefta(); //ST 2
|
||||
moveweapons_r(); //ST 4
|
||||
tickstat(STAT_PROJECTILE);
|
||||
moveplayers(); //ST 10
|
||||
movefallers_r(); //ST 12
|
||||
moveexplosions_r(); //ST 5
|
||||
tickstat(STAT_MISC, true);
|
||||
|
||||
actortime.Reset();
|
||||
actortime.Clock();
|
||||
|
@ -2049,7 +1976,7 @@ void think_r(void)
|
|||
actortime.Unclock();
|
||||
|
||||
moveeffectors_r(); //ST 3
|
||||
movestandables_r(); //ST 6
|
||||
tickstat(STAT_STANDABLE);
|
||||
doanimations();
|
||||
tickstat(STAT_FX); //ST 11
|
||||
|
||||
|
|
|
@ -29,7 +29,7 @@ void movedummyplayers(void);
|
|||
void resetlanepics(void);
|
||||
void moveplayers();
|
||||
void doanimations();
|
||||
void tickstat(int stat);
|
||||
void tickstat(int stat, bool deleteinvalid = false);
|
||||
void operaterespawns(int low);
|
||||
void moveclouds(double interpfrac);
|
||||
void movefta();
|
||||
|
|
Loading…
Reference in a new issue