37 3990, 3997, 4004, 4011, 4018, 4024, 4030, 4035, 4041, 4046, 4050, |
38 3990, 3997, 4004, 4011, 4018, 4024, 4030, 4035, 4041, 4046, 4050, |
38 4055, 4059, 4063, 4066, 4070, 4073, 4076, 4078, 4081, 4083, 4085, |
39 4055, 4059, 4063, 4066, 4070, 4073, 4076, 4078, 4081, 4083, 4085, |
39 4086, 4088, 4089, 4091, 4092, 4092, 4093, 4094, 4094, 4095, 4095, |
40 4086, 4088, 4089, 4091, 4092, 4092, 4093, 4094, 4094, 4095, 4095, |
40 4095, 4095, 4095, 4095, 4095); |
41 4095, 4095, 4095, 4095, 4095); |
41 |
42 |
42 function fade(t: LongInt) : LongInt; inline; |
43 function fade(t: LongInt) : LongInt; |
43 var t0, t1: LongInt; |
44 var t0, t1: LongInt; |
44 begin |
45 begin |
45 t0:= fadear[t shr 8]; |
46 t0:= fadear[t shr 8]; |
46 |
47 |
47 if t0 = fadear[255] then |
48 if t0 = fadear[255] then |
51 |
52 |
52 fade:= t0 + ((t and 255) * (t1 - t0) shr 8) |
53 fade:= t0 + ((t and 255) * (t1 - t0) shr 8) |
53 end; |
54 end; |
54 |
55 |
55 |
56 |
56 function lerp(t, a, b: LongInt) : LongInt; inline; |
57 function lerp(t, a, b: LongInt) : LongInt; |
57 begin |
58 begin |
58 lerp:= a + ((Int64(b) - a) * t shr 12) |
59 lerp:= a + ((Int64(b) - a) * t shr 12) |
59 end; |
60 end; |
60 |
61 |
61 |
62 |
62 function grad(hash, x, y: LongInt) : LongInt; inline; |
63 function grad(hash, x, y: LongInt) : LongInt; |
63 var h, v, u: LongInt; |
64 var h, v, u: LongInt; |
64 begin |
65 begin |
65 h:= hash and 15; |
66 h:= hash and 15; |
66 if h < 8 then u:= x else u:= y; |
67 if h < 8 then u:= x else u:= y; |
67 if h < 4 then v:= y else |
68 if h < 4 then v:= y else |
72 |
73 |
73 grad:= u + v |
74 grad:= u + v |
74 end; |
75 end; |
75 |
76 |
76 |
77 |
77 function inoise(x, y: LongInt) : LongInt; inline; |
78 function inoise(x, y: LongInt) : LongInt; |
78 const N = $10000; |
79 const N = $10000; |
79 var xx, yy, u, v, A, AA, AB, B, BA, BB: LongInt; |
80 var xx, yy, u, v, A, AA, AB, B, BA, BB: LongInt; |
80 begin |
81 begin |
81 xx:= (x shr 16) and 255; |
82 xx:= (x shr 16) and 255; |
82 yy:= (y shr 16) and 255; |
83 yy:= (y shr 16) and 255; |
203 r:= r - (x - width + bottomPlateMargin + bottomPlateHeight); |
204 r:= r - (x - width + bottomPlateMargin + bottomPlateHeight); |
204 end; |
205 end; |
205 } |
206 } |
206 |
207 |
207 if r < rCutoff then |
208 if r < rCutoff then |
208 Land[y, x]:= 0 |
209 LandSet(y, x, 0) |
209 else if param1 = 0 then |
210 else if param1 = 0 then |
210 Land[y, x]:= lfObjMask |
211 LandSet(y, x, lfObjMask) |
211 else |
212 else |
212 Land[y, x]:= lfBasic |
213 LandSet(y, x, lfBasic) |
213 end; |
214 end; |
214 end; |
215 end; |
215 |
216 |
216 if param1 = 0 then |
217 if param1 = 0 then |
217 begin |
218 begin |
218 for x:= 0 to width do |
219 for x:= 0 to width do |
219 if Land[height - 1, x] = lfObjMask then FillLand(x, height - 1, 0, lfBasic); |
220 if LandGet(height - 1, x) = lfObjMask then FillLand(x, height - 1, 0, lfBasic); |
220 |
221 |
221 // strip all lfObjMask pixels |
222 // strip all lfObjMask pixels |
222 for y:= minY to LAND_HEIGHT - 1 do |
223 for y:= minY to LAND_HEIGHT - 1 do |
223 for x:= 0 to LAND_WIDTH - 1 do |
224 for x:= 0 to LAND_WIDTH - 1 do |
224 if Land[y, x] = lfObjMask then |
225 if LandGet(y, x) = lfObjMask then |
225 Land[y, x]:= 0; |
226 LandSet(y, x, 0); |
226 end; |
227 end; |
227 |
228 |
228 playWidth:= width; |
229 playWidth:= width; |
229 playHeight:= height; |
230 playHeight:= height; |
230 leftX:= 0; |
231 leftX:= 0; |