Clouds fixes by nemo
authorunc0rr
Tue, 17 Feb 2009 12:58:08 +0000
changeset 1801 bc0c5c21376e
parent 1800 f1df2eb32a16
child 1802 dd148e2506e2
Clouds fixes by nemo
hedgewars/uLandObjects.pas
hedgewars/uVisualGears.pas
--- a/hedgewars/uLandObjects.pas	Sun Feb 15 20:29:52 2009 +0000
+++ b/hedgewars/uLandObjects.pas	Tue Feb 17 12:58:08 2009 +0000
@@ -376,6 +376,9 @@
 
 ReadLn(f, cCloudsNumber);
 
+// TODO - adjust all the theme cloud numbers. This should not be a permanent fix
+cCloudsNumber:= cCloudsNumber * (LAND_WIDTH div 2048);
+
 Readln(f, ThemeObjects.Count);
 for i:= 0 to Pred(ThemeObjects.Count) do
 	begin
--- a/hedgewars/uVisualGears.pas	Sun Feb 15 20:29:52 2009 +0000
+++ b/hedgewars/uVisualGears.pas	Tue Feb 17 12:58:08 2009 +0000
@@ -109,7 +109,7 @@
 	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 - 256 then Gear^.X:= int2hwFloat(cScreenWidth + LAND_WIDTH) else
 if hwRound(Gear^.X) > cScreenWidth + LAND_WIDTH then Gear^.X:= int2hwFloat(-cScreenWidth - 256)
 end;
 
@@ -298,7 +298,7 @@
 var i: LongInt;
 begin
 for i:= 0 to cCloudsNumber - 1 do
-    AddVisualGear( - cScreenWidth + i * ((cScreenWidth * 2 + 2304) div (cCloudsNumber + 1)), LAND_HEIGHT-1184, vgtCloud)
+    AddVisualGear( - cScreenWidth + i * ((cScreenWidth * 2 + (LAND_WIDTH+256)) div (cCloudsNumber + 1)), LAND_HEIGHT-1184, vgtCloud)
 end;
 
 initialization