hedgewars/uLandGraphics.pas
changeset 7509 76e3a3fc17cd
parent 7492 3188794b9d87
child 8026 4a4f21070479
child 8579 d18bc19d780a
equal deleted inserted replaced
7505:94e1fa117081 7509:76e3a3fc17cd
    80 
    80 
    81 procedure FillCircleLines(x, y, dx, dy: LongInt; Value: Longword);
    81 procedure FillCircleLines(x, y, dx, dy: LongInt; Value: Longword);
    82 var i: LongInt;
    82 var i: LongInt;
    83 begin
    83 begin
    84 if ((y + dy) and LAND_HEIGHT_MASK) = 0 then
    84 if ((y + dy) and LAND_HEIGHT_MASK) = 0 then
    85     for i:= Min(x + dx, LAND_WIDTH - 1) downto Max(x - dx, 0) do
    85     for i:= Max(x - dx, 0) to Min(x + dx, LAND_WIDTH - 1) do
    86         if (Land[y + dy, i] and lfIndestructible) = 0 then
    86         if (Land[y + dy, i] and lfIndestructible) = 0 then
    87             Land[y + dy, i]:= Value;
    87             Land[y + dy, i]:= Value;
    88 if ((y - dy) and LAND_HEIGHT_MASK) = 0 then
    88 if ((y - dy) and LAND_HEIGHT_MASK) = 0 then
    89     for i:= Min(x + dx, LAND_WIDTH - 1) downto Max(x - dx, 0) do
    89     for i:= Max(x - dx, 0) to Min(x + dx, LAND_WIDTH - 1) do
    90         if (Land[y - dy, i] and lfIndestructible) = 0 then
    90         if (Land[y - dy, i] and lfIndestructible) = 0 then
    91             Land[y - dy, i]:= Value;
    91             Land[y - dy, i]:= Value;
    92 if ((y + dx) and LAND_HEIGHT_MASK) = 0 then
    92 if ((y + dx) and LAND_HEIGHT_MASK) = 0 then
    93     for i:= Min(x + dy, LAND_WIDTH - 1) downto Max(x - dy, 0) do
    93     for i:= Max(x - dy, 0) to Min(x + dy, LAND_WIDTH - 1) do
    94         if (Land[y + dx, i] and lfIndestructible) = 0 then
    94         if (Land[y + dx, i] and lfIndestructible) = 0 then
    95             Land[y + dx, i]:= Value;
    95             Land[y + dx, i]:= Value;
    96 if ((y - dx) and LAND_HEIGHT_MASK) = 0 then
    96 if ((y - dx) and LAND_HEIGHT_MASK) = 0 then
    97     for i:= Min(x + dy, LAND_WIDTH - 1) downto Max(x - dy, 0) do
    97     for i:= Max(x - dy, 0) to Min(x + dy, LAND_WIDTH - 1) do
    98         if (Land[y - dx, i] and lfIndestructible) = 0 then
    98         if (Land[y - dx, i] and lfIndestructible) = 0 then
    99             Land[y - dx, i]:= Value;
    99             Land[y - dx, i]:= Value;
   100 end;
   100 end;
   101 
   101 
   102 procedure ChangeCircleLines(x, y, dx, dy: LongInt; doSet, isCurrent: boolean);
   102 procedure ChangeCircleLines(x, y, dx, dy: LongInt; doSet, isCurrent: boolean);
   103 var i: LongInt;
   103 var i: LongInt;
   104 begin
   104 begin
   105 if not doSet then
   105 if not doSet then
   106     begin
   106     begin
   107     if ((y + dy) and LAND_HEIGHT_MASK) = 0 then
   107     if ((y + dy) and LAND_HEIGHT_MASK) = 0 then
   108         for i:= Min(x + dx, LAND_WIDTH - 1) downto Max(x - dx, 0) do
   108         for i:= Max(x - dx, 0) to Min(x + dx, LAND_WIDTH - 1) do
   109             if isCurrent then
   109             if isCurrent then
   110                 Land[y + dy, i]:= Land[y + dy, i] and $FF7F
   110                 Land[y + dy, i]:= Land[y + dy, i] and $FF7F
   111             else if Land[y + dy, i] and $007F > 0 then
   111             else if Land[y + dy, i] and $007F > 0 then
   112                 Land[y + dy, i]:= (Land[y + dy, i] and $FF80) or ((Land[y + dy, i] and $7F) - 1);
   112                 Land[y + dy, i]:= (Land[y + dy, i] and $FF80) or ((Land[y + dy, i] and $7F) - 1);
   113     if ((y - dy) and LAND_HEIGHT_MASK) = 0 then
   113     if ((y - dy) and LAND_HEIGHT_MASK) = 0 then
   114         for i:= Min(x + dx, LAND_WIDTH - 1) downto Max(x - dx, 0) do
   114         for i:= Max(x - dx, 0) to Min(x + dx, LAND_WIDTH - 1) do
   115             if isCurrent then
   115             if isCurrent then
   116                 Land[y - dy, i]:= Land[y - dy, i] and $FF7F
   116                 Land[y - dy, i]:= Land[y - dy, i] and $FF7F
   117             else if Land[y - dy, i] and $007F > 0 then
   117             else if Land[y - dy, i] and $007F > 0 then
   118                 Land[y - dy, i]:= (Land[y - dy, i] and $FF80) or ((Land[y - dy, i] and $7F) - 1);
   118                 Land[y - dy, i]:= (Land[y - dy, i] and $FF80) or ((Land[y - dy, i] and $7F) - 1);
   119     if ((y + dx) and LAND_HEIGHT_MASK) = 0 then
   119     if ((y + dx) and LAND_HEIGHT_MASK) = 0 then
   120         for i:= Min(x + dy, LAND_WIDTH - 1) downto Max(x - dy, 0) do
   120         for i:= Max(x - dy, 0) to Min(x + dy, LAND_WIDTH - 1) do
   121             if isCurrent then
   121             if isCurrent then
   122                 Land[y + dx, i]:= Land[y + dx, i] and $FF7F
   122                 Land[y + dx, i]:= Land[y + dx, i] and $FF7F
   123             else if Land[y + dx, i] and $007F > 0 then
   123             else if Land[y + dx, i] and $007F > 0 then
   124                 Land[y + dx, i]:= (Land[y + dx, i] and $FF80) or ((Land[y + dx, i] and $7F) - 1);
   124                 Land[y + dx, i]:= (Land[y + dx, i] and $FF80) or ((Land[y + dx, i] and $7F) - 1);
   125     if ((y - dx) and LAND_HEIGHT_MASK) = 0 then
   125     if ((y - dx) and LAND_HEIGHT_MASK) = 0 then
   126         for i:= Min(x + dy, LAND_WIDTH - 1) downto Max(x - dy, 0) do
   126         for i:= Max(x - dy, 0) to Min(x + dy, LAND_WIDTH - 1) do
   127             if isCurrent then
   127             if isCurrent then
   128                 Land[y - dx, i]:= Land[y - dx, i] and $FF7F
   128                 Land[y - dx, i]:= Land[y - dx, i] and $FF7F
   129             else if Land[y - dx, i] and $007F > 0 then
   129             else if Land[y - dx, i] and $007F > 0 then
   130                 Land[y - dx, i]:= (Land[y - dx, i] and $FF80) or ((Land[y - dx, i] and $7F) - 1)
   130                 Land[y - dx, i]:= (Land[y - dx, i] and $FF80) or ((Land[y - dx, i] and $7F) - 1)
   131     end
   131     end
   132 else
   132 else
   133     begin
   133     begin
   134     if ((y + dy) and LAND_HEIGHT_MASK) = 0 then
   134     if ((y + dy) and LAND_HEIGHT_MASK) = 0 then
   135         for i:= Min(x + dx, LAND_WIDTH - 1) downto Max(x - dx, 0) do
   135         for i:= Max(x - dx, 0) to Min(x + dx, LAND_WIDTH - 1) do
   136             if isCurrent then
   136             if isCurrent then
   137                 Land[y + dy, i]:= Land[y + dy, i] or $80
   137                 Land[y + dy, i]:= Land[y + dy, i] or $80
   138             else if Land[y + dy, i] and $007F < 127 then
   138             else if Land[y + dy, i] and $007F < 127 then
   139                 Land[y + dy, i]:= (Land[y + dy, i] and $FF80) or ((Land[y + dy, i] and $7F) + 1);
   139                 Land[y + dy, i]:= (Land[y + dy, i] and $FF80) or ((Land[y + dy, i] and $7F) + 1);
   140     if ((y - dy) and LAND_HEIGHT_MASK) = 0 then
   140     if ((y - dy) and LAND_HEIGHT_MASK) = 0 then
   141         for i:= Min(x + dx, LAND_WIDTH - 1) downto Max(x - dx, 0) do
   141         for i:= Max(x - dx, 0) to Min(x + dx, LAND_WIDTH - 1) do
   142             if isCurrent then
   142             if isCurrent then
   143                 Land[y - dy, i]:= Land[y - dy, i] or $80
   143                 Land[y - dy, i]:= Land[y - dy, i] or $80
   144             else if Land[y - dy, i] and $007F < 127 then
   144             else if Land[y - dy, i] and $007F < 127 then
   145                 Land[y - dy, i]:= (Land[y - dy, i] and $FF80) or ((Land[y - dy, i] and $7F) + 1);
   145                 Land[y - dy, i]:= (Land[y - dy, i] and $FF80) or ((Land[y - dy, i] and $7F) + 1);
   146     if ((y + dx) and LAND_HEIGHT_MASK) = 0 then
   146     if ((y + dx) and LAND_HEIGHT_MASK) = 0 then
   147         for i:= Min(x + dy, LAND_WIDTH - 1) downto Max(x - dy, 0) do
   147         for i:= Max(x - dy, 0) to Min(x + dy, LAND_WIDTH - 1) do
   148             if isCurrent then
   148             if isCurrent then
   149                 Land[y + dx, i]:= Land[y + dx, i] or $80
   149                 Land[y + dx, i]:= Land[y + dx, i] or $80
   150             else if Land[y + dx, i] and $007F < 127 then
   150             else if Land[y + dx, i] and $007F < 127 then
   151                 Land[y + dx, i]:= (Land[y + dx, i] and $FF80) or ((Land[y + dx, i] and $7F) + 1);
   151                 Land[y + dx, i]:= (Land[y + dx, i] and $FF80) or ((Land[y + dx, i] and $7F) + 1);
   152     if ((y - dx) and LAND_HEIGHT_MASK) = 0 then
   152     if ((y - dx) and LAND_HEIGHT_MASK) = 0 then
   153         for i:= Min(x + dy, LAND_WIDTH - 1) downto Max(x - dy, 0) do 
   153         for i:= Max(x - dy, 0) to Min(x + dy, LAND_WIDTH - 1) do
   154             if isCurrent then
   154             if isCurrent then
   155                 Land[y - dx, i]:= Land[y - dx, i] or $80
   155                 Land[y - dx, i]:= Land[y - dx, i] or $80
   156             else if Land[y - dx, i] and $007F < 127 then
   156             else if Land[y - dx, i] and $007F < 127 then
   157                 Land[y - dx, i]:= (Land[y - dx, i] and $FF80) or ((Land[y - dx, i] and $7F) + 1)
   157                 Land[y - dx, i]:= (Land[y - dx, i] and $FF80) or ((Land[y - dx, i] and $7F) + 1)
   158     end
   158     end
   205 procedure FillLandCircleLines0(x, y, dx, dy: LongInt);
   205 procedure FillLandCircleLines0(x, y, dx, dy: LongInt);
   206 var i, t: LongInt;
   206 var i, t: LongInt;
   207 begin
   207 begin
   208 t:= y + dy;
   208 t:= y + dy;
   209 if (t and LAND_HEIGHT_MASK) = 0 then
   209 if (t and LAND_HEIGHT_MASK) = 0 then
   210     for i:= Min(x + dx, LAND_WIDTH - 1) downto Max(x - dx, 0) do 
   210     for i:= Max(x - dx, 0) to Min(x + dx, LAND_WIDTH - 1) do
   211         if ((Land[t, i] and lfIndestructible) = 0) and (not disableLandBack or (Land[t, i] > 255))  then
   211         if ((Land[t, i] and lfIndestructible) = 0) and (not disableLandBack or (Land[t, i] > 255))  then
   212             if (cReducedQuality and rqBlurryLand) = 0 then
   212             if (cReducedQuality and rqBlurryLand) = 0 then
   213                 LandPixels[t, i]:= 0
   213                 LandPixels[t, i]:= 0
   214             else
   214             else
   215                 LandPixels[t div 2, i div 2]:= 0;
   215                 LandPixels[t div 2, i div 2]:= 0;
   216 
   216 
   217 t:= y - dy;
   217 t:= y - dy;
   218 if (t and LAND_HEIGHT_MASK) = 0 then
   218 if (t and LAND_HEIGHT_MASK) = 0 then
   219     for i:= Min(x + dx, LAND_WIDTH - 1) downto Max(x - dx, 0) do 
   219     for i:= Max(x - dx, 0) to Min(x + dx, LAND_WIDTH - 1) do
   220         if ((Land[t, i] and lfIndestructible) = 0) and (not disableLandBack or (Land[t, i] > 255))  then
   220         if ((Land[t, i] and lfIndestructible) = 0) and (not disableLandBack or (Land[t, i] > 255))  then
   221             if (cReducedQuality and rqBlurryLand) = 0 then
   221             if (cReducedQuality and rqBlurryLand) = 0 then
   222                 LandPixels[t, i]:= 0
   222                 LandPixels[t, i]:= 0
   223             else
   223             else
   224                 LandPixels[t div 2, i div 2]:= 0;
   224                 LandPixels[t div 2, i div 2]:= 0;
   225 
   225 
   226 t:= y + dx;
   226 t:= y + dx;
   227 if (t and LAND_HEIGHT_MASK) = 0 then
   227 if (t and LAND_HEIGHT_MASK) = 0 then
   228     for i:= Min(x + dy, LAND_WIDTH - 1) downto Max(x - dy, 0) do 
   228     for i:= Max(x - dy, 0) to Min(x + dy, LAND_WIDTH - 1) do
   229         if ((Land[t, i] and lfIndestructible) = 0) and (not disableLandBack or (Land[t, i] > 255))  then
   229         if ((Land[t, i] and lfIndestructible) = 0) and (not disableLandBack or (Land[t, i] > 255))  then
   230             if (cReducedQuality and rqBlurryLand) = 0 then
   230             if (cReducedQuality and rqBlurryLand) = 0 then
   231                 LandPixels[t, i]:= 0
   231                 LandPixels[t, i]:= 0
   232             else
   232             else
   233                 LandPixels[t div 2, i div 2]:= 0;
   233                 LandPixels[t div 2, i div 2]:= 0;
   234 
   234 
   235 t:= y - dx;
   235 t:= y - dx;
   236 if (t and LAND_HEIGHT_MASK) = 0 then
   236 if (t and LAND_HEIGHT_MASK) = 0 then
   237     for i:= Min(x + dy, LAND_WIDTH - 1) downto Max(x - dy, 0) do 
   237     for i:= Max(x - dy, 0) to Min(x + dy, LAND_WIDTH - 1) do
   238         if ((Land[t, i] and lfIndestructible) = 0) and (not disableLandBack or (Land[t, i] > 255))  then
   238         if ((Land[t, i] and lfIndestructible) = 0) and (not disableLandBack or (Land[t, i] > 255))  then
   239             if (cReducedQuality and rqBlurryLand) = 0 then
   239             if (cReducedQuality and rqBlurryLand) = 0 then
   240                 LandPixels[t, i]:= 0
   240                 LandPixels[t, i]:= 0
   241             else
   241             else
   242                 LandPixels[t div 2, i div 2]:= 0;
   242                 LandPixels[t div 2, i div 2]:= 0;
   248     cnt: Longword;
   248     cnt: Longword;
   249 begin
   249 begin
   250 cnt:= 0;
   250 cnt:= 0;
   251 t:= y + dy;
   251 t:= y + dy;
   252 if (t and LAND_HEIGHT_MASK) = 0 then
   252 if (t and LAND_HEIGHT_MASK) = 0 then
   253     for i:= Min(x + dx, LAND_WIDTH - 1) downto Max(x - dx, 0) do 
   253     for i:= Max(x - dx, 0) to Min(x + dx, LAND_WIDTH - 1) do
   254         if (Land[t, i] and lfIndestructible) = 0 then
   254         if (Land[t, i] and lfIndestructible) = 0 then
   255             begin
   255             begin
   256             if (cReducedQuality and rqBlurryLand) = 0 then
   256             if (cReducedQuality and rqBlurryLand) = 0 then
   257                 begin
   257                 begin
   258                 by:= t; bx:= i;
   258                 by:= t; bx:= i;
   270                 LandPixels[by, bx]:= 0
   270                 LandPixels[by, bx]:= 0
   271             end;
   271             end;
   272 
   272 
   273 t:= y - dy;
   273 t:= y - dy;
   274 if (t and LAND_HEIGHT_MASK) = 0 then
   274 if (t and LAND_HEIGHT_MASK) = 0 then
   275     for i:= Min(x + dx, LAND_WIDTH - 1) downto Max(x - dx, 0) do 
   275     for i:= Max(x - dx, 0) to Min(x + dx, LAND_WIDTH - 1) do
   276         if (Land[t, i] and lfIndestructible) = 0 then
   276         if (Land[t, i] and lfIndestructible) = 0 then
   277             begin
   277             begin
   278             if (cReducedQuality and rqBlurryLand) = 0 then
   278             if (cReducedQuality and rqBlurryLand) = 0 then
   279                 begin
   279                 begin
   280                 by:= t; bx:= i;
   280                 by:= t; bx:= i;
   292                 LandPixels[by, bx]:= 0
   292                 LandPixels[by, bx]:= 0
   293             end;
   293             end;
   294 
   294 
   295 t:= y + dx;
   295 t:= y + dx;
   296 if (t and LAND_HEIGHT_MASK) = 0 then
   296 if (t and LAND_HEIGHT_MASK) = 0 then
   297     for i:= Min(x + dy, LAND_WIDTH - 1) downto Max(x - dy, 0) do 
   297     for i:= Max(x - dy, 0) to Min(x + dy, LAND_WIDTH - 1) do
   298         if (Land[t, i] and lfIndestructible) = 0 then
   298         if (Land[t, i] and lfIndestructible) = 0 then
   299             begin
   299             begin
   300             if (cReducedQuality and rqBlurryLand) = 0 then
   300             if (cReducedQuality and rqBlurryLand) = 0 then
   301                 begin
   301                 begin
   302                 by:= t; bx:= i;
   302                 by:= t; bx:= i;
   313             else if ((Land[t, i] and lfObject) <> 0) or (((LandPixels[by,bx] and AMask) shr AShift) < 255) then
   313             else if ((Land[t, i] and lfObject) <> 0) or (((LandPixels[by,bx] and AMask) shr AShift) < 255) then
   314                 LandPixels[by, bx]:= 0
   314                 LandPixels[by, bx]:= 0
   315             end;
   315             end;
   316 t:= y - dx;
   316 t:= y - dx;
   317 if (t and LAND_HEIGHT_MASK) = 0 then
   317 if (t and LAND_HEIGHT_MASK) = 0 then
   318     for i:= Min(x + dy, LAND_WIDTH - 1) downto Max(x - dy, 0) do 
   318     for i:= Max(x - dy, 0) to Min(x + dy, LAND_WIDTH - 1) do
   319         if (Land[t, i] and lfIndestructible) = 0 then
   319         if (Land[t, i] and lfIndestructible) = 0 then
   320             begin
   320             begin
   321             if (cReducedQuality and rqBlurryLand) = 0 then
   321             if (cReducedQuality and rqBlurryLand) = 0 then
   322                 begin
   322                 begin
   323                 by:= t; bx:= i;
   323                 by:= t; bx:= i;
   340 procedure FillLandCircleLinesEBC(x, y, dx, dy: LongInt);
   340 procedure FillLandCircleLinesEBC(x, y, dx, dy: LongInt);
   341 var i, t: LongInt;
   341 var i, t: LongInt;
   342 begin
   342 begin
   343 t:= y + dy;
   343 t:= y + dy;
   344 if (t and LAND_HEIGHT_MASK) = 0 then
   344 if (t and LAND_HEIGHT_MASK) = 0 then
   345     for i:= Min(x + dx, LAND_WIDTH - 1) downto Max(x - dx, 0) do 
   345     for i:= Max(x - dx, 0) to Min(x + dx, LAND_WIDTH - 1) do
   346         if ((Land[t, i] and lfBasic) <> 0) or ((Land[t, i] and lfObject) <> 0) then
   346         if ((Land[t, i] and lfBasic) <> 0) or ((Land[t, i] and lfObject) <> 0) then
   347             begin
   347             begin
   348             if (cReducedQuality and rqBlurryLand) = 0 then
   348             if (cReducedQuality and rqBlurryLand) = 0 then
   349                 LandPixels[t, i]:= ExplosionBorderColor
   349                 LandPixels[t, i]:= ExplosionBorderColor
   350             else
   350             else
   355             LandDirty[t div 32, i div 32]:= 1;
   355             LandDirty[t div 32, i div 32]:= 1;
   356             end;
   356             end;
   357 
   357 
   358 t:= y - dy;
   358 t:= y - dy;
   359 if (t and LAND_HEIGHT_MASK) = 0 then
   359 if (t and LAND_HEIGHT_MASK) = 0 then
   360     for i:= Min(x + dx, LAND_WIDTH - 1) downto Max(x - dx, 0) do 
   360     for i:= Max(x - dx, 0) to Min(x + dx, LAND_WIDTH - 1) do
   361         if ((Land[t, i] and lfBasic) <> 0) or ((Land[t, i] and lfObject) <> 0) then
   361         if ((Land[t, i] and lfBasic) <> 0) or ((Land[t, i] and lfObject) <> 0) then
   362             begin
   362             begin
   363             if (cReducedQuality and rqBlurryLand) = 0 then
   363             if (cReducedQuality and rqBlurryLand) = 0 then
   364                 LandPixels[t, i]:= ExplosionBorderColor
   364                 LandPixels[t, i]:= ExplosionBorderColor
   365             else
   365             else
   369             LandDirty[t div 32, i div 32]:= 1;
   369             LandDirty[t div 32, i div 32]:= 1;
   370             end;
   370             end;
   371 
   371 
   372 t:= y + dx;
   372 t:= y + dx;
   373 if (t and LAND_HEIGHT_MASK) = 0 then
   373 if (t and LAND_HEIGHT_MASK) = 0 then
   374     for i:= Min(x + dy, LAND_WIDTH - 1) downto Max(x - dy, 0) do 
   374     for i:= Max(x - dy, 0) to Min(x + dy, LAND_WIDTH - 1) do
   375         if ((Land[t, i] and lfBasic) <> 0) or ((Land[t, i] and lfObject) <> 0) then
   375         if ((Land[t, i] and lfBasic) <> 0) or ((Land[t, i] and lfObject) <> 0) then
   376             begin
   376             begin
   377             if (cReducedQuality and rqBlurryLand) = 0 then
   377             if (cReducedQuality and rqBlurryLand) = 0 then
   378                 LandPixels[t, i]:= ExplosionBorderColor
   378                 LandPixels[t, i]:= ExplosionBorderColor
   379             else
   379             else
   384             LandDirty[t div 32, i div 32]:= 1;
   384             LandDirty[t div 32, i div 32]:= 1;
   385             end;
   385             end;
   386 
   386 
   387 t:= y - dx;
   387 t:= y - dx;
   388 if (t and LAND_HEIGHT_MASK) = 0 then
   388 if (t and LAND_HEIGHT_MASK) = 0 then
   389     for i:= Min(x + dy, LAND_WIDTH - 1) downto Max(x - dy, 0) do 
   389     for i:= Max(x - dy, 0) to Min(x + dy, LAND_WIDTH - 1) do
   390         if ((Land[t, i] and lfBasic) <> 0) or ((Land[t, i] and lfObject) <> 0) then
   390         if ((Land[t, i] and lfBasic) <> 0) or ((Land[t, i] and lfObject) <> 0) then
   391             begin
   391             begin
   392             if (cReducedQuality and rqBlurryLand) = 0 then
   392             if (cReducedQuality and rqBlurryLand) = 0 then
   393                 LandPixels[t, i]:= ExplosionBorderColor
   393                 LandPixels[t, i]:= ExplosionBorderColor
   394             else
   394             else
   487 procedure DrawHLinesExplosions(ar: PRangeArray; Radius: LongInt; y, dY: LongInt; Count: Byte);
   487 procedure DrawHLinesExplosions(ar: PRangeArray; Radius: LongInt; y, dY: LongInt; Count: Byte);
   488 var tx, ty, by, bx,  i: LongInt;
   488 var tx, ty, by, bx,  i: LongInt;
   489 begin
   489 begin
   490 for i:= 0 to Pred(Count) do
   490 for i:= 0 to Pred(Count) do
   491     begin
   491     begin
   492     for ty:= Min(y + Radius, LAND_HEIGHT) downto Max(y - Radius, 0) do 
   492     for ty:= Max(y - Radius, 0) to Min(y + Radius, LAND_HEIGHT) do
   493         for tx:= Min(LAND_WIDTH, ar^[i].Right + Radius) downto Max(0, ar^[i].Left - Radius) do 
   493         for tx:= Max(0, ar^[i].Left - Radius) to Min(LAND_WIDTH, ar^[i].Right + Radius) do
   494             begin
   494             begin
   495             if (Land[ty, tx] and lfIndestructible) = 0 then
   495             if (Land[ty, tx] and lfIndestructible) = 0 then
   496                 begin
   496                 begin
   497                 if (cReducedQuality and rqBlurryLand) = 0 then
   497                 if (cReducedQuality and rqBlurryLand) = 0 then
   498                     begin
   498                     begin
   514 inc(Radius, 4);
   514 inc(Radius, 4);
   515 dec(y, Count * dY);
   515 dec(y, Count * dY);
   516 
   516 
   517 for i:= 0 to Pred(Count) do
   517 for i:= 0 to Pred(Count) do
   518     begin
   518     begin
   519     for ty:= Min(y + Radius, LAND_HEIGHT) downto Max(y - Radius, 0) do 
   519     for ty:= Max(y - Radius, 0) to Min(y + Radius, LAND_HEIGHT) do
   520         for tx:= Min(LAND_WIDTH, ar^[i].Right + Radius) downto Max(0, ar^[i].Left - Radius) do 
   520         for tx:= Max(0, ar^[i].Left - Radius) to Min(LAND_WIDTH, ar^[i].Right + Radius) do
   521             if ((Land[ty, tx] and lfBasic) <> 0) or ((Land[ty, tx] and lfObject) <> 0) then
   521             if ((Land[ty, tx] and lfBasic) <> 0) or ((Land[ty, tx] and lfObject) <> 0) then
   522                 begin
   522                 begin
   523                  if (cReducedQuality and rqBlurryLand) = 0 then
   523                  if (cReducedQuality and rqBlurryLand) = 0 then
   524                     LandPixels[ty, tx]:= ExplosionBorderColor
   524                     LandPixels[ty, tx]:= ExplosionBorderColor
   525                 else
   525                 else