hedgewars/uLandGenPerlin.pas
changeset 16083 629d5123a979
parent 16065 7b8d96fc8799
--- a/hedgewars/uLandGenPerlin.pas	Sat Sep 28 22:27:13 2024 +0200
+++ b/hedgewars/uLandGenPerlin.pas	Tue Dec 31 15:19:43 2024 +0100
@@ -9,8 +9,8 @@
 uses uVariables
     , uConsts
     , uRandom
-    , uLandOutline // FillLand
     , uUtils
+    , uLandUtils
     ;
 
 var p: array[0..511] of LongInt;
@@ -39,7 +39,7 @@
 4086, 4088, 4089, 4091, 4092, 4092, 4093, 4094, 4094, 4095, 4095,
 4095, 4095, 4095, 4095, 4095);
 
-function fade(t: LongInt) : LongInt; inline;
+function fade(t: LongInt) : LongInt;
 var t0, t1: LongInt;
 begin
     t0:= fadear[t shr 8];
@@ -53,13 +53,13 @@
 end;
 
 
-function lerp(t, a, b: LongInt) : LongInt; inline;
+function lerp(t, a, b: LongInt) : LongInt;
 begin
     lerp:= a + ((Int64(b) - a) * t shr 12)
 end;
 
 
-function grad(hash, x, y: LongInt) : LongInt; inline;
+function grad(hash, x, y: LongInt) : LongInt;
 var h, v, u: LongInt;
 begin
     h:= hash and 15;
@@ -74,7 +74,7 @@
 end;
 
 
-function inoise(x, y: LongInt) : LongInt; inline;
+function inoise(x, y: LongInt) : LongInt;
 const N = $10000;
 var xx, yy, u, v, A, AA, AB, B, BA, BB: LongInt;
 begin
@@ -205,24 +205,24 @@
             }
 
             if r < rCutoff then
-                Land[y, x]:= 0
+                LandSet(y, x, 0)
             else if param1 = 0 then
-                Land[y, x]:= lfObjMask
+                LandSet(y, x, lfObjMask)
             else
-                Land[y, x]:= lfBasic
+                LandSet(y, x, lfBasic)
         end;
     end;
 
     if param1 = 0 then
         begin
         for x:= 0 to width do
-            if Land[height - 1, x] = lfObjMask then FillLand(x, height - 1, 0, lfBasic);
+            if LandGet(height - 1, x) = lfObjMask then FillLand(x, height - 1, 0, lfBasic);
 
         // strip all lfObjMask pixels
         for y:= minY to LAND_HEIGHT - 1 do
             for x:= 0 to LAND_WIDTH - 1 do
-                if Land[y, x] = lfObjMask then
-                    Land[y, x]:= 0;
+                if LandGet(y, x) = lfObjMask then
+                    LandSet(y, x, 0);
         end;
 
     playWidth:= width;