hedgewars/uDebug.pas
branchsdl2transition
changeset 9682 aa2431ed87b2
parent 9301 c5d1c8259ef4
child 11362 ed5a6478e710
equal deleted inserted replaced
9679:dfaa39674e1e 9682:aa2431ed87b2
    22 
    22 
    23 interface
    23 interface
    24 
    24 
    25 procedure OutError(Msg: shortstring; isFatalError: boolean);
    25 procedure OutError(Msg: shortstring; isFatalError: boolean);
    26 procedure TryDo(Assert: boolean; Msg: shortstring; isFatal: boolean); inline;
    26 procedure TryDo(Assert: boolean; Msg: shortstring; isFatal: boolean); inline;
    27 procedure SDLTry(Assert: boolean; isFatal: boolean);
    27 procedure SDLTry(Assert: boolean; Msg: shortstring; isFatal: boolean);
    28 
    28 
    29 implementation
    29 implementation
    30 uses SDLh, uConsole, uCommands;
    30 uses SDLh, uConsole, uCommands;
    31 
    31 
    32 procedure OutError(Msg: shortstring; isFatalError: boolean);
    32 procedure OutError(Msg: shortstring; isFatalError: boolean);
    40 begin
    40 begin
    41 if not Assert then
    41 if not Assert then
    42     OutError(Msg, isFatal)
    42     OutError(Msg, isFatal)
    43 end;
    43 end;
    44 
    44 
    45 procedure SDLTry(Assert: boolean; isFatal: boolean);
    45 procedure SDLTry(Assert: boolean; Msg: shortstring; isFatal: boolean);
    46 var s: shortstring;
    46 var s: shortstring;
    47 begin
    47 begin
    48 if not Assert then
    48 if not Assert then
    49     begin
    49     begin
    50     s:= SDL_GetError();
    50     s:= SDL_GetError();
    51     OutError(s, isFatal)
    51     OutError(Msg + ': ' + s, isFatal)
    52     end
    52     end
    53 end;
    53 end;
    54 
    54 
    55 end.
    55 end.