Fix clouds shaking up
authorunc0rr
Sun, 13 Jul 2008 17:58:05 +0000
changeset 1079 2a4a8a5ca392
parent 1078 8f891269392f
child 1080 8735046fc698
Fix clouds shaking up
hedgewars/uVisualGears.pas
--- a/hedgewars/uVisualGears.pas	Sun Jul 13 11:39:02 2008 +0000
+++ b/hedgewars/uVisualGears.pas	Sun Jul 13 17:58:05 2008 +0000
@@ -76,12 +76,19 @@
 end;
 
 procedure doStepCloud(Gear: PVisualGear; Steps: Longword);
+var i: Longword;
 begin
 Gear^.X:= Gear^.X + (cWindSpeed * 200 + Gear^.dX) * Steps;
-if hwRound(Gear^.Y) > -160 then Gear^.dY:= Gear^.dY - _1div50000 * Steps
-                           else Gear^.dY:= Gear^.dY + _1div50000 * Steps;
 
-Gear^.Y:= Gear^.Y + Gear^.dY * Steps;
+for i:= 0 to Steps - 1 do
+	begin
+	if hwRound(Gear^.Y) > -160 then
+		Gear^.dY:= Gear^.dY - _1div50000
+	else
+		Gear^.dY:= Gear^.dY + _1div50000;
+
+	Gear^.Y:= Gear^.Y + Gear^.dY
+	end;
 
 if hwRound(Gear^.X) < -cScreenWidth - 256 then Gear^.X:= int2hwFloat(cScreenWidth + 2048) else
 if hwRound(Gear^.X) > cScreenWidth + 2048 then Gear^.X:= int2hwFloat(-cScreenWidth - 256)
@@ -250,7 +257,7 @@
 var i: LongInt;
 begin
 for i:= 0 to cCloudsNumber do
-    AddVisualGear( - cScreenWidth + i * ((cScreenWidth * 2 + 2304) div cCloudsNumber), -140, vgtCloud)
+    AddVisualGear( - cScreenWidth + i * ((cScreenWidth * 2 + 2304) div cCloudsNumber), -160, vgtCloud)
 end;
 
 initialization