Try to handle negative gravity w/ snow. Still needs to look nicer. Currently causes banding.
authornemo
Thu, 01 Jan 2015 12:43:00 -0500
changeset 10736 5b7cf9fcb47e
parent 10734 8fadc4305df0
child 10738 62659c427e5d
Try to handle negative gravity w/ snow. Still needs to look nicer. Currently causes banding.
hedgewars/uGearsHandlersMess.pas
--- a/hedgewars/uGearsHandlersMess.pas	Tue Dec 30 23:31:00 2014 +0300
+++ b/hedgewars/uGearsHandlersMess.pas	Thu Jan 01 12:43:00 2015 -0500
@@ -804,6 +804,8 @@
             move:= true
         else if (xx > snowRight) or (xx < snowLeft) then
             move:=true
+        else if (cGravity < _0) and (yy < LAND_HEIGHT-1200) then
+            move:=true
         // Solid pixel encountered
         else if ((yy and LAND_HEIGHT_MASK) = 0) and ((xx and LAND_WIDTH_MASK) = 0) and (Land[yy, xx] <> 0) then
             begin
@@ -920,7 +922,9 @@
         end;
     Gear^.Pos:= 0;
     Gear^.X:= int2hwFloat(LongInt(GetRandom(snowRight - snowLeft)) + snowLeft);
-    Gear^.Y:= int2hwFloat(LAND_HEIGHT + LongInt(GetRandom(50)) - 1325);
+    if (cGravity < _0) and (yy < LAND_HEIGHT-1200) then
+         Gear^.Y:= int2hwFloat(LAND_HEIGHT - 50 - LongInt(GetRandom(50)))
+    else Gear^.Y:= int2hwFloat(LAND_HEIGHT + LongInt(GetRandom(50)) - 1250);
     Gear^.State:= Gear^.State or gstInvisible;
     end
 end;