smoothing should be after despeckling
authornemo
Tue, 13 Sep 2011 21:25:13 -0400
changeset 5895 212d3b459658
parent 5894 86c59c34cdd5
child 5896 9ce1cf4e5a32
child 5897 0e0fc7e08a3d
smoothing should be after despeckling
hedgewars/uLandGraphics.pas
--- 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;