Small rope optimization
authorunc0rr
Wed, 15 Oct 2008 17:00:35 +0000
changeset 1361 afdcf39c6bea
parent 1360 d3e285281c26
child 1362 6298e9dbd33c
Small rope optimization
hedgewars/GSHandlers.inc
--- a/hedgewars/GSHandlers.inc	Wed Oct 15 16:59:11 2008 +0000
+++ b/hedgewars/GSHandlers.inc	Wed Oct 15 17:00:35 2008 +0000
@@ -649,8 +649,8 @@
 cc:= cc * len; // rope vector plus hedgehog direction vector normalized
 cs:= cs * len;
 
-nx:= hwAbs(cs) * hwSign(HHGear^.dX) * 7; // hedgehog direction normalized with length 7
-ny:= hwAbs(cc) * hwSign(HHGear^.dY) * 7;
+nx:= SignAs(cs, HHGear^.dX) * 7; // hedgehog direction normalized with length 7
+ny:= SignAs(cc, HHGear^.dY) * 7;
 
 flCheck:= not flCheck;
 if flCheck then  // check whether rope needs dividing
@@ -680,7 +680,7 @@
            Gear^.Friction:= Gear^.Friction - len;
            break
            end;
-         len:= len - _0_2
+         len:= len - _0_5
          end;
    end else
    if RopePoints.Count > 0 then // check whether the last dividing point could be removed