Use all pixels, not only 8x8 areas
authorunc0rr
Fri, 28 Feb 2014 14:03:21 +0400
changeset 10165 e84f9b928ad3
parent 10164 0570d4b22187
child 10166 4be4a3302ff8
Use all pixels, not only 8x8 areas
hedgewars/uLand.pas
--- a/hedgewars/uLand.pas	Fri Feb 28 13:55:16 2014 +0400
+++ b/hedgewars/uLand.pas	Fri Feb 28 14:03:21 2014 +0400
@@ -902,13 +902,13 @@
             begin
             t:= 0;
 
-            for yy:= y * lh - oy to y * lh + 7 - oy do
-                for xx:= x * lw - ox to x * lw + 7 - ox do
+            for yy:= y * lh - oy to y * lh + lh - 1 - oy do
+                for xx:= x * lw - ox to x * lw + lw - 1 - ox do
                     if (yy and LAND_HEIGHT_MASK = 0) and (xx and LAND_WIDTH_MASK = 0)
                         and (Land[yy, xx] <> 0) then
                         inc(t);
 
-            Preview[y, x]:= t * 1023 div 256;
+            Preview[y, x]:= t * 255 div (lh * lw);
             end;
 end;