Poor visual gear value in theme now bears little resemblance to the number of gears actually spawned. But, it certainly shouldn't be related to LAND_WIDTH.
authornemo
Wed, 15 Aug 2012 16:54:49 -0400
changeset 7543 a0dc770538e1
parent 7541 e51b11349637
child 7545 063601290761
Poor visual gear value in theme now bears little resemblance to the number of gears actually spawned. But, it certainly shouldn't be related to LAND_WIDTH.
hedgewars/uLandObjects.pas
hedgewars/uVisualGears.pas
--- a/hedgewars/uLandObjects.pas	Wed Aug 15 23:30:23 2012 +0400
+++ b/hedgewars/uLandObjects.pas	Wed Aug 15 16:54:49 2012 -0400
@@ -554,7 +554,7 @@
         SetMusicName(Trim(s))
     else if key = 'clouds' then
         begin
-        cCloudsNumber:= Word(StrToInt(Trim(s))) * cScreenSpace div LAND_WIDTH;
+        cCloudsNumber:= Word(StrToInt(Trim(s))) * cScreenSpace div 4096;
         cSDCloudsNumber:= cCloudsNumber
         end
     else if key = 'object' then
@@ -700,7 +700,7 @@
     else if key = 'sd-water-opacity' then
         SDWaterOpacity:= StrToInt(Trim(s))
     else if key = 'sd-clouds' then
-        cSDCloudsNumber:= Word(StrToInt(Trim(s))) * cScreenSpace div LAND_WIDTH
+        cSDCloudsNumber:= Word(StrToInt(Trim(s))) * cScreenSpace div 4096
     else if key = 'sd-flakes' then
         begin
         i:= Pos(',', s);
--- a/hedgewars/uVisualGears.pas	Wed Aug 15 23:30:23 2012 +0400
+++ b/hedgewars/uVisualGears.pas	Wed Aug 15 16:54:49 2012 -0400
@@ -958,10 +958,10 @@
     exit;
 
 if hasBorder or ((Theme <> 'Snow') and (Theme <> 'Christmas')) then
-    for i:= 0 to Pred(vobCount * cScreenSpace div LAND_WIDTH) do
+    for i:= 0 to Pred(vobCount * cScreenSpace div 4096) do
         AddVisualGear(cLeftScreenBorder + random(cScreenSpace), random(1024+200) - 100 + LAND_HEIGHT, vgtFlake)
 else
-    for i:= 0 to Pred((vobCount * cScreenSpace div LAND_WIDTH) div 3) do
+    for i:= 0 to Pred((vobCount * cScreenSpace div 4096) div 3) do
         AddVisualGear(cLeftScreenBorder + random(cScreenSpace), random(1024+200) - 100 + LAND_HEIGHT, vgtFlake);
 end;