hedgewars/uGearsUtils.pas
changeset 12735 83d62800d215
parent 12712 31f7e0a31736
child 12737 d08afea02908
--- a/hedgewars/uGearsUtils.pas	Sat Oct 21 23:27:58 2017 +0200
+++ b/hedgewars/uGearsUtils.pas	Sat Oct 21 23:59:31 2017 +0200
@@ -57,7 +57,6 @@
 function  GetUtility(Hedgehog: PHedgehog): TAmmoType;
 
 function WorldWrap(var Gear: PGear): boolean;
-function CalcWorldWrap(X, radius: LongInt): LongInt;
 
 function IsHogLocal(HH: PHedgehog): boolean;
 
@@ -1629,27 +1628,6 @@
     end;
 end;
 
-// Takes an X coordinate and corrects if according to the world edge rules
-// Wrap-around: X will be wrapped
-// Bouncy: X will be kept inside the legal land (taking radius into account)
-// Other world edges: Just returns X
-// radius is a radius (gear radius) tolerance for an appropriate distance from bouncy world edges.
-// Set radius to 0 if you don't care.
-function CalcWorldWrap(X, radius: LongInt): LongInt;
-begin
-    if WorldEdge = weWrap then
-        if X < LongInt(leftX) then
-             X:= X + (LongInt(rightX) - LongInt(leftX))
-        else if X > LongInt(rightX) then
-             X:= X - (LongInt(rightX) - LongInt(leftX))
-    else if WorldEdge = weBounce then
-        if X - radius < LongInt(leftX) then
-            X:= LongInt(leftX) + radius
-        else if X + radius > LongInt(rightX) then
-            X:= LongInt(rightX) - radius;
-    CalcWorldWrap:= X;
-end;
-
 procedure AddBounceEffectForGear(Gear: PGear);
 var boing: PVisualGear;
 begin