188 {$ELSE} |
188 {$ELSE} |
189 LandPixels[y + dy, i]:= LandBackPixel(i, y + dy) |
189 LandPixels[y + dy, i]:= LandBackPixel(i, y + dy) |
190 {$ENDIF} |
190 {$ENDIF} |
191 else |
191 else |
192 {$IFDEF DOWNSCALE} |
192 {$IFDEF DOWNSCALE} |
193 if (Land[y + dy, i] = LAND_OBJECT) then LandPixels[(y + dy) div 2, i div 2]:= 0; |
193 if ((Land[y + dy, i] and LAND_OBJECT) <> 0) then LandPixels[(y + dy) div 2, i div 2]:= 0; |
194 {$ELSE} |
194 {$ELSE} |
195 if (Land[y + dy, i] = LAND_OBJECT) then LandPixels[y + dy, i]:= 0; |
195 if ((Land[y + dy, i] and LAND_OBJECT) <> 0) then LandPixels[y + dy, i]:= 0; |
196 {$ENDIF} |
196 {$ENDIF} |
197 if ((y - dy) and LAND_HEIGHT_MASK) = 0 then |
197 if ((y - dy) and LAND_HEIGHT_MASK) = 0 then |
198 for i:= max(x - dx, 0) to min(x + dx, LAND_WIDTH - 1) do |
198 for i:= max(x - dx, 0) to min(x + dx, LAND_WIDTH - 1) do |
199 if ((Land[y - dy, i] and LAND_BASIC) <> 0) then |
199 if ((Land[y - dy, i] and LAND_BASIC) <> 0) then |
200 {$IFDEF DOWNSCALE} |
200 {$IFDEF DOWNSCALE} |
202 {$ELSE} |
202 {$ELSE} |
203 LandPixels[y - dy, i]:= LandBackPixel(i, y - dy) |
203 LandPixels[y - dy, i]:= LandBackPixel(i, y - dy) |
204 {$ENDIF} |
204 {$ENDIF} |
205 else |
205 else |
206 {$IFDEF DOWNSCALE} |
206 {$IFDEF DOWNSCALE} |
207 if (Land[y - dy, i] = LAND_OBJECT) then LandPixels[(y - dy) div 2, i div 2]:= 0; |
207 if ((Land[y - dy, i] and LAND_OBJECT) <> 0) then LandPixels[(y - dy) div 2, i div 2]:= 0; |
208 {$ELSE} |
208 {$ELSE} |
209 if (Land[y - dy, i] = LAND_OBJECT) then LandPixels[y - dy, i]:= 0; |
209 if ((Land[y - dy, i] and LAND_OBJECT) <> 0) then LandPixels[y - dy, i]:= 0; |
210 {$ENDIF} |
210 {$ENDIF} |
211 if ((y + dx) and LAND_HEIGHT_MASK) = 0 then |
211 if ((y + dx) and LAND_HEIGHT_MASK) = 0 then |
212 for i:= max(x - dy, 0) to min(x + dy, LAND_WIDTH - 1) do |
212 for i:= max(x - dy, 0) to min(x + dy, LAND_WIDTH - 1) do |
213 if ((Land[y + dx, i] and LAND_BASIC) <> 0) then |
213 if ((Land[y + dx, i] and LAND_BASIC) <> 0) then |
214 {$IFDEF DOWNSCALE} |
214 {$IFDEF DOWNSCALE} |
216 {$ELSE} |
216 {$ELSE} |
217 LandPixels[y + dx, i]:= LandBackPixel(i, y + dx) |
217 LandPixels[y + dx, i]:= LandBackPixel(i, y + dx) |
218 {$ENDIF} |
218 {$ENDIF} |
219 else |
219 else |
220 {$IFDEF DOWNSCALE} |
220 {$IFDEF DOWNSCALE} |
221 if (Land[y + dx, i] = LAND_OBJECT) then LandPixels[(y + dx) div 2, i div 2]:= 0; |
221 if ((Land[y + dx, i] and LAND_OBJECT) <> 0) then LandPixels[(y + dx) div 2, i div 2]:= 0; |
222 {$ELSE} |
222 {$ELSE} |
223 if (Land[y + dx, i] = LAND_OBJECT) then LandPixels[y + dx, i]:= 0; |
223 if ((Land[y + dx, i] and LAND_OBJECT) <> 0) then LandPixels[y + dx, i]:= 0; |
224 {$ENDIF} |
224 {$ENDIF} |
225 if ((y - dx) and LAND_HEIGHT_MASK) = 0 then |
225 if ((y - dx) and LAND_HEIGHT_MASK) = 0 then |
226 for i:= max(x - dy, 0) to min(x + dy, LAND_WIDTH - 1) do |
226 for i:= max(x - dy, 0) to min(x + dy, LAND_WIDTH - 1) do |
227 if ((Land[y - dx, i] and LAND_BASIC) <> 0) then |
227 if ((Land[y - dx, i] and LAND_BASIC) <> 0) then |
228 {$IFDEF DOWNSCALE} |
228 {$IFDEF DOWNSCALE} |
230 {$ELSE} |
230 {$ELSE} |
231 LandPixels[y - dx, i]:= LandBackPixel(i, y - dx) |
231 LandPixels[y - dx, i]:= LandBackPixel(i, y - dx) |
232 {$ENDIF} |
232 {$ENDIF} |
233 else |
233 else |
234 {$IFDEF DOWNSCALE} |
234 {$IFDEF DOWNSCALE} |
235 if (Land[y - dx, i] = LAND_OBJECT) then LandPixels[(y - dx) div 2, i div 2]:= 0; |
235 if ((Land[y - dx, i] and LAND_OBJECT) <> 0) then LandPixels[(y - dx) div 2, i div 2]:= 0; |
236 {$ELSE} |
236 {$ELSE} |
237 if (Land[y - dx, i] = LAND_OBJECT) then LandPixels[y - dx, i]:= 0; |
237 if ((Land[y - dx, i] and LAND_OBJECT) <> 0) then LandPixels[y - dx, i]:= 0; |
238 {$ENDIF} |
238 {$ENDIF} |
239 end; |
239 end; |
240 |
240 |
241 procedure FillLandCircleLinesEBC(x, y, dx, dy: LongInt); |
241 procedure FillLandCircleLinesEBC(x, y, dx, dy: LongInt); |
242 var i: LongInt; |
242 var i: LongInt; |
243 begin |
243 begin |
244 if ((y + dy) and LAND_HEIGHT_MASK) = 0 then |
244 if ((y + dy) and LAND_HEIGHT_MASK) = 0 then |
245 for i:= max(x - dx, 0) to min(x + dx, LAND_WIDTH - 1) do |
245 for i:= max(x - dx, 0) to min(x + dx, LAND_WIDTH - 1) do |
246 if ((Land[y + dy, i] and LAND_BASIC) <> 0) or (Land[y + dy, i] = LAND_OBJECT) then |
246 if ((Land[y + dy, i] and LAND_BASIC) <> 0) or ((Land[y + dy, i] and LAND_OBJECT) <> 0) then |
247 begin |
247 begin |
248 {$IFDEF DOWNSCALE} |
248 {$IFDEF DOWNSCALE} |
249 LandPixels[(y + dy) div 2, i div 2]:= cExplosionBorderColor; |
249 LandPixels[(y + dy) div 2, i div 2]:= cExplosionBorderColor; |
250 {$ELSE} |
250 {$ELSE} |
251 LandPixels[y + dy, i]:= cExplosionBorderColor; |
251 LandPixels[y + dy, i]:= cExplosionBorderColor; |
254 Despeckle(i, y + dy); |
254 Despeckle(i, y + dy); |
255 LandDirty[(y + dy) div 32, i div 32]:= 1; |
255 LandDirty[(y + dy) div 32, i div 32]:= 1; |
256 end; |
256 end; |
257 if ((y - dy) and LAND_HEIGHT_MASK) = 0 then |
257 if ((y - dy) and LAND_HEIGHT_MASK) = 0 then |
258 for i:= max(x - dx, 0) to min(x + dx, LAND_WIDTH - 1) do |
258 for i:= max(x - dx, 0) to min(x + dx, LAND_WIDTH - 1) do |
259 if ((Land[y - dy, i] and LAND_BASIC) <> 0) or (Land[y - dy, i] = LAND_OBJECT) then |
259 if ((Land[y - dy, i] and LAND_BASIC) <> 0) or ((Land[y - dy, i] and LAND_OBJECT) <> 0) then |
260 begin |
260 begin |
261 {$IFDEF DOWNSCALE} |
261 {$IFDEF DOWNSCALE} |
262 LandPixels[(y - dy) div 2, i div 2]:= cExplosionBorderColor; |
262 LandPixels[(y - dy) div 2, i div 2]:= cExplosionBorderColor; |
263 {$ELSE} |
263 {$ELSE} |
264 LandPixels[y - dy, i]:= cExplosionBorderColor; |
264 LandPixels[y - dy, i]:= cExplosionBorderColor; |
267 Despeckle(i, y - dy); |
267 Despeckle(i, y - dy); |
268 LandDirty[(y - dy) div 32, i div 32]:= 1; |
268 LandDirty[(y - dy) div 32, i div 32]:= 1; |
269 end; |
269 end; |
270 if ((y + dx) and LAND_HEIGHT_MASK) = 0 then |
270 if ((y + dx) and LAND_HEIGHT_MASK) = 0 then |
271 for i:= max(x - dy, 0) to min(x + dy, LAND_WIDTH - 1) do |
271 for i:= max(x - dy, 0) to min(x + dy, LAND_WIDTH - 1) do |
272 if ((Land[y + dx, i] and LAND_BASIC) <> 0) or (Land[y + dx, i] = LAND_OBJECT) then |
272 if ((Land[y + dx, i] and LAND_BASIC) <> 0) or ((Land[y + dx, i] and LAND_OBJECT) <> 0) then |
273 begin |
273 begin |
274 {$IFDEF DOWNSCALE} |
274 {$IFDEF DOWNSCALE} |
275 LandPixels[(y + dx) div 2, i div 2]:= cExplosionBorderColor; |
275 LandPixels[(y + dx) div 2, i div 2]:= cExplosionBorderColor; |
276 {$ELSE} |
276 {$ELSE} |
277 LandPixels[y + dx, i]:= cExplosionBorderColor; |
277 LandPixels[y + dx, i]:= cExplosionBorderColor; |
280 Despeckle(i, y + dx); |
280 Despeckle(i, y + dx); |
281 LandDirty[(y + dx) div 32, i div 32]:= 1; |
281 LandDirty[(y + dx) div 32, i div 32]:= 1; |
282 end; |
282 end; |
283 if ((y - dx) and LAND_HEIGHT_MASK) = 0 then |
283 if ((y - dx) and LAND_HEIGHT_MASK) = 0 then |
284 for i:= max(x - dy, 0) to min(x + dy, LAND_WIDTH - 1) do |
284 for i:= max(x - dy, 0) to min(x + dy, LAND_WIDTH - 1) do |
285 if ((Land[y - dx, i] and LAND_BASIC) <> 0) or (Land[y - dx, i] = LAND_OBJECT) then |
285 if ((Land[y - dx, i] and LAND_BASIC) <> 0) or ((Land[y - dx, i] and LAND_OBJECT) <> 0) then |
286 begin |
286 begin |
287 {$IFDEF DOWNSCALE} |
287 {$IFDEF DOWNSCALE} |
288 LandPixels[(y - dx) div 2, i div 2]:= cExplosionBorderColor; |
288 LandPixels[(y - dx) div 2, i div 2]:= cExplosionBorderColor; |
289 {$ELSE} |
289 {$ELSE} |
290 LandPixels[y - dx, i]:= cExplosionBorderColor; |
290 LandPixels[y - dx, i]:= cExplosionBorderColor; |
381 {$IFDEF DOWNSCALE} |
381 {$IFDEF DOWNSCALE} |
382 LandPixels[ty div 2, tx div 2]:= LandBackPixel(tx, ty) |
382 LandPixels[ty div 2, tx div 2]:= LandBackPixel(tx, ty) |
383 {$ELSE} |
383 {$ELSE} |
384 LandPixels[ty, tx]:= LandBackPixel(tx, ty) |
384 LandPixels[ty, tx]:= LandBackPixel(tx, ty) |
385 {$ENDIF} |
385 {$ENDIF} |
386 else if Land[ty, tx] = LAND_OBJECT then |
386 else if (Land[ty, tx] and LAND_OBJECT) <> 0 then |
387 {$IFDEF DOWNSCALE} |
387 {$IFDEF DOWNSCALE} |
388 LandPixels[ty div 2, tx div 2]:= 0; |
388 LandPixels[ty div 2, tx div 2]:= 0; |
389 {$ELSE} |
389 {$ELSE} |
390 LandPixels[ty, tx]:= 0; |
390 LandPixels[ty, tx]:= 0; |
391 {$ENDIF} |
391 {$ENDIF} |
397 |
397 |
398 for i:= 0 to Pred(Count) do |
398 for i:= 0 to Pred(Count) do |
399 begin |
399 begin |
400 for ty:= max(y - Radius, 0) to min(y + Radius, LAND_HEIGHT) do |
400 for ty:= max(y - Radius, 0) to min(y + Radius, LAND_HEIGHT) do |
401 for tx:= max(0, ar^[i].Left - Radius) to min(LAND_WIDTH, ar^[i].Right + Radius) do |
401 for tx:= max(0, ar^[i].Left - Radius) to min(LAND_WIDTH, ar^[i].Right + Radius) do |
402 if ((Land[ty, tx] and LAND_BASIC) <> 0) or (Land[ty, tx] = LAND_OBJECT) then |
402 if ((Land[ty, tx] and LAND_BASIC) <> 0) or ((Land[ty, tx] and LAND_OBJECT) <> 0) then |
403 begin |
403 begin |
404 {$IFDEF DOWNSCALE} |
404 {$IFDEF DOWNSCALE} |
405 LandPixels[ty div 2, tx div 2]:= cExplosionBorderColor; |
405 LandPixels[ty div 2, tx div 2]:= cExplosionBorderColor; |
406 {$ELSE} |
406 {$ELSE} |
407 LandPixels[ty, tx]:= cExplosionBorderColor; |
407 LandPixels[ty, tx]:= cExplosionBorderColor; |
442 tx:= hwRound(X); |
442 tx:= hwRound(X); |
443 ty:= hwRound(Y); |
443 ty:= hwRound(Y); |
444 if ((ty and LAND_HEIGHT_MASK) = 0) and |
444 if ((ty and LAND_HEIGHT_MASK) = 0) and |
445 ((tx and LAND_WIDTH_MASK) = 0) and |
445 ((tx and LAND_WIDTH_MASK) = 0) and |
446 (((Land[ty, tx] and LAND_BASIC) <> 0) or |
446 (((Land[ty, tx] and LAND_BASIC) <> 0) or |
447 (Land[ty, tx] = LAND_OBJECT)) then |
447 ((Land[ty, tx] and LAND_OBJECT) <> 0)) then |
448 begin |
448 begin |
449 Land[ty, tx]:= Land[ty, tx] or LAND_DAMAGED; |
449 Land[ty, tx]:= Land[ty, tx] or LAND_DAMAGED; |
450 {$IFDEF DOWNSCALE} |
450 {$IFDEF DOWNSCALE} |
451 LandPixels[ty div 2, tx div 2]:= cExplosionBorderColor |
451 LandPixels[ty div 2, tx div 2]:= cExplosionBorderColor |
452 {$ELSE} |
452 {$ELSE} |
469 tx:= hwRound(X); |
469 tx:= hwRound(X); |
470 ty:= hwRound(Y); |
470 ty:= hwRound(Y); |
471 if ((ty and LAND_HEIGHT_MASK) = 0) and |
471 if ((ty and LAND_HEIGHT_MASK) = 0) and |
472 ((tx and LAND_WIDTH_MASK) = 0) and |
472 ((tx and LAND_WIDTH_MASK) = 0) and |
473 (((Land[ty, tx] and LAND_BASIC) <> 0) or |
473 (((Land[ty, tx] and LAND_BASIC) <> 0) or |
474 (Land[ty, tx] = LAND_OBJECT)) then |
474 ((Land[ty, tx] and LAND_OBJECT) <> 0)) then |
475 begin |
475 begin |
476 Land[ty, tx]:= Land[ty, tx] or LAND_DAMAGED; |
476 Land[ty, tx]:= Land[ty, tx] or LAND_DAMAGED; |
477 {$IFDEF DOWNSCALE} |
477 {$IFDEF DOWNSCALE} |
478 LandPixels[ty div 2, tx div 2]:= cExplosionBorderColor |
478 LandPixels[ty div 2, tx div 2]:= cExplosionBorderColor |
479 {$ELSE} |
479 {$ELSE} |
495 {$IFDEF DOWNSCALE} |
495 {$IFDEF DOWNSCALE} |
496 LandPixels[ty div 2, tx div 2]:= LandBackPixel(tx, ty) |
496 LandPixels[ty div 2, tx div 2]:= LandBackPixel(tx, ty) |
497 {$ELSE} |
497 {$ELSE} |
498 LandPixels[ty, tx]:= LandBackPixel(tx, ty) |
498 LandPixels[ty, tx]:= LandBackPixel(tx, ty) |
499 {$ENDIF} |
499 {$ENDIF} |
500 else if Land[ty, tx] = LAND_OBJECT then |
500 else if (Land[ty, tx] and LAND_OBJECT) <> 0 then |
501 {$IFDEF DOWNSCALE} |
501 {$IFDEF DOWNSCALE} |
502 LandPixels[ty div 2, tx div 2]:= 0; |
502 LandPixels[ty div 2, tx div 2]:= 0; |
503 {$ELSE} |
503 {$ELSE} |
504 LandPixels[ty, tx]:= 0; |
504 LandPixels[ty, tx]:= 0; |
505 {$ENDIF} |
505 {$ENDIF} |
513 tx:= hwRound(X); |
513 tx:= hwRound(X); |
514 ty:= hwRound(Y); |
514 ty:= hwRound(Y); |
515 if ((ty and LAND_HEIGHT_MASK) = 0) and |
515 if ((ty and LAND_HEIGHT_MASK) = 0) and |
516 ((tx and LAND_WIDTH_MASK) = 0) and |
516 ((tx and LAND_WIDTH_MASK) = 0) and |
517 (((Land[ty, tx] and LAND_BASIC) <> 0) or |
517 (((Land[ty, tx] and LAND_BASIC) <> 0) or |
518 (Land[ty, tx] = LAND_OBJECT)) then |
518 ((Land[ty, tx] and LAND_OBJECT) <> 0)) then |
519 begin |
519 begin |
520 Land[ty, tx]:= Land[ty, tx] or LAND_DAMAGED; |
520 Land[ty, tx]:= Land[ty, tx] or LAND_DAMAGED; |
521 {$IFDEF DOWNSCALE} |
521 {$IFDEF DOWNSCALE} |
522 LandPixels[ty div 2, tx div 2]:= cExplosionBorderColor |
522 LandPixels[ty div 2, tx div 2]:= cExplosionBorderColor |
523 {$ELSE} |
523 {$ELSE} |
540 tx:= hwRound(X); |
540 tx:= hwRound(X); |
541 ty:= hwRound(Y); |
541 ty:= hwRound(Y); |
542 if ((ty and LAND_HEIGHT_MASK) = 0) and |
542 if ((ty and LAND_HEIGHT_MASK) = 0) and |
543 ((tx and LAND_WIDTH_MASK) = 0) and |
543 ((tx and LAND_WIDTH_MASK) = 0) and |
544 (((Land[ty, tx] and LAND_BASIC) <> 0) or |
544 (((Land[ty, tx] and LAND_BASIC) <> 0) or |
545 (Land[ty, tx] = LAND_OBJECT)) then |
545 ((Land[ty, tx] and LAND_OBJECT) <> 0)) then |
546 begin |
546 begin |
547 Land[ty, tx]:= Land[ty, tx] or LAND_DAMAGED; |
547 Land[ty, tx]:= Land[ty, tx] or LAND_DAMAGED; |
548 {$IFDEF DOWNSCALE} |
548 {$IFDEF DOWNSCALE} |
549 LandPixels[ty div 2, tx div 2]:= cExplosionBorderColor |
549 LandPixels[ty div 2, tx div 2]:= cExplosionBorderColor |
550 {$ELSE} |
550 {$ELSE} |