hedgewars/uLandGraphics.pas
changeset 5364 30752b2e99b3
parent 5349 ce527b35d063
child 5384 83d3b50d7e24
equal deleted inserted replaced
5362:5f0c46e78e50 5364:30752b2e99b3
   713    begin
   713    begin
   714    xx:= X div 2;
   714    xx:= X div 2;
   715    yy:= Y div 2;
   715    yy:= Y div 2;
   716    end;
   716    end;
   717 pixelsweep:= ((Land[Y, X] and $FF00) = 0) and (LandPixels[yy, xx] <> 0);
   717 pixelsweep:= ((Land[Y, X] and $FF00) = 0) and (LandPixels[yy, xx] <> 0);
   718 if ((((Land[Y, X] and lfDamaged) <> 0) or 
   718 if ((Land[Y, X] > 255) and ((Land[Y, X] and lfIndestructible) = 0)) or pixelsweep then
   719     (((Land[Y, X] and lfBasic) <> 0) and (LandPixels[yy,xx] <> 0) and ((LandPixels[yy,xx] and AMask) shl AShift < 255)))
       
   720     and ((Land[Y, X] and lfIndestructible) = 0)) or pixelsweep then
       
   721     begin
   719     begin
   722     c:= 0;
   720     c:= 0;
   723     for i:= -1 to 1 do
   721     for i:= -1 to 1 do
   724         for j:= -1 to 1 do
   722         for j:= -1 to 1 do
   725             if (i <> 0) or (j <> 0) then
   723             if (i <> 0) or (j <> 0) then
   738                         if LandPixels[ny, nx] <> 0 then inc(c);
   736                         if LandPixels[ny, nx] <> 0 then inc(c);
   739                         end
   737                         end
   740                     else if Land[ny, nx] > 255 then inc(c);
   738                     else if Land[ny, nx] > 255 then inc(c);
   741                     end
   739                     end
   742                 end;
   740                 end;
   743 
   741     if (c < 2) or
   744     if c < 4 then // 0-3 neighbours
   742        ((c < 4) and (((Land[Y, X] and lfDamaged) <> 0) or pixelsweep)) then
   745         begin
   743         begin
   746         if ((Land[Y, X] and lfBasic) <> 0) and not disableLandBack then
   744         if ((Land[Y, X] and lfBasic) <> 0) and not disableLandBack then
   747             LandPixels[yy, xx]:= LandBackPixel(X, Y)
   745             LandPixels[yy, xx]:= LandBackPixel(X, Y)
   748         else
   746         else
   749             LandPixels[yy, xx]:= 0;
   747             LandPixels[yy, xx]:= 0;