DEADSOFTWARE

added d_mem command
[d2df-sdl.git] / src / game / Doom2DF.dpr
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 {$UNDEF XXX}
26 {$IFDEF USE_SDLMIXER}
27 {$DEFINE XXX}
28 {$ENDIF}
29 {$IFDEF USE_FMOD}
30 {$IFDEF XXX}
31 {$ERROR define one of USE_SDLMIXER or USE_FMOD}
32 {$ELSE}
33 {$DEFINE XXX}
34 {$ENDIF}
35 {$ENDIF}
37 {$IFNDEF XXX}
38 {$ERROR define USE_SDLMIXER or USE_FMOD}
39 {$ENDIF}
41 uses
42 conbuf in '../shared/conbuf.pas',
43 math,
44 GL,
45 GLExt,
46 SDL2 in '../lib/sdl2/sdl2.pas',
47 {$IFDEF USE_SDLMIXER}
48 SDL2_mixer in '../lib/sdl2/SDL2_mixer.pas',
49 {$ENDIF}
50 ENet in '../lib/enet/enet.pp',
51 e_graphics in '../engine/e_graphics.pas',
52 e_input in '../engine/e_input.pas',
53 e_log in '../engine/e_log.pas',
54 e_sound in '../engine/e_sound.pas',
55 e_texture in '../engine/e_texture.pas',
56 e_msg in '../engine/e_msg.pas',
57 utils in '../shared/utils.pas',
58 xstreams in '../shared/xstreams.pas',
59 sfs in '../sfs/sfs.pas',
60 sfsPlainFS in '../sfs/sfsPlainFS.pas',
61 sfsZipFS in '../sfs/sfsZipFS.pas',
62 wadreader in '../shared/wadreader.pas',
63 MAPDEF in '../shared/MAPDEF.pas',
64 CONFIG in '../shared/CONFIG.pas',
65 g_basic in 'g_basic.pas',
66 g_console in 'g_console.pas',
67 g_net in 'g_net.pas',
68 g_netmsg in 'g_netmsg.pas',
69 g_nethandler in 'g_nethandler.pas',
70 g_netmaster in 'g_netmaster.pas',
71 g_res_downloader in 'g_res_downloader.pas',
72 g_grid in 'g_grid.pas',
73 g_game in 'g_game.pas',
74 g_gfx in 'g_gfx.pas',
75 g_gui in 'g_gui.pas',
76 g_items in 'g_items.pas',
77 g_main in 'g_main.pas',
78 g_map in 'g_map.pas',
79 g_menu in 'g_menu.pas',
80 g_monsters in 'g_monsters.pas',
81 g_options in 'g_options.pas',
82 g_phys in 'g_phys.pas',
83 g_player in 'g_player.pas',
84 g_playermodel in 'g_playermodel.pas',
85 g_saveload in 'g_saveload.pas',
86 g_sound in 'g_sound.pas',
87 g_textures in 'g_textures.pas',
88 g_triggers in 'g_triggers.pas',
89 g_weapons in 'g_weapons.pas',
90 g_window in 'g_window.pas',
91 g_holmes in 'g_holmes.pas',
92 SysUtils,
93 {$IFDEF USE_FMOD}
94 fmod in '../lib/FMOD/fmod.pas',
95 fmoderrors in '../lib/FMOD/fmoderrors.pas',
96 fmodpresets in '../lib/FMOD/fmodpresets.pas',
97 fmodtypes in '../lib/FMOD/fmodtypes.pas',
98 {$ENDIF}
99 xprofiler in '../shared/xprofiler.pas',
100 binheap in '../shared/binheap.pas',
101 hashtable in '../shared/hashtable.pas',
102 idpool in '../shared/idpool.pas',
103 xparser in '../shared/xparser.pas',
104 xdynrec in '../shared/xdynrec.pas',
105 exoma in '../shared/exoma.pas',
106 BinEditor in '../shared/BinEditor.pas',
107 envvars in '../shared/envvars.pas',
108 g_panel in 'g_panel.pas',
109 g_language in 'g_language.pas',
110 ImagingTypes,
111 Imaging,
112 ImagingUtility;
114 {$IFDEF WINDOWS}
115 {$R *.res}
116 {$R CustomRes.res}
117 {$ENDIF}
119 var
120 f: Integer;
121 noct: Boolean = false;
122 //tfo: Text;
123 begin
124 SetExceptionMask([exInvalidOp, exDenormalized, exZeroDivide, exOverflow, exUnderflow, exPrecision]); //k8: fuck off, that's why
125 for f := 1 to ParamCount do
126 begin
127 if ParamStr(f) = '--gdb' then noct := true
128 else if ParamStr(f) = '--log' then conbufDumpToStdOut := true
129 else if ParamStr(f) = '--safe-log' then e_SetSafeSlowLog(true);
130 end;
131 if noct then
132 begin
133 Main()
134 end
135 else
136 begin
137 try
138 Main();
139 e_WriteLog('Shutdown with no errors.', MSG_NOTIFY);
140 except
141 on e: Exception do
142 begin
143 e_WriteStackTrace(e.message);
144 //e_WriteLog(Format(_lc[I_SYSTEM_ERROR_MSG], [E.Message]), MSG_FATALERROR);
145 (*
146 AssignFile(tfo, GameDir+'/trace.log');
147 {$I-}
148 Append(tfo);
149 if (IOResult <> 0) then Rewrite(tfo);
150 if (IOResult = 0) then begin writeln(tfo, '====================='); DumpExceptionBackTrace(tfo); CloseFile(tfo); end;
151 *)
152 end
153 else
154 begin
155 //e_WriteLog(Format(_lc[I_SYSTEM_ERROR_UNKNOWN], [NativeUInt(ExceptAddr())]), MSG_FATALERROR);
156 e_WriteStackTrace('FATAL ERROR');
157 end;
158 end;
159 end;
160 e_DeinitLog();
161 end.