From 6f8dc88116ecc655f962442885550f06d5c081d3 Mon Sep 17 00:00:00 2001 From: Ketmar Dark Date: Sat, 12 Oct 2019 03:21:04 +0300 Subject: [PATCH] gfx: cleaned up and fixed progress update code (it was broken; oops) --- src/game/g_window.pas | 21 ++++++++------------- 1 file changed, 8 insertions(+), 13 deletions(-) diff --git a/src/game/g_window.pas b/src/game/g_window.pas index 3e38a84..b0c0678 100644 --- a/src/game/g_window.pas +++ b/src/game/g_window.pas @@ -64,7 +64,7 @@ uses const - ProgressUpdateMSecs = 1;//100; + ProgressUpdateMSecs = 35; //1;//100; var h_Wnd: PSDL_Window = nil; @@ -782,8 +782,10 @@ begin end; +{$IFNDEF HEADLESS} var prevLoadingUpdateTime: UInt64 = 0; +{$ENDIF} procedure ProcessLoading (forceUpdate: Boolean=false); var @@ -806,23 +808,15 @@ begin exit; end; +{$IFNDEF HEADLESS} if not wMinimized then begin - if forceUpdate then - begin - prevLoadingUpdateTime := getTimeMilli(); - end - else + if not forceUpdate then begin stt := getTimeMilli(); - if (stt < prevLoadingUpdateTime) or (stt-prevLoadingUpdateTime >= ProgressUpdateMSecs) then - begin - prevLoadingUpdateTime := stt; - forceUpdate := true; - end; + forceUpdate := (stt < prevLoadingUpdateTime) or (stt-prevLoadingUpdateTime >= ProgressUpdateMSecs); end; -{$IFNDEF HEADLESS} if forceUpdate then begin DrawMenuBackground('INTER'); @@ -831,9 +825,10 @@ begin DrawLoadingStat(); g_Console_Draw(True); SwapBuffers(); + prevLoadingUpdateTime := getTimeMilli(); end; -{$ENDIF} end; +{$ENDIF} e_SoundUpdate(); -- 2.29.2