1
Fork 0
firetexture_m/zscript/ft_testhandler.zsc

34 lines
1.1 KiB
Text

// let's test that this madness works, then
Class FireTextureTestHandler : StaticEventHandler
{
ui FireTexture testme;
ui TextureID testtex;
ui double timers[3];
override void UiTick()
{
if ( testme && testme.Initialized() )
{
timers[0] = MSTimeF();
testme.Tick();
timers[1] = MSTimeF();
testme.Render();
timers[2] = MSTimeF();
}
}
override void RenderOverlay( RenderEvent e )
{
if ( !testme ) testme = FireTexture.Load("Pad_FX.ftx");
if ( !testme.Initialized() ) return;
if ( !testtex.IsValid() ) testtex = TexMan.CheckForTexture("Pad_FX");
Screen.DrawTexture(testtex,false,8,8,
DTA_ScaleX,CleanXFac_1,DTA_ScaleY,CleanYFac_1);
Screen.DrawText(NewSmallFont,Font.CR_RED,16+testme.GetWidth()*CleanXFac_1,16,
"← procedural texture running in real time\n no japes here",
DTA_ScaleX,CleanXFac_1,DTA_ScaleY,CleanYFac_1);
Screen.DrawText(NewSmallFont,Font.CR_RED,16,16+testme.GetHeight()*CleanYFac_1,
"tick: "..(timers[1]-timers[0]).."ms\nrender: "..(timers[2]-timers[1]).."ms",
DTA_ScaleX,CleanXFac_1,DTA_ScaleY,CleanYFac_1);
}
}