From c7b325dcfe40e1961862f8923ee3ee4cc190e450 Mon Sep 17 00:00:00 2001 From: Toni Uhlig Date: Sun, 10 Nov 2019 16:17:16 +0100 Subject: using new gdi_radar_check_if_redraw_necessary api function to increae performance and reduced Gdi update time to draw more frames per second --- TestDLL/dllmain.cpp | 13 +++++-------- 1 file changed, 5 insertions(+), 8 deletions(-) (limited to 'TestDLL') diff --git a/TestDLL/dllmain.cpp b/TestDLL/dllmain.cpp index 481f4b4..fc3b7e8 100644 --- a/TestDLL/dllmain.cpp +++ b/TestDLL/dllmain.cpp @@ -195,7 +195,7 @@ static bool ConfigureAndInitGDI(void) gdi_radar_config cfg = {}; cfg.className = L"HR"; cfg.windowName = L"HRWND"; - cfg.minimumUpdateTime = 0.25f; + cfg.minimumUpdateTime = 0.20f; cfg.maximumRedrawFails = 5; cfg.reservedEntities = 16; cfg.drawAngles = true; @@ -344,7 +344,7 @@ void APIENTRY LibEntry(struct HuntCtx * HuntCtx) "TestDLL Notification", MB_OK | MB_ICONINFORMATION); return; -} + } void *bla = malloc(10); free(bla); #endif @@ -376,12 +376,9 @@ void APIENTRY LibEntry(struct HuntCtx * HuntCtx) if (!iEnt || iEnt->GetSystem()->GetGlobalEnvironment()->pGameFramework->IsInLevelLoad()) { return; } - -#if 0 - static UINT64 exec_counter = 0; - if ((++exec_counter) % 500 == 0) { + if (!gdi_radar_check_if_redraw_necessary(ctx)) { + return; } -#endif gdi_radar_clear_entities(ctx); @@ -436,4 +433,4 @@ void APIENTRY LibEntry(struct HuntCtx * HuntCtx) } gdi_radar_process_window_events_nonblocking(ctx); - } \ No newline at end of file +} \ No newline at end of file -- cgit v1.2.3