hedgewars/uMisc.pas
changeset 24 79c411363184
parent 17 a6bed8d31444
child 32 78bff13b11c0
equal deleted inserted replaced
23:16322d14f068 24:79c411363184
   102 function arctan(const Y, X: real): real;
   102 function arctan(const Y, X: real): real;
   103 function DxDy2Angle32(const _dY, _dX: Extended): integer;
   103 function DxDy2Angle32(const _dY, _dX: Extended): integer;
   104 procedure AdjustColor(var Color: Longword);
   104 procedure AdjustColor(var Color: Longword);
   105 {$IFDEF DEBUGFILE}
   105 {$IFDEF DEBUGFILE}
   106 procedure AddFileLog(s: shortstring);
   106 procedure AddFileLog(s: shortstring);
       
   107 function RectToStr(Rect: TSDL_Rect): shortstring;
   107 {$ENDIF}
   108 {$ENDIF}
   108 
   109 
   109 var CursorPoint: TPoint;
   110 var CursorPoint: TPoint;
   110     TargetPoint: TPoint = (X: NoPointX; Y: 0);
   111     TargetPoint: TPoint = (X: NoPointX; Y: 0);
   111 
   112 
   136 {$IFDEF DEBUGFILE}AddFileLog(Msg);{$ENDIF}
   137 {$IFDEF DEBUGFILE}AddFileLog(Msg);{$ENDIF}
   137 if isFatalError then
   138 if isFatalError then
   138    begin
   139    begin
   139    WriteLn(Msg);
   140    WriteLn(Msg);
   140    SDL_Quit;
   141    SDL_Quit;
   141    Readln;
   142 //   Readln;
   142    halt(1)
   143    halt(1)
   143    end else WriteLnToConsole(Msg)
   144    end else WriteLnToConsole(Msg)
   144 end;
   145 end;
   145 
   146 
   146 procedure TryDo(Assert: boolean; Msg: string; isFatal: boolean);
   147 procedure TryDo(Assert: boolean; Msg: string; isFatal: boolean);
   197 begin
   198 begin
   198 writeln(f, GameTicks: 6, ': ', s);
   199 writeln(f, GameTicks: 6, ': ', s);
   199 flush(f)
   200 flush(f)
   200 end;
   201 end;
   201 
   202 
       
   203 function RectToStr(Rect: TSDL_Rect): shortstring;
       
   204 begin
       
   205 Result:= '(x: ' + inttostr(rect.x) + '; y: ' + inttostr(rect.y) + '; w: ' + inttostr(rect.w) + '; h: ' + inttostr(rect.h) + ')'
       
   206 end;
       
   207 
   202 initialization
   208 initialization
   203 assignfile(f, 'debug.txt');
   209 assignfile(f, 'debug.txt');
   204 rewrite(f);
   210 rewrite(f);
   205 
   211 
   206 finalization
   212 finalization