hedgewars/uGearsUtils.pas
changeset 14574 6e5cda26f676
parent 14572 34e810295d08
child 14749 533ac9774279
equal deleted inserted replaced
14573:9be988a01565 14574:6e5cda26f676
  1763             bounced:= true;
  1763             bounced:= true;
  1764             end;
  1764             end;
  1765         if (bounced) then
  1765         if (bounced) then
  1766             begin
  1766             begin
  1767             WorldWrap:= true;
  1767             WorldWrap:= true;
  1768             if (Gear^.Radius > 2) and (Gear^.dX.QWordValue > _0_001.QWordValue) then
  1768             if (Gear^.dX.QWordValue > _0_001.QWordValue) then
  1769                AddBounceEffectForGear(Gear);
  1769                AddBounceEffectForGear(Gear);
  1770             end;
  1770             end;
  1771         end
  1771         end
  1772     else
  1772     else
  1773         WorldWrap:= true;
  1773         WorldWrap:= true;
  1825 
  1825 
  1826 // Same as above, but can specify the size of bounce image with imageScale manually.
  1826 // Same as above, but can specify the size of bounce image with imageScale manually.
  1827 procedure AddBounceEffectForGear(Gear: PGear; imageScale: Single);
  1827 procedure AddBounceEffectForGear(Gear: PGear; imageScale: Single);
  1828 var boing: PVisualGear;
  1828 var boing: PVisualGear;
  1829 begin
  1829 begin
  1830     if Gear^.Density < _0_01 then
  1830     if (Gear^.Density < _0_01) or (Gear^.Radius < 2) then
  1831         exit;
  1831         exit;
  1832     boing:= AddVisualGear(hwRound(Gear^.X), hwRound(Gear^.Y), vgtStraightShot, 0, false, 1);
  1832     boing:= AddVisualGear(hwRound(Gear^.X), hwRound(Gear^.Y), vgtStraightShot, 0, false, 1);
  1833     if boing <> nil then
  1833     if boing <> nil then
  1834         with boing^ do
  1834         with boing^ do
  1835             begin
  1835             begin