Remove some unused variables and options.inc which uFloat doesn't use, probably should never use, and was getting in the way of my testcase - but most importantly, remove the inline on hwSqrt which was causing very bad math on my compiler/machine. We may have to remove more inlining. A pity.
authornemo
Fri, 09 Sep 2011 18:30:40 -0400
changeset 5832 f730c8a9777b
parent 5831 80f2a44becea
child 5833 d0c742472d46
Remove some unused variables and options.inc which uFloat doesn't use, probably should never use, and was getting in the way of my testcase - but most importantly, remove the inline on hwSqrt which was causing very bad math on my compiler/machine. We may have to remove more inlining. A pity.
hedgewars/HHHandlers.inc
hedgewars/uFloat.pas
hedgewars/uLand.pas
hedgewars/uLandGraphics.pas
hedgewars/uLandObjects.pas
hedgewars/uTeams.pas
hedgewars/uVisualGears.pas
--- a/hedgewars/HHHandlers.inc	Fri Sep 09 21:31:39 2011 +0200
+++ b/hedgewars/HHHandlers.inc	Fri Sep 09 18:30:40 2011 -0400
@@ -1036,7 +1036,7 @@
 
 ////////////////////////////////////////////////////////////////////////////////
 procedure doStepHedgehogFree(Gear: PGear);
-var prevState,i: Longword;
+var prevState: Longword;
 begin
 prevState:= Gear^.State;
 
--- a/hedgewars/uFloat.pas	Fri Sep 09 21:31:39 2011 +0200
+++ b/hedgewars/uFloat.pas	Fri Sep 09 18:30:40 2011 -0400
@@ -16,8 +16,6 @@
  * Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA
  *)
 
-{$INCLUDE "options.inc"}
-
 unit uFloat;
 (*
  * This unit provides a custom data type, hwFloat.
@@ -81,7 +79,7 @@
 function hwRound(const t: hwFloat): LongInt; inline; // Does NOT really round but returns the integer representation of the hwFloat without fractional digits. (-_0_9 -> -0, _1_5 -> _1)
 function hwAbs(const t: hwFloat): hwFloat; inline; // Returns the value of t with positive sign.
 function hwSqr(const t: hwFloat): hwFloat; inline; // Returns the square value of parameter t.
-function hwSqrt(const t: hwFloat): hwFloat; inline; // Returns the the positive square root of parameter t.
+function hwSqrt(const t: hwFloat): hwFloat; // Returns the the positive square root of parameter t.
 function Distance(const dx, dy: hwFloat): hwFloat; // Returns the distance between two points in 2-dimensional space, of which the parameters are the horizontal and vertical distance.
 function DistanceI(const dx, dy: LongInt): hwFloat; // Same as above for integer parameters.
 function AngleSin(const Angle: Longword): hwFloat;
--- a/hedgewars/uLand.pas	Fri Sep 09 21:31:39 2011 +0200
+++ b/hedgewars/uLand.pas	Fri Sep 09 18:30:40 2011 -0400
@@ -1229,7 +1229,7 @@
 end;
 
 procedure DrawBottomBorder; // broken out from other borders for doing a floor-only map, or possibly updating bottom during SD
-var x, y, w, c: Longword;
+var x, w, c: Longword;
 begin
 for w:= 0 to 23 do
     for x:= leftX to rightX do
--- a/hedgewars/uLandGraphics.pas	Fri Sep 09 21:31:39 2011 +0200
+++ b/hedgewars/uLandGraphics.pas	Fri Sep 09 18:30:40 2011 -0400
@@ -832,6 +832,7 @@
 begin
 bRes:= false;
 reCheck:= true;
+d:= 0;
 
 while recheck do
     begin
--- a/hedgewars/uLandObjects.pas	Fri Sep 09 21:31:39 2011 +0200
+++ b/hedgewars/uLandObjects.pas	Fri Sep 09 18:30:40 2011 -0400
@@ -373,7 +373,7 @@
     f: textfile;
     i: LongInt;
     ii, t: Longword;
-    c1, c2: TSDL_Color;
+    c2: TSDL_Color;
 
     procedure CheckRect(Width, Height, x, y, w, h: LongWord);
     begin
--- a/hedgewars/uTeams.pas	Fri Sep 09 21:31:39 2011 +0200
+++ b/hedgewars/uTeams.pas	Fri Sep 09 18:30:40 2011 -0400
@@ -524,7 +524,7 @@
 end;
 
 procedure chTeamGone(var s:shortstring);
-var t, i: LongInt;
+var t: LongInt;
 begin
 t:= 0;
 while (t < cMaxTeams)
--- a/hedgewars/uVisualGears.pas	Fri Sep 09 21:31:39 2011 +0200
+++ b/hedgewars/uVisualGears.pas	Fri Sep 09 18:30:40 2011 -0400
@@ -29,7 +29,7 @@
  * E.g.: background flakes, visual effects: explosion, smoke trails, etc.
  *)
 interface
-uses uConsts, uFloat, GLunit, uTypes, uWorld;
+uses uConsts, uFloat, GLunit, uTypes;
 
 procedure initModule;
 procedure freeModule;