X-Git-Url: https://deadsoftware.ru/gitweb?a=blobdiff_plain;f=src%2Feditor%2FEditor.lpr;h=3889b5109fd514598830302435c888ccfe509be8;hb=91e1fe7e58aec7404a6029cb757dbe27677ebbb6;hp=21d8fe5df9a97c8f5cf532dac8b453175148170d;hpb=7bc7d5022ae82e37fee8b3003432f9294176a470;p=d2df-editor.git diff --git a/src/editor/Editor.lpr b/src/editor/Editor.lpr index 21d8fe5..3889b51 100644 --- a/src/editor/Editor.lpr +++ b/src/editor/Editor.lpr @@ -3,8 +3,8 @@ program Editor; {$INCLUDE ../shared/a_modes.inc} uses - Forms, Interfaces, - GL, GLExt, + Forms, Interfaces, Dialogs, + GL, GLExt, SysUtils, e_graphics in '../engine/e_graphics.pas', e_log in '../engine/e_log.pas', e_textures in '../engine/e_textures.pas', @@ -16,6 +16,7 @@ uses WADSTRUCT in '../shared/WADSTRUCT.pas', CONFIG in '../shared/CONFIG.pas', xstreams in '../shared/xstreams.pas', + dfzip in '../shared/dfzip.pas', sfs in '../sfs/sfs.pas', sfsPlainFS in '../sfs/sfsPlainFS.pas', sfsZipFS in '../sfs/sfsZipFS.pas', @@ -58,10 +59,32 @@ uses {$R *.res} {$ENDIF} + type + THandlerObject = class (TObject) + procedure ExceptionHandler (Sender: TObject; e: Exception); + end; + + var + H: THandlerObject; + + procedure THandlerObject.ExceptionHandler (Sender: TObject; e: Exception); + begin + e_WriteStackTrace(e.message); + MessageDlg('Unhandled exception: ' + e.message + ' (see Editor.log for more information)', mtError, [mbOK], 0); + end; + begin Application.ExceptionDialog := aedOkMessageBox; + Application.AddOnExceptionHandler(H.ExceptionHandler, True); Application.Initialize(); +{$IF DECLARED(UseHeapTrace)} + (* http://wiki.freepascal.org/heaptrc *) + GlobalSkipIfNoLeaks := True; + //SetHeapTraceOutput('EditorLeaks.log'); + //HaltOnError := False; +{$ENDIF} + Application.CreateForm(TMainForm, MainForm); Application.CreateForm(TOptionsForm, OptionsForm); Application.CreateForm(TAboutForm, AboutForm);