DEADSOFTWARE

3e4075fe0d615bbdb1ccae719632740f48cc4060
[d2df-sdl.git] / r_window.pas
1 (* Copyright (C) Doom 2D: Forever Developers
2 *
3 * This program is free software: you can redistribute it and/or modify
4 * it under the terms of the GNU General Public License as published by
5 * the Free Software Foundation, version 3 of the License ONLY.
6 *
7 * This program is distributed in the hope that it will be useful,
8 * but WITHOUT ANY WARRANTY; without even the implied warranty of
9 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
10 * GNU General Public License for more details.
11 *
12 * You should have received a copy of the GNU General Public License
13 * along with this program. If not, see <http://www.gnu.org/licenses/>.
14 *)
15 {$INCLUDE ../../shared/a_modes.inc}
16 unit r_window;
18 interface
20 procedure r_Window_DrawLoading (forceUpdate: Boolean);
22 implementation
24 uses
25 {$INCLUDE ../nogl/noGLuses.inc}
26 {$IFDEF ENABLE_SYSTEM}
27 g_system,
28 {$ENDIF}
29 SysUtils, Classes,
30 e_log, utils,
31 r_graphics, r_game, r_console,
32 g_options, g_game, g_console,
33 xprofiler
34 ;
36 const
37 ProgressUpdateMSecs = 35; //1;//100;
39 var
40 prevLoadingUpdateTime: UInt64;
42 procedure r_Window_DrawLoading (forceUpdate: Boolean);
43 var stt: UInt64;
44 begin
45 if e_NoGraphics = False then
46 begin
47 if not forceUpdate then
48 begin
49 stt := getTimeMilli();
50 forceUpdate := (stt < prevLoadingUpdateTime) or (stt-prevLoadingUpdateTime >= ProgressUpdateMSecs);
51 end;
53 if forceUpdate then
54 begin
55 e_SetRendertarget(True);
56 e_SetViewPort(0, 0, gScreenWidth, gScreenHeight);
58 r_Game_DrawMenuBackground('INTER');
59 e_DarkenQuadWH(0, 0, gScreenWidth, gScreenHeight, 150);
60 r_Game_DrawLoadingStat();
61 r_Console_Draw(True);
63 e_SetRendertarget(False);
64 e_SetViewPort(0, 0, gWinSizeX, gWinSizeY);
65 e_BlitFramebuffer(gWinSizeX, gWinSizeY);
67 {$IFDEF ENABLE_SYSTEM}
68 sys_Repaint;
69 {$ENDIF}
70 prevLoadingUpdateTime := getTimeMilli();
71 end;
72 end;
73 end;
75 end.