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
28 var
36 implementation
38 uses
39 {$INCLUDE ../nogl/noGLuses.inc}
40 {$IFDEF ENABLE_HOLMES}
42 {$ENDIF}
43 {$IFDEF USE_SDL2}
44 SDL2,
45 {$ENDIF}
52 xparser;
55 var
59 var
61 {$IF not DEFINED(HEADLESS) and DEFINED(ENABLE_HOLMES)}
63 {$ENDIF}
64 begin
78 TMsgType.Notify
79 );
82 TMsgType.Notify
83 );
85 {$IFDEF HEADLESS}
87 {$ENDIF}
90 {$IFDEF USE_SDL2}
91 {$IFDEF HEADLESS}
92 {$IFDEF USE_SDLMIXER}
94 // HACK: shit this into env and hope for the best
96 {$ELSE}
98 {$ENDIF}
99 {$ELSE}
100 {$IFDEF USE_SDLMIXER}
101 {*sdlflags := SDL_INIT_EVERYTHING;*}
103 {$ELSE}
105 {$ENDIF}
106 {$ENDIF}
112 {$ENDIF}
117 //GetSystemDefaultLCID()
119 //e_WriteLog('Read language file', MSG_NOTIFY);
120 //g_Language_Load(DataDir + gLanguage + '.txt');
124 {$IFNDEF USE_SDL2}
125 sys_Init;
126 {$ENDIF}
128 {$IF not DEFINED(HEADLESS) and DEFINED(ENABLE_HOLMES)}
131 begin
134 try
141 begin
144 //raise;
146 else
147 begin
149 //raise;
153 begin
154 try
158 begin
160 //raise;
163 else
164 begin
165 //raise;
171 {$ENDIF}
173 //g_Res_CreateDatabases(); // it will be done before connecting to the server for the first time
177 {$WARNINGS OFF}
179 {$WARNINGS ON}
181 {$IFDEF USE_SDL2}
184 {$ELSE}
185 sys_Final;
186 {$ENDIF}
190 var
192 begin
193 Randomize;
195 {$IFDEF HEADLESS}
196 {$IFDEF USE_SDLMIXER}
198 {$ELSE}
200 {$ENDIF}
201 {$ELSE}
203 {$ENDIF}
207 g_Touch_Init;
209 (*
210 if (e_JoysticksAvailable > 0) then
211 e_WriteLog('Input: Joysticks available.', TMsgType.Notify)
212 else
213 e_WriteLog('Input: No Joysticks.', TMsgType.Notify);
214 *)
217 begin
230 begin
238 begin
246 begin
252 begin
258 var
260 begin
263 begin
303 var
305 begin
310 result :=
315 {
316 if ct = I_GAME_CHEAT_JETPACK then
317 begin
318 e_WriteLog('ls1: ['+ls1+']', MSG_NOTIFY);
319 e_WriteLog('ls2: ['+ls2+']', MSG_NOTIFY);
320 e_WriteLog('bf0: ['+Copy(charbuff, 17-Length(ls1)-eofs, Length(ls1))+']', MSG_NOTIFY);
321 e_WriteLog('bf1: ['+Translit(Copy(charbuff, 17-Length(ls1)-eofs, Length(ls1)))+']', MSG_NOTIFY);
322 e_WriteLog('bf2: ['+Copy(charbuff, 17-Length(ls2)-eofs, Length(ls2))+']', MSG_NOTIFY);
323 e_WriteLog('bf3: ['+Translit(Copy(charbuff, 17-Length(ls2)-eofs, Length(ls2)))+']', MSG_NOTIFY);
324 end;
325 }
330 const
332 label
333 Cheated;
334 var
338 begin
339 {
340 if (not gGameOn) or (not gCheats) or ((gGameSettings.GameType <> GT_SINGLE) and
341 (gGameSettings.GameMode <> GM_COOP) and (not gDebugMode))
342 or g_Game_IsNet then Exit;
343 }
349 //
351 begin
356 // RAMBO
358 begin
363 // TANK
365 begin
370 // IDDQD
372 begin
378 //
380 begin
384 // GOODBYE
386 begin
390 begin
392 //g_Game_ExitLevel(gTriggers[a].Data.MapName);
394 Break;
398 //
400 if CheckCheat(I_GAME_CHEAT_CHANGEMAP, 2) and (s2[1] >= '0') and (s2[1] <= '9') and (s2[2] >= '0') and (s2[2] <= '9') then
401 begin
403 begin
409 //
411 begin
415 // BULLFROG
417 begin
421 // FORMULA1
423 begin
427 // CONDOM
429 begin
434 //
436 begin
441 // PURELOVE
443 begin
448 //
450 begin
455 // CASPER
457 begin
462 //
464 begin
469 // INFERNO
471 begin
477 begin
482 begin
486 Exit;
488 Cheated:
494 {$IFNDEF HEADLESS}
495 var
497 {$ENDIF}
498 begin
499 {$IFNDEF HEADLESS}
502 begin
504 begin
508 if (not g_Game_IsNet) and (g_ActiveWindow = nil) then g_Game_Pause(false); //Fn loves to do this
509 end
511 begin
513 begin
515 end
517 begin
519 begin
521 begin
523 g_Game_Free;
525 Exit;
537 begin
552 else
553 begin
556 begin
558 end
560 begin
564 end
566 begin
572 {$ENDIF}
577 var
580 begin
582 begin
584 end
586 begin
590 end
591 else
592 begin