hedgewars/uLandGraphics.pas
changeset 2167 4e9ad395c1d1
parent 1892 fddc1201df25
child 2235 79c9542c1058
--- 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;