DEADSOFTWARE

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