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.