DEADSOFTWARE

render: add option -dDISABLE_RENDER
[d2df-sdl.git] / src / game / g_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 g_window;
18 interface
20 procedure ProcessLoading (forceUpdate: Boolean=false);
22 implementation
24 uses
25 {$IFDEF ENABLE_RENDER}
26 r_render,
27 {$ENDIF}
28 {$IFNDEF HEADLESS}
29 g_system,
30 {$ENDIF}
31 e_sound, g_net
32 ;
34 procedure ProcessLoading (forceUpdate: Boolean = False);
35 var update: Boolean;
36 begin
37 {$IFDEF HEADLESS}
38 update := True;
39 {$ELSE}
40 update := sys_HandleInput() = False;
41 {$ENDIF}
42 if update then
43 begin
44 {$IFDEF ENABLE_RENDER}
45 r_Render_DrawLoading(forceUpdate);
46 {$ENDIF}
47 e_SoundUpdate();
48 if NetMode = NET_SERVER then
49 g_Net_Host_Update
50 else if (NetMode = NET_CLIENT) and (NetState <> NET_STATE_AUTH) then
51 g_Net_Client_UpdateWhileLoading
52 end
53 end;
55 end.