equal
deleted
inserted
replaced
9 uses uVariables, uConsts, uRandom, math; // for min() |
9 uses uVariables, uConsts, uRandom, math; // for min() |
10 |
10 |
11 var fadear: array[byte] of LongInt; |
11 var fadear: array[byte] of LongInt; |
12 p: array[0..511] of LongInt; |
12 p: array[0..511] of LongInt; |
13 |
13 |
14 function fade(t: LongInt) : LongInt; |
14 function fade(t: LongInt) : LongInt; inline; |
15 var t0, t1: LongInt; |
15 var t0, t1: LongInt; |
16 begin |
16 begin |
17 t0:= fadear[t shr 8]; |
17 t0:= fadear[t shr 8]; |
18 t1:= fadear[min(255, t shr 8 + 1)]; |
18 t1:= fadear[min(255, t shr 8 + 1)]; |
19 |
19 |
20 fade:= t0 + ((t and 255) * (t1 - t0) shr 8) |
20 fade:= t0 + ((t and 255) * (t1 - t0) shr 8) |
21 end; |
21 end; |
22 |
22 |
23 |
23 |
24 function lerp(t, a, b: LongInt) : LongInt; |
24 function lerp(t, a, b: LongInt) : LongInt; inline; |
25 begin |
25 begin |
26 lerp:= a + (t * (b - a) shr 12) |
26 lerp:= a + (t * (b - a) shr 12) |
27 end; |
27 end; |
28 |
28 |
29 |
29 |
114 di:= detail * field * y div height; |
114 di:= detail * field * y div height; |
115 for x:= 0 to pred(width) do |
115 for x:= 0 to pred(width) do |
116 begin |
116 begin |
117 dj:= detail * field * x div width; |
117 dj:= detail * field * x div width; |
118 r:= (abs(inoise(di, dj, detail*field)) + y*4) mod 65536 div 256; |
118 r:= (abs(inoise(di, dj, detail*field)) + y*4) mod 65536 div 256; |
119 r:= r - max(0, abs(x - width div 2) - width * 45 div 100); |
119 r:= r - max(0, abs(x - width div 2) - width * 45 div 100); // fade on edges |
120 //r:= r - max(0, - abs(x - width div 2) + width * 2 div 100); |
120 //r:= r - max(0, - abs(x - width div 2) + width * 2 div 100); // split vertically in the middle |
121 |
121 |
122 |
122 |
123 r:= r + (trunc(1000 - sqrt(sqr(x - (width div 2)) * 4 + sqr(y - height * 5 div 4) * 22))) div 600 * 20; |
123 //r:= r + (trunc(1000 - sqrt(sqr(x - (width div 2)) * 4 + sqr(y - height * 5 div 4) * 22))) div 600 * 20; // ellipse |
|
124 r:= r + (trunc(1000 - (abs(x - (width div 2)) * 2 + abs(y - height * 5 div 4) * 4))) div 600 * 20; // manhattan length ellipse |
124 |
125 |
125 if r < 0 then Land[y, x]:= 0 else Land[y, x]:= lfBasic; |
126 if r < 0 then Land[y, x]:= 0 else Land[y, x]:= lfBasic; |
126 |
127 |
127 end; |
128 end; |
128 end; |
129 end; |