- 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

# Conflicts:
#	src/dthinker.cpp
This commit is contained in:
alexey.lysiuk 2019-08-31 13:20:10 +03:00 committed by drfrag
parent 99c7be3f2e
commit f212220dcd

View file

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