hookup perlin
authornemo
Sun, 09 Nov 2014 15:52:09 -0500
changeset 10479 31afb7cdff69
parent 10478 12662c21e0e9
child 10480 43c6b9cfb569
hookup perlin
hedgewars/uLandGenPerlin.pas
--- a/hedgewars/uLandGenPerlin.pas	Sun Nov 09 23:44:13 2014 +0300
+++ b/hedgewars/uLandGenPerlin.pas	Sun Nov 09 15:52:09 2014 -0500
@@ -10,6 +10,7 @@
     , uConsts
     , uRandom
     , uLandOutline // FillLand
+    , uUtils
     ;
 
 var p: array[0..511] of LongInt;
@@ -120,20 +121,21 @@
         p[256 + i]:= p[i];
 end;
 
-const detail = 150000;
-    width = 4096;
-    height = 2048;
-    minY = 500;
+const width = 4096;
+      height = 2048;
+      minY = 500;
 
     //bottomPlateHeight = 90;
     //bottomPlateMargin = 1200;
     margin = 200;
 
 procedure GenPerlin;
-var y, x, {dy, }di, dj, df, r, param1, param2: LongInt;
+var y, x, {dy, }di, dj, df, r, param1, param2, rCutoff, detail: LongInt;
 begin
     param1:= cTemplateFilter div 3;
     param2:= cTemplateFilter mod 3;
+    rCutoff:= min(max(cFeatureSize*4,15),85);
+    detail:= cFeatureSize*16000+50000;
 
     df:= detail * (6 - param2 * 2);
 
@@ -169,7 +171,7 @@
             end;
             }
 
-            if r < 50 then Land[y, x]:= 0 else Land[y, x]:= lfObjMask;
+            if r < rCutoff then Land[y, x]:= 0 else Land[y, x]:= lfObjMask;
 
         end;
     end;