# HG changeset patch # User sheepluva # Date 1277785679 -7200 # Node ID 7c05f2e0a8b53da585e723f1ca90455c97c04a38 # Parent 13818670ad9e8036fdf2a6c3a3186ca789eefae7 rope: another small optimization diff -r 13818670ad9e -r 7c05f2e0a8b5 hedgewars/GSHandlers.inc --- a/hedgewars/GSHandlers.inc Tue Jun 29 05:22:25 2010 +0200 +++ b/hedgewars/GSHandlers.inc Tue Jun 29 06:27:59 2010 +0200 @@ -1153,10 +1153,6 @@ haveDivided := false; // check whether rope needs dividing - len := _1 / Distance(ropeDx, ropeDy); - // old rope pos - nx := ropeDx * len; - ny := ropeDy * len; len := Gear^.Elasticity - _5; while len > _3 do @@ -1166,6 +1162,15 @@ if ((ly and LAND_HEIGHT_MASK) = 0) and ((lx and LAND_WIDTH_MASK) = 0) and (Land[ly, lx] <> 0 ) then begin + // calculate those the first time we have to divide the rope + if not haveDivided then + begin + ny := _1 / Distance(ropeDx, ropeDy); + // old rope pos + nx := ropeDx * ny; + ny := ropeDy * ny; + end; + with RopePoints.ar[RopePoints.Count] do begin X := Gear^.X; diff -r 13818670ad9e -r 7c05f2e0a8b5 hedgewars/uFloat.pas --- a/hedgewars/uFloat.pas Tue Jun 29 05:22:25 2010 +0200 +++ b/hedgewars/uFloat.pas Tue Jun 29 06:27:59 2010 +0200 @@ -108,10 +108,10 @@ _0_96: hwFloat = (isNegative: false; QWordValue: 4123168604); _0_995: hwFloat = (isNegative: false; QWordValue: 4273492459); _0_999: hwFloat = (isNegative: false; QWordValue: 4290672328); - _1_9: hwFloat = (isNegative: false; QWordValue: 8160437862); _0: hwFloat = (isNegative: false; QWordValue: 0); _1: hwFloat = (isNegative: false; QWordValue: 4294967296); _1_5: hwFloat = (isNegative: false; QWordValue: 4294967296 * 3 div 2); + _1_9: hwFloat = (isNegative: false; QWordValue: 8160437862); _2: hwFloat = (isNegative: false; QWordValue: 4294967296 * 2); _3: hwFloat = (isNegative: false; QWordValue: 4294967296 * 3); _4: hwFloat = (isNegative: false; QWordValue: 4294967296 * 4);