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}
18 interface
20 uses
21 utils;
27 var
33 implementation
35 uses
37 {$IFDEF ENABLE_HOLMES}
39 {$ENDIF}
47 var
55 begin
60 begin
62 Exit;
64 {$IFNDEF HEADLESS}
66 {$ENDIF}
70 // TODO: At the moment, I left here only host network processing, because the client code must
71 // handle network events on its own. Otherwise separate network cases that use different calls to
72 // enet_host_service() WILL lose their packets (for example, resource downloading). So they have
73 // to handle everything by themselves. But in general, this MUST be removed completely, since
74 // updating the window should never affect the network. Use single enet_host_service(), period.
81 var
83 begin
92 begin
103 begin
113 begin
119 begin
121 exit;
124 // Âðåìÿ ïðåäûäóùåãî îáíîâëåíèÿ
128 // don't wait if VSync is on, GL already probably waits enough
133 begin
136 else
138 Draw;
139 sys_Repaint;
140 Frame := Time
141 end
142 else
149 var
153 {$IFDEF ENABLE_HOLMES}
156 {$ENDIF}
157 begin
161 begin
181 {.$IF DEFINED(D2F_DEBUG)}
183 {.$ENDIF}
185 {$IFDEF ENABLE_HOLMES}
189 begin
191 begin
198 begin
200 begin
203 {$IFNDEF HEADLESS}
205 begin
212 {$ELSE}
213 // fuck off, fpc!
216 {$ENDIF}
220 {$ENDIF}
223 begin
225 begin
232 begin
240 begin
242 begin
249 r_Window_Initialize;
251 Init;
256 // Êîìàíäíàÿ ñòðîêà
259 {$IFNDEF HEADLESS}
260 // Çàïðîñ ÿçûêà
262 {$ENDIF}
266 // main loop
278 initialization