diff --git a/src/game/Doom2DF.dpr b/src/game/Doom2DF.dpr
index e72de94e0ba79020a72ee529f7d9e1c84622dc2b..679615611ed466084ac3c576607f7c0ca86251c5 100644 (file)
--- a/src/game/Doom2DF.dpr
+++ b/src/game/Doom2DF.dpr
program Doom2DF;
-{$IFDEF WIN32}
- {$APPTYPE GUI}
+{$IFNDEF HEADLESS}
+ {$IFDEF WIN32}
+ {$APPTYPE GUI}
+ {$ENDIF}
{$ENDIF}
{$HINTS OFF}
sfsZipFS in '../sfs/sfsZipFS.pas',
sfsMemFS in '../sfs/sfsMemFS.pas',
xstreams in '../sfs/xstreams.pas',
+ utils in '../shared/utils.pas',
WADEDITOR in '../shared/WADEDITOR.pas',
WADSTRUCT in '../shared/WADSTRUCT.pas',
MAPSTRUCT in '../shared/MAPSTRUCT.pas',
{$R CustomRes.res}
{$ENDIF}
+var
+ f: Integer;
+ noct: Boolean = false;
begin
- try
- Main();
- e_WriteLog('Shutdown with no errors.', MSG_NOTIFY);
- except
- on E: Exception do
- e_WriteLog(Format(_lc[I_SYSTEM_ERROR_MSG], [E.Message]), MSG_FATALERROR);
- else
- e_WriteLog(Format(_lc[I_SYSTEM_ERROR_UNKNOWN], [LongWord(ExceptAddr())]), MSG_FATALERROR);
- end;
+ for f := 1 to ParamCount do if ParamStr(f) = '--gdb' then noct := true;
+ if noct then
+ Main()
+ else
+ try
+ Main();
+ e_WriteLog('Shutdown with no errors.', MSG_NOTIFY);
+ except
+ on E: Exception do
+ e_WriteLog(Format(_lc[I_SYSTEM_ERROR_MSG], [E.Message]), MSG_FATALERROR);
+ else
+ e_WriteLog(Format(_lc[I_SYSTEM_ERROR_UNKNOWN], [LongWord(ExceptAddr())]), MSG_FATALERROR);
+ end;
end.