X-Git-Url: http://deadsoftware.ru/gitweb?a=blobdiff_plain;f=src%2Fgame%2Fg_window.pas;h=3adb2b616da1f09af1dfb5c3c7f0b0b09e1689fe;hb=d6733d8e7dd555b965d4ccc93a3a8ae4d306dfc0;hp=d703ea2fc2088a829bfa3af1bf07b83d31b44f16;hpb=69ed21bb4a9cd4c59ba1acfd5971c7be5f854ee2;p=d2df-sdl.git diff --git a/src/game/g_window.pas b/src/game/g_window.pas index d703ea2..3adb2b6 100644 --- a/src/game/g_window.pas +++ b/src/game/g_window.pas @@ -2,8 +2,7 @@ * * This program is free software: you can redistribute it and/or modify * it under the terms of the GNU General Public License as published by - * the Free Software Foundation, either version 3 of the License, or - * (at your option) any later version. + * the Free Software Foundation, version 3 of the License ONLY. * * This program is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of @@ -65,7 +64,7 @@ uses const - ProgressUpdateMSecs = 1;//100; + ProgressUpdateMSecs = 35; //1;//100; var h_Wnd: PSDL_Window = nil; @@ -783,13 +782,17 @@ begin end; +{$IFNDEF HEADLESS} var prevLoadingUpdateTime: UInt64 = 0; +{$ENDIF} procedure ProcessLoading (forceUpdate: Boolean=false); var ev: TSDL_Event; +{$IFNDEF HEADLESS} stt: UInt64; +{$ENDIF} begin FillChar(ev, sizeof(ev), 0); wLoadingProgress := true; @@ -807,20 +810,13 @@ 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; if forceUpdate then @@ -831,8 +827,10 @@ begin DrawLoadingStat(); g_Console_Draw(True); SwapBuffers(); + prevLoadingUpdateTime := getTimeMilli(); end; end; +{$ENDIF} e_SoundUpdate(); @@ -1177,8 +1175,10 @@ begin // Êîìàíäíàÿ ñòðîêà if (ParamCount > 0) then g_Game_Process_Params(); +{$IFNDEF HEADLESS} // Çàïðîñ ÿçûêà if (not gGameOn) and gAskLanguage then g_Menu_AskLanguage(); +{$ENDIF} e_WriteLog('Entering the main loop', TMsgType.Notify);