DEADSOFTWARE

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