GetRandom -> GetRandomf
authorunc0rr
Wed, 02 May 2012 22:12:58 +0400
changeset 7001 89488f5b99ca
parent 7000 d22633829ac8
child 7002 5d817ba976f7
GetRandom -> GetRandomf
hedgewars/GSHandlers.inc
hedgewars/uGearsList.pas
hedgewars/uRandom.pas
hedgewars/uTeams.pas
--- a/hedgewars/GSHandlers.inc	Wed May 02 19:36:23 2012 +0200
+++ b/hedgewars/GSHandlers.inc	Wed May 02 22:12:58 2012 +0400
@@ -345,8 +345,8 @@
                 doMakeExplosion(x, y, 20, Gear^.Hedgehog, EXPLAutoSound);
                 for i:= 0 to 4 do
                     begin
-                    dX := rndSign(GetRandom * _0_1) + Gear^.dX / 5;
-                    dY := (GetRandom - _3) * _0_08;
+                    dX := rndSign(GetRandomf * _0_1) + Gear^.dX / 5;
+                    dY := (GetRandomf - _3) * _0_08;
                     FollowGear := AddGear(x, y, gtCluster, 0, dX, dY, 25)
                     end
                 end;
@@ -357,8 +357,8 @@
                 doMakeExplosion(x, y, 75, Gear^.Hedgehog, EXPLAutoSound);
                 for i:= 0 to 5 do
                     begin
-                    dX := rndSign(GetRandom * _0_1) + Gear^.dX / 5;
-                    dY := (GetRandom - _1_5) * _0_3;
+                    dX := rndSign(GetRandomf * _0_1) + Gear^.dX / 5;
+                    dY := (GetRandomf - _1_5) * _0_3;
                     FollowGear:= AddGear(x, y, gtMelonPiece, 0, dX, dY, 75);
                     FollowGear^.DirAngle := i * 60
                     end
@@ -371,8 +371,8 @@
 
                 for i:= 0 to 127 do
                     begin
-                    dX := AngleCos(i * 16) * _0_5 * (GetRandom + _1);
-                    dY := AngleSin(i * 16) * _0_5 * (GetRandom + _1);
+                    dX := AngleCos(i * 16) * _0_5 * (GetRandomf + _1);
+                    dY := AngleSin(i * 16) * _0_5 * (GetRandomf + _1);
                     if i mod 2 = 0 then
                         begin
                         AddGear(x, y, gtFlame, gstTmpFlag, dX, dY, 0);
@@ -477,8 +477,8 @@
             end;
         for i:= 0 to 24 do
             begin
-            dX := AngleCos(i * 2) * ((_0_15*(i div 5))) * (GetRandom + _1);
-            dY := AngleSin(i * 8) * _0_5 * (GetRandom + _1);
+            dX := AngleCos(i * 2) * ((_0_15*(i div 5))) * (GetRandomf + _1);
+            dY := AngleSin(i * 8) * _0_5 * (GetRandomf + _1);
             AddGear(gX, gY, gtFlame, gstTmpFlag, dX, dY, 0);
             AddGear(gX, gY, gtFlame, gstTmpFlag, dX,-dY, 0);
             AddGear(gX, gY, gtFlame, gstTmpFlag,-dX, dY, 0);
@@ -2130,8 +2130,8 @@
                 doMakeExplosion(x, y, 75, hog, EXPLAutoSound);
                 for i:= 0 to 31 do
                     begin
-                    dX := AngleCos(i * 64) * _0_5 * (getrandom + _1);
-                    dY := AngleSin(i * 64) * _0_5 * (getrandom + _1);
+                    dX := AngleCos(i * 64) * _0_5 * (getrandomf + _1);
+                    dY := AngleSin(i * 64) * _0_5 * (getrandomf + _1);
                     AddGear(x, y, gtFlame, 0, dX, dY, 0);
                     AddGear(x, y, gtFlame, gstTmpFlag, -dX, -dY, 0);
                     end
@@ -2800,8 +2800,8 @@
         Gear^.dY.isNegative := not dyn;
         for i:= 0 to 4 do
             begin
-            dX := Gear^.dX + (GetRandom - _0_5) * _0_03;
-            dY := Gear^.dY + (GetRandom - _0_5) * _0_03;
+            dX := Gear^.dX + (GetRandomf - _0_5) * _0_03;
+            dY := Gear^.dY + (GetRandomf - _0_5) * _0_03;
             AddGear(hwRound(Gear^.X), hwRound(Gear^.Y), gtCluster, 0, dX, dY, 25);
             end;
 
@@ -3414,8 +3414,8 @@
     gY := hwRound(Gear^.Y) + GetLaunchY(amBallgun, HHGear^.Angle);
     if (Gear^.Timer mod 100) = 0 then
         begin
-        rx := rndSign(getRandom * _0_1);
-        ry := rndSign(getRandom * _0_1);
+        rx := rndSign(getRandomf * _0_1);
+        ry := rndSign(getRandomf * _0_1);
 
         AddGear(gx, gy, gtBall, 0, SignAs(AngleSin(HHGear^.Angle) * _0_8, HHGear^.dX) + rx, AngleCos(HHGear^.Angle) * ( - _0_8) + ry, 0);
 
@@ -3538,8 +3538,8 @@
             doMakeExplosion(hwRound(Gear^.X), hwRound(Gear^.Y), 25, Gear^.Hedgehog, EXPLAutoSound);
             for i:= 0 to 15 do
                 begin
-                dX := AngleCos(i * 64) * _0_5 * (GetRandom + _1);
-                dY := AngleSin(i * 64) * _0_5 * (GetRandom + _1);
+                dX := AngleCos(i * 64) * _0_5 * (GetRandomf + _1);
+                dY := AngleSin(i * 64) * _0_5 * (GetRandomf + _1);
                 AddGear(hwRound(Gear^.X), hwRound(Gear^.Y), gtFlame, 0, dX, dY, 0);
                 AddGear(hwRound(Gear^.X), hwRound(Gear^.Y), gtFlame, 0, dX, -dY, 0);
                 end;
@@ -4754,8 +4754,8 @@
         dec(Gear^.Health);
         if (Gear^.Health mod 5) = 0 then
             begin
-            rx := rndSign(getRandom * _0_1);
-            ry := rndSign(getRandom * _0_1);
+            rx := rndSign(getRandomf * _0_1);
+            ry := rndSign(getRandomf * _0_1);
             speed := _0_5 * (_10 / Gear^.Tag);
     
             AddGear(gx, gy, gtFlame, gstTmpFlag,
@@ -4834,8 +4834,8 @@
         begin
         dec(Gear^.Health);
 
-        rx := rndSign(getRandom * _0_1);
-        ry := rndSign(getRandom * _0_1);
+        rx := rndSign(getRandomf * _0_1);
+        ry := rndSign(getRandomf * _0_1);
         speed := (_3 / Gear^.Tag);
 
         AddGear(gx, gy, gtFlake, gstTmpFlag, 
@@ -5146,8 +5146,8 @@
         gY := hwRound(Gear^.Y); 
         for i:= 0 to 10 do
         begin
-            dX := AngleCos(i * 2) * ((_0_1*(i div 5))) * (GetRandom + _1);
-            dY := AngleSin(i * 8) * _0_5 * (GetRandom + _1);
+            dX := AngleCos(i * 2) * ((_0_1*(i div 5))) * (GetRandomf + _1);
+            dY := AngleSin(i * 8) * _0_5 * (GetRandomf + _1);
             AddGear(gX, gY, gtFlame, 0, dX, dY, 0);
             AddGear(gX, gY, gtFlame, 0, dX, -dY, 0);
             AddGear(gX, gY, gtFlame, 0, -dX, dY, 0);
--- a/hedgewars/uGearsList.pas	Wed May 02 19:36:23 2012 +0200
+++ b/hedgewars/uGearsList.pas	Wed May 02 22:12:58 2012 +0400
@@ -284,8 +284,8 @@
                 gear^.Density:= _1;
                 if (gear^.dY.QWordValue = 0) and (gear^.dX.QWordValue = 0) then
                     begin
-                    gear^.dY:= (getrandom - _0_8) * _0_03;
-                    gear^.dX:= (getrandom - _0_5) * _0_4
+                    gear^.dY:= (getrandomf - _0_8) * _0_03;
+                    gear^.dX:= (getrandomf - _0_5) * _0_4
                     end
                 end;
    gtFirePunch: begin
--- a/hedgewars/uRandom.pas	Wed May 02 19:36:23 2012 +0200
+++ b/hedgewars/uRandom.pas	Wed May 02 22:12:58 2012 +0400
@@ -35,7 +35,7 @@
 procedure freeModule;
 
 procedure SetRandomSeed(Seed: shortstring); // Sets the seed that should be used for generating pseudo-random values.
-function  GetRandom: hwFloat; overload; // Returns a pseudo-random hwFloat.
+function  GetRandomf: hwFloat; overload; // Returns a pseudo-random hwFloat.
 function  GetRandom(m: LongWord): LongWord; overload; // Returns a positive pseudo-random integer smaller than m.
 function  rndSign(num: hwFloat): hwFloat; // Returns num with a random chance of having a inverted sign.
 
@@ -73,11 +73,11 @@
     GetNext
 end;
 
-function GetRandom: hwFloat;
+function GetRandomf: hwFloat;
 begin
 GetNext;
-GetRandom.isNegative:= false;
-GetRandom.QWordValue:= GetNext
+GetRandomf.isNegative:= false;
+GetRandomf.QWordValue:= GetNext
 end;
 
 function GetRandom(m: LongWord): LongWord;
--- a/hedgewars/uTeams.pas	Wed May 02 19:36:23 2012 +0200
+++ b/hedgewars/uTeams.pas	Wed May 02 22:12:58 2012 +0400
@@ -250,7 +250,7 @@
 
 if (GameFlags and gfDisableWind) = 0 then
     begin
-    cWindSpeed:= rndSign(GetRandom * 2 * cMaxWindSpeed);
+    cWindSpeed:= rndSign(GetRandomf * 2 * cMaxWindSpeed);
     w:= hwFloat2Float(cWindSpeed);
     vg:= AddVisualGear(0, 0, vgtSmoothWindBar);
     if vg <> nil then vg^.dAngle:= w;