# HG changeset patch # User nemo # Date 1309472441 14400 # Node ID 30752b2e99b32498e49ab63bf6482e4416f346a5 # Parent 5f0c46e78e50e3bf17e00d72a9ee6fa27a42e298 Sweep all pixels at 0 or 1 neighbours, whether damaged or not. Intended to handled output of Smooth, might be nice to cut down on the counting somehow though. diff -r 5f0c46e78e50 -r 30752b2e99b3 hedgewars/uLandGraphics.pas --- a/hedgewars/uLandGraphics.pas Thu Jun 30 05:26:36 2011 +0200 +++ b/hedgewars/uLandGraphics.pas Thu Jun 30 18:20:41 2011 -0400 @@ -715,9 +715,7 @@ yy:= Y div 2; end; pixelsweep:= ((Land[Y, X] and $FF00) = 0) and (LandPixels[yy, xx] <> 0); -if ((((Land[Y, X] and lfDamaged) <> 0) or - (((Land[Y, X] and lfBasic) <> 0) and (LandPixels[yy,xx] <> 0) and ((LandPixels[yy,xx] and AMask) shl AShift < 255))) - and ((Land[Y, X] and lfIndestructible) = 0)) or pixelsweep then +if ((Land[Y, X] > 255) and ((Land[Y, X] and lfIndestructible) = 0)) or pixelsweep then begin c:= 0; for i:= -1 to 1 do @@ -740,8 +738,8 @@ else if Land[ny, nx] > 255 then inc(c); end end; - - if c < 4 then // 0-3 neighbours + if (c < 2) or + ((c < 4) and (((Land[Y, X] and lfDamaged) <> 0) or pixelsweep)) then begin if ((Land[Y, X] and lfBasic) <> 0) and not disableLandBack then LandPixels[yy, xx]:= LandBackPixel(X, Y)