hedgewars/uUtils.pas
changeset 7548 c7a21fc530de
parent 7547 6e9c5feb88eb
child 7565 00568d3054d0
equal deleted inserted replaced
7547:6e9c5feb88eb 7548:c7a21fc530de
    41 
    41 
    42 function  IntToStr(n: LongInt): shortstring;
    42 function  IntToStr(n: LongInt): shortstring;
    43 function  StrToInt(s: shortstring): LongInt;
    43 function  StrToInt(s: shortstring): LongInt;
    44 function  FloatToStr(n: hwFloat): shortstring;
    44 function  FloatToStr(n: hwFloat): shortstring;
    45 
    45 
    46 function  DxDy2Angle(const _dY, _dX: hwFloat): GLfloat;
    46 function  DxDy2Angle(const _dY, _dX: hwFloat): GLfloat; inline;
    47 function  DxDy2Angle32(const _dY, _dX: hwFloat): LongInt;
    47 function  DxDy2Angle32(const _dY, _dX: hwFloat): LongInt;
    48 function  DxDy2AttackAngle(const _dY, _dX: hwFloat): LongInt;
    48 function  DxDy2AttackAngle(const _dY, _dX: hwFloat): LongInt;
    49 function  DxDy2AttackAnglef(const _dY, _dX: extended): LongInt;
    49 function  DxDy2AttackAnglef(const _dY, _dX: extended): LongInt;
    50 
    50 
    51 procedure SetLittle(var r: hwFloat);
    51 procedure SetLittle(var r: hwFloat);
   180 begin
   180 begin
   181 FloatToStr:= cstr(n) + '_' + inttostr(Lo(n.QWordValue))
   181 FloatToStr:= cstr(n) + '_' + inttostr(Lo(n.QWordValue))
   182 end;
   182 end;
   183 
   183 
   184 
   184 
   185 function DxDy2Angle(const _dY, _dX: hwFloat): GLfloat;
   185 function DxDy2Angle(const _dY, _dX: hwFloat): GLfloat; inline;
   186 var dY, dX: Extended;
   186 var dY, dX: Extended;
   187 begin
   187 begin
   188 dY:= hwFloat2Float(_dY);
   188 dY:= hwFloat2Float(_dY);
   189 dX:= hwFloat2Float(_dX);
   189 dX:= hwFloat2Float(_dX);
   190 DxDy2Angle:= arctan2(dY, dX) * 180 / pi
   190 DxDy2Angle:= arctan2(dY, dX) * 180 / pi