hedgewars/GSHandlers.inc
changeset 6787 8a4cd042d191
parent 6786 f631b8350b53
child 6792 f72c8b5d421c
equal deleted inserted replaced
6786:f631b8350b53 6787:8a4cd042d191
  4270             inc(iterator^.PortalCounter);
  4270             inc(iterator^.PortalCounter);
  4271             iterator^.State:= iterator^.State and (not gstHHHJump)
  4271             iterator^.State:= iterator^.State and (not gstHHHJump)
  4272             end;
  4272             end;
  4273 
  4273 
  4274         // is it worth adding an arcsin table?  Just how often would we end up doing something like this?
  4274         // is it worth adding an arcsin table?  Just how often would we end up doing something like this?
       
  4275         // SYNCED ANGLE UPDATE
  4275         if iterator^.Kind = gtRCPlane then
  4276         if iterator^.Kind = gtRCPlane then
  4276             begin
  4277             begin
  4277             // recycling as temp vars
  4278             // recycling as temp vars
  4278             resety.isNegative:= false;
  4279             resety.isNegative:= false;
  4279             resety.QWordValue:= 4294967296 * 112;
  4280             resety.QWordValue:= 4294967296 * 112;
  4283             resetdx.QWordValue:= 4294967296 * 1152;
  4284             resetdx.QWordValue:= 4294967296 * 1152;
  4284     
  4285     
  4285             resetdy:=hwAbs(iterator^.dX*4);
  4286             resetdy:=hwAbs(iterator^.dX*4);
  4286             resetdy:= resetdy + hwPow(resetdy,3)/_6 + _3 * hwPow(resetdy,5) / _40 + _5 * hwPow(resetdy,7) / resety + resetx * hwPow(resetdy,9) / resetdx;
  4287             resetdy:= resetdy + hwPow(resetdy,3)/_6 + _3 * hwPow(resetdy,5) / _40 + _5 * hwPow(resetdy,7) / resety + resetx * hwPow(resetdy,9) / resetdx;
  4287             iterator^.Angle:= hwRound(resetdy*_2048 / _PI);
  4288             iterator^.Angle:= hwRound(resetdy*_2048 / _PI);
  4288             if not iterator^.dY.isNegative then iterator^.Angle:= 2048-iterator^.Angle;
  4289             end
       
  4290         // VISUAL USE OF ANGLE ONLY
       
  4291         else if (CurAmmoGear <> nil) and (CurAmmoGear^.Kind = gtKamikaze) and (CurAmmoGear^.Hedgehog = iterator^.Hedgehog) then
       
  4292             begin
       
  4293             iterator^.Angle:= DxDy2AttackAngle(iterator^.dX, iterator^.dY);
       
  4294             iterator^.Angle:= 2048-iterator^.Angle;
  4289             if iterator^.dX.isNegative then iterator^.Angle:= 4096-iterator^.Angle;
  4295             if iterator^.dX.isNegative then iterator^.Angle:= 4096-iterator^.Angle;
  4290             
       
  4291             end;
  4296             end;
  4292 
  4297 
  4293         if (CurrentHedgehog <> nil) and (CurrentHedgehog^.Gear <> nil)
  4298         if (CurrentHedgehog <> nil) and (CurrentHedgehog^.Gear <> nil)
  4294         and (iterator = CurrentHedgehog^.Gear)
  4299         and (iterator = CurrentHedgehog^.Gear)
  4295         and (CurAmmoGear <> nil)
  4300         and (CurAmmoGear <> nil)