Refactor SWWMHandler profiling routines.

This commit is contained in:
Mari the Deer 2022-02-25 16:51:20 +01:00
commit f6b891c9fe
7 changed files with 104 additions and 74 deletions

View file

@ -390,12 +390,12 @@ extend Class SWWMHandler
override void WorldThingDamaged( WorldEvent e )
{
if ( profiling ) curms = MSTime();
if ( profiling ) ProfileTick();
if ( e.Damage > 0 ) DoDamageHandling(e);
if ( e.DamageSource && (e.DamageSource != e.Thing) ) DoCombatHit(e);
if ( (e.Thing.Health > 0) || e.Thing.bKilled || e.Thing.bCorpse )
{
if ( profiling ) worldthingdamaged_ms += MSTime()-curms;
if ( profiling ) ProfileTock(PT_WORLDTHINGDAMAGED);
return;
}
DoGibThing(e);
@ -406,10 +406,10 @@ extend Class SWWMHandler
e.DamageSource.DamageMobj(null,null,Actor.TELEFRAG_DAMAGE,'EndLevel');
if ( !e.Thing.player && !e.Thing.bIsMonster && !e.Thing.bCountKill && !(e.Thing is 'ScriptedMarine') )
{
if ( profiling ) worldthingdamaged_ms += MSTime()-curms;
if ( profiling ) ProfileTock(PT_WORLDTHINGDAMAGED);
return;
}
DoKillScoring(e);
if ( profiling ) worldthingdamaged_ms += MSTime()-curms;
if ( profiling ) ProfileTock(PT_WORLDTHINGDAMAGED);
}
}