Smooth perlin's outline
authorunc0rr
Wed, 13 Aug 2014 22:31:28 +0400
changeset 10386 c9e38f8d4f94
parent 10385 15eda15df81c
child 10387 cb17b79844b5
Smooth perlin's outline
hedgewars/uLandGenPerlin.pas
--- a/hedgewars/uLandGenPerlin.pas	Wed Aug 13 15:39:32 2014 +0000
+++ b/hedgewars/uLandGenPerlin.pas	Wed Aug 13 22:31:28 2014 +0400
@@ -143,13 +143,11 @@
         begin
             dj:= df * x div width;
 
-            r:= (abs(inoise(di, dj)) + y*4) mod 65536 div 256;
+            r:= ((abs(inoise(di, dj)) + y*4) mod 65536 - (height - y) * 8) div 256;
 
             //r:= (abs(inoise(di, dj))) shr 8 and $ff;
             if (x < margin) or (x > width - margin) then r:= r - abs(x - width div 2) + width div 2 - margin; // fade on edges
 
-            r:= r - (height - y) div 32;
-
             //r:= r - max(0, - abs(x - width div 2) + width * 2 div 100); // split vertically in the middle
             //r:= r + (trunc(1000 - sqrt(sqr(x - (width div 2)) * 4 + sqr(y - height * 5 div 4) * 22))) div 600 * 20; // ellipse
             //r:= r + 1 - ((abs(x - (width div 2)) + abs(y - height) * 2)) div 32; // manhattan length ellipse