hedgewars/uGearsUtils.pas
changeset 7614 3ae60c8a15f2
parent 7603 e9c3c67b5dfd
child 7625 5c0ad64afc8d
equal deleted inserted replaced
7612:047c6692a2e7 7614:3ae60c8a15f2
   319 
   319 
   320 procedure CalcRotationDirAngle(Gear: PGear);
   320 procedure CalcRotationDirAngle(Gear: PGear);
   321 var 
   321 var 
   322     dAngle: real;
   322     dAngle: real;
   323 begin
   323 begin
   324     dAngle := (Gear^.dX.QWordValue + Gear^.dY.QWordValue) / $80000000;
   324 // Frac/Round to be kind to JS as of 2012-08-27 where there is yet no int64/uint64
       
   325     dAngle := (Gear^.dX.Round + Gear^.dY.Round) / 2 + (Gear^.dX.Frac+Gear^.dY.Frac) / $80000000;
   325     if not Gear^.dX.isNegative then
   326     if not Gear^.dX.isNegative then
   326         Gear^.DirAngle := Gear^.DirAngle + dAngle
   327         Gear^.DirAngle := Gear^.DirAngle + dAngle
   327     else
   328     else
   328         Gear^.DirAngle := Gear^.DirAngle - dAngle;
   329         Gear^.DirAngle := Gear^.DirAngle - dAngle;
   329 
   330