- do thinker profiling of internal dynlights only when they are present

There is no point to output zero calls and/or handle such case in profiling stats calculation
This commit is contained in:
alexey.lysiuk 2019-08-31 13:20:10 +03:00
parent 78c5a8ae92
commit f5d2063613

View file

@ -150,17 +150,20 @@ void FThinkerCollection::RunThinkers(FLevelLocals *Level)
} }
} while (count != 0); } while (count != 0);
// Also profile the internal dynamic lights, even though they are not implemented as thinkers. if (Level->lights)
auto &prof = Profiles[NAME_InternalDynamicLight];
prof.timer.Clock();
for (auto light = Level->lights; light;)
{ {
prof.numcalls++; // Also profile the internal dynamic lights, even though they are not implemented as thinkers.
auto next = light->next; auto &prof = Profiles[NAME_InternalDynamicLight];
light->Tick(); prof.timer.Clock();
light = next; for (auto light = Level->lights; light;)
{
prof.numcalls++;
auto next = light->next;
light->Tick();
light = next;
}
prof.timer.Unclock();
} }
prof.timer.Unclock();
struct SortedProfileInfo struct SortedProfileInfo