hedgewars/uLandGraphics.pas
changeset 5895 212d3b459658
parent 5887 7d69b76ce923
child 6011 519f8a58c021
--- a/hedgewars/uLandGraphics.pas	Wed Sep 14 00:06:26 2011 +0200
+++ b/hedgewars/uLandGraphics.pas	Tue Sep 13 21:25:13 2011 -0400
@@ -832,16 +832,6 @@
 begin
 bRes:= false;
 reCheck:= true;
-for y:= 0 to LAND_HEIGHT div 32 - 1 do
-    for x:= 0 to LAND_WIDTH div 32 - 1 do
-        if LandDirty[y, x] <> 0 then
-            begin
-            ty:= y * 32;
-            tx:= x * 32;
-            for yy:= ty to ty + 31 do
-                for xx:= tx to tx + 31 do
-                    Smooth(xx,yy)
-            end;
 
 while recheck do
     begin
@@ -850,7 +840,7 @@
         begin
         for x:= 0 to LAND_WIDTH div 32 - 1 do
             begin
-            if LandDirty[y, x] <> 0 then
+            if LandDirty[y, x] = 1 then
                 begin
                 updateBlock:= false;
                 resweep:= true;
@@ -889,12 +879,24 @@
                                 end;
                     end;
                 if updateBlock then UpdateLandTexture(tx, 32, ty, 32);
-                LandDirty[y, x]:= 0;
+                LandDirty[y, x]:= 2;
                 end;
             end;
         end;
      end;
 
+for y:= 0 to LAND_HEIGHT div 32 - 1 do
+    for x:= 0 to LAND_WIDTH div 32 - 1 do
+        if LandDirty[y, x] <> 0 then
+            begin
+            LandDirty[y, x]:= 0;
+            ty:= y * 32;
+            tx:= x * 32;
+            for yy:= ty to ty + 31 do
+                for xx:= tx to tx + 31 do
+                    Smooth(xx,yy)
+            end;
+
 SweepDirty:= bRes;
 end;