# HG changeset patch # User nemo # Date 1245099837 0 # Node ID 4e9ad395c1d1947e18001f1b059fa18601975b9b # Parent 95f1f4d37e867c532a08dccd1e72ab9b32864238 Loop sweeping to avoid stray pixels. Avoided at first hoping there was a cleverer approach. Fortunately sweep is infrequent. diff -r 95f1f4d37e86 -r 4e9ad395c1d1 hedgewars/uLandGraphics.pas --- a/hedgewars/uLandGraphics.pas Mon Jun 15 14:02:48 2009 +0000 +++ b/hedgewars/uLandGraphics.pas Mon Jun 15 21:03:57 2009 +0000 @@ -439,7 +439,7 @@ function SweepDirty: boolean; var x, y, xx, yy: LongInt; - Result, updateBlock: boolean; + Result, updateBlock, resweep: boolean; begin Result:= false; @@ -451,13 +451,19 @@ if LandDirty[y, x] <> 0 then begin updateBlock:= false; - for yy:= y * 32 to y * 32 + 31 do - for xx:= x * 32 to x * 32 + 31 do - if Despeckle(xx, yy) then - begin - Result:= true; - updateBlock:= true; - end; + resweep:= true; + while(resweep) do + begin + resweep:= false; + for yy:= y * 32 to y * 32 + 31 do + for xx:= x * 32 to x * 32 + 31 do + if Despeckle(xx, yy) then + begin + Result:= true; + updateBlock:= true; + resweep:= true; + end; + end; if updateBlock then UpdateLandTexture(x * 32, 32, y * 32, 32); LandDirty[y, x]:= 0; end;