- rewrote dynamic lights to not use actors for the internal representation and made DynamicLight a purely scripted class.

This should be less of a drag on the playsim than having each light a separate actor. A quick check with ZDCMP2 showed that the light processing time was reduced to 1/3rd from 0.5 ms to 0.17 ms per tic.
It's also one native actor class less.
This commit is contained in:
Christoph Oelckers 2019-01-01 19:35:55 +01:00
commit d654e02dea
34 changed files with 438 additions and 412 deletions

View file

@ -40,6 +40,8 @@
#include "vm.h"
#include "c_dispatch.h"
#include "v_text.h"
#include "g_levellocals.h"
#include "a_dynlight.h"
static int ThinkCount;
@ -617,6 +619,13 @@ void DThinker::RunThinkers ()
count += TickThinkers(&FreshThinkers[i], &Thinkers[i]);
}
} while (count != 0);
for (auto light = level.lights; light;)
{
auto next = light->next;
light->Tick();
light = next;
}
}
else
{
@ -637,6 +646,19 @@ 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;)
{
prof.numcalls++;
auto next = light->next;
light->Tick();
light = next;
}
prof.timer.Unclock();
struct SortedProfileInfo
{
const char* className;