DEADSOFTWARE

port forwarding and miniupnpc are now completely optional
[d2df-sdl.git] / src / game / Doom2DF.lpr
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, either version 3 of the License, or
6 * (at your option) any later version.
7 *
8 * This program is distributed in the hope that it will be useful,
9 * but WITHOUT ANY WARRANTY; without even the implied warranty of
10 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
11 * GNU General Public License for more details.
12 *
13 * You should have received a copy of the GNU General Public License
14 * along with this program. If not, see <http://www.gnu.org/licenses/>.
15 *)
16 {$INCLUDE ../shared/a_modes.inc}
17 program Doom2DF;
18 {$IFNDEF HEADLESS}
19 {$IFDEF WINDOWS}
20 {$APPTYPE GUI}
21 {$ENDIF}
22 {$ENDIF}
23 {$HINTS OFF}
25 {$IFDEF USE_SDLMIXER}
26 {$IFDEF USE_FMOD}
27 {$ERROR define only one of USE_SDLMIXER or USE_FMOD}
28 {$ENDIF}
29 {$ELSE}
30 {$UNDEF USE_SDLMIXER}
31 {$DEFINE USE_FMOD}
32 {$ENDIF}
34 uses
35 mempool in '../shared/mempool.pas',
36 conbuf in '../shared/conbuf.pas',
37 geom in '../shared/geom.pas',
38 math,
39 GL,
40 GLExt,
41 {$IFDEF USE_MINIUPNPC}
42 miniupnpc in '../lib/miniupnpc/miniupnpc.pas',
43 {$ENDIF}
44 SDL2 in '../lib/sdl2/sdl2.pas',
45 {$IFDEF USE_SDLMIXER}
46 SDL2_mixer in '../lib/sdl2/SDL2_mixer.pas',
47 {$ENDIF}
48 ENet in '../lib/enet/enet.pp',
49 e_graphics in '../engine/e_graphics.pas',
50 e_input in '../engine/e_input.pas',
51 e_log in '../engine/e_log.pas',
52 e_sound in '../engine/e_sound.pas',
53 e_texture in '../engine/e_texture.pas',
54 e_msg in '../engine/e_msg.pas',
55 utils in '../shared/utils.pas',
56 xstreams in '../shared/xstreams.pas',
57 sfs in '../sfs/sfs.pas',
58 sfsPlainFS in '../sfs/sfsPlainFS.pas',
59 sfsZipFS in '../sfs/sfsZipFS.pas',
60 wadreader in '../shared/wadreader.pas',
61 MAPDEF in '../shared/MAPDEF.pas',
62 CONFIG in '../shared/CONFIG.pas',
63 g_basic in 'g_basic.pas',
64 g_console in 'g_console.pas',
65 g_net in 'g_net.pas',
66 g_netmsg in 'g_netmsg.pas',
67 g_nethandler in 'g_nethandler.pas',
68 g_netmaster in 'g_netmaster.pas',
69 g_res_downloader in 'g_res_downloader.pas',
70 g_grid in 'g_grid.pas',
71 g_game in 'g_game.pas',
72 g_gfx in 'g_gfx.pas',
73 g_gui in 'g_gui.pas',
74 g_items in 'g_items.pas',
75 g_main in 'g_main.pas',
76 g_map in 'g_map.pas',
77 g_menu in 'g_menu.pas',
78 g_monsters in 'g_monsters.pas',
79 g_options in 'g_options.pas',
80 g_phys in 'g_phys.pas',
81 g_player in 'g_player.pas',
82 g_playermodel in 'g_playermodel.pas',
83 g_saveload in 'g_saveload.pas',
84 g_sound in 'g_sound.pas',
85 g_textures in 'g_textures.pas',
86 g_triggers in 'g_triggers.pas',
87 g_weapons in 'g_weapons.pas',
88 g_window in 'g_window.pas',
89 g_holmes in 'g_holmes.pas',
90 SysUtils,
91 {$IFDEF USE_FMOD}
92 fmod in '../lib/FMOD/fmod.pas',
93 fmoderrors in '../lib/FMOD/fmoderrors.pas',
94 fmodpresets in '../lib/FMOD/fmodpresets.pas',
95 fmodtypes in '../lib/FMOD/fmodtypes.pas',
96 {$ENDIF}
97 xprofiler in '../shared/xprofiler.pas',
98 binheap in '../shared/binheap.pas',
99 hashtable in '../shared/hashtable.pas',
100 idpool in '../shared/idpool.pas',
101 xparser in '../shared/xparser.pas',
102 xdynrec in '../shared/xdynrec.pas',
103 exoma in '../shared/exoma.pas',
104 envvars in '../shared/envvars.pas',
105 g_panel in 'g_panel.pas',
106 g_language in 'g_language.pas',
108 sdlcarcass in '../flexui/sdlcarcass.pas',
109 //sdlstandalone in '../flexui/sdlstandalone.pas',
111 fui_wadread in '../flexui/fui_wadread.pas',
112 fui_common in '../flexui/fui_common.pas',
113 fui_gfx_gl in '../flexui/fui_gfx_gl.pas',
114 fui_events in '../flexui/fui_events.pas',
115 fui_style in '../flexui/fui_style.pas',
116 fui_flexlay in '../flexui/fui_flexlay.pas',
117 fui_ctls in '../flexui/fui_ctls.pas',
119 ImagingTypes,
120 Imaging,
121 ImagingUtility;
123 {$IFDEF WINDOWS}
124 {$R *.res}
125 {$ENDIF}
127 var
128 f: Integer;
129 noct: Boolean = false;
130 //tfo: Text;
131 begin
132 SetExceptionMask([exInvalidOp, exDenormalized, exZeroDivide, exOverflow, exUnderflow, exPrecision]); //k8: fuck off, that's why
133 for f := 1 to ParamCount do
134 begin
135 if ParamStr(f) = '--gdb' then noct := true
136 else if ParamStr(f) = '--log' then conbufDumpToStdOut := true
137 else if ParamStr(f) = '--safe-log' then e_SetSafeSlowLog(true);
138 end;
139 if noct then
140 begin
141 Main()
142 end
143 else
144 begin
145 try
146 Main();
147 e_WriteLog('Shutdown with no errors.', TMsgType.Notify);
148 except
149 on e: Exception do
150 begin
151 e_WriteStackTrace(e.message);
152 //e_WriteLog(Format(_lc[I_SYSTEM_ERROR_MSG], [E.Message]), MSG_FATALERROR);
153 (*
154 AssignFile(tfo, GameDir+'/trace.log');
155 {$I-}
156 Append(tfo);
157 if (IOResult <> 0) then Rewrite(tfo);
158 if (IOResult = 0) then begin writeln(tfo, '====================='); DumpExceptionBackTrace(tfo); CloseFile(tfo); end;
159 *)
160 end
161 else
162 begin
163 //e_WriteLog(Format(_lc[I_SYSTEM_ERROR_UNKNOWN], [NativeUInt(ExceptAddr())]), MSG_FATALERROR);
164 e_WriteStackTrace('FATAL ERROR');
165 end;
166 end;
167 end;
168 e_DeinitLog();
169 end.