DEADSOFTWARE

6d08b18e0f771445863b5b397424334385bc8447
[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 {$IFNDEF HEADLESS}
26 r_render, g_system,
27 {$ENDIF}
28 e_sound, g_net
29 ;
31 procedure ProcessLoading (forceUpdate: Boolean = False);
32 var update: Boolean;
33 begin
34 {$IFDEF HEADLESS}
35 update := True;
36 {$ELSE}
37 update := sys_HandleInput() = False;
38 {$ENDIF}
39 if update then
40 begin
41 {$IFNDEF HEADLESS}
42 r_Render_DrawLoading(forceUpdate);
43 {$ENDIF}
44 e_SoundUpdate();
45 // TODO: At the moment, I left here only host network processing, because the client code must
46 // handle network events on its own. Otherwise separate network cases that use different calls to
47 // enet_host_service() WILL lose their packets (for example, resource downloading). So they have
48 // to handle everything by themselves. But in general, this MUST be removed completely, since
49 // updating the window should never affect the network. Use single enet_host_service(), period.
50 if NetMode = NET_SERVER then g_Net_Host_Update();
51 end
52 end;
54 end.