Implemented RenderOverlay hook that executes directly after level and statusbar

This commit is contained in:
ZZYZX 2017-02-03 13:29:17 +02:00
commit 0d96517f5f
4 changed files with 21 additions and 0 deletions

View file

@ -411,6 +411,7 @@ bool E_CheckUiProcessors()
// normal event loopers (non-special, argument-less)
DEFINE_EVENT_LOOPER(RenderFrame)
DEFINE_EVENT_LOOPER(RenderOverlay)
DEFINE_EVENT_LOOPER(WorldLightning)
DEFINE_EVENT_LOOPER(WorldTick)
@ -589,6 +590,7 @@ DEFINE_EMPTY_HANDLER(DStaticEventHandler, WorldLightning)
DEFINE_EMPTY_HANDLER(DStaticEventHandler, WorldTick)
DEFINE_EMPTY_HANDLER(DStaticEventHandler, RenderFrame)
DEFINE_EMPTY_HANDLER(DStaticEventHandler, RenderOverlay)
DEFINE_EMPTY_HANDLER(DStaticEventHandler, PlayerEntered)
DEFINE_EMPTY_HANDLER(DStaticEventHandler, PlayerRespawned)
@ -798,6 +800,19 @@ void DStaticEventHandler::RenderFrame()
}
}
void DStaticEventHandler::RenderOverlay()
{
IFVIRTUAL(DStaticEventHandler, RenderOverlay)
{
// don't create excessive DObjects if not going to be processed anyway
if (func == DStaticEventHandler_RenderOverlay_VMPtr)
return;
DRenderEvent* e = E_SetupRenderEvent();
VMValue params[2] = { (DStaticEventHandler*)this, e };
GlobalVMStack.Call(func, params, 2, nullptr, 0, nullptr);
}
}
static DPlayerEvent* E_SetupPlayerEvent()
{
static DPlayerEvent* e = nullptr;