Tweak to land texturing. Treat any non-lfBasic as edge
authornemo
Wed, 24 Dec 2014 14:42:05 -0500
changeset 10717 0810826cdf80
parent 10716 01f99668cbe0
child 10718 40dda24ee145
Tweak to land texturing. Treat any non-lfBasic as edge
hedgewars/uConsts.pas
hedgewars/uLand.pas
--- a/hedgewars/uConsts.pas	Wed Dec 24 13:24:38 2014 -0500
+++ b/hedgewars/uConsts.pas	Wed Dec 24 14:42:05 2014 -0500
@@ -105,9 +105,9 @@
 // To allow these to layer, going to treat them as masks. The bottom byte is reserved for objects
 // TODO - set lfBasic for all solid land, ensure all uses of the flags can handle multiple flag bits
 // lfObject and lfBasic are only to be different *graphically*  in all other ways they should be treated the same
-    lfBasic          = $8000;  // white
+    lfBasic          = $8000;  // black
     lfIndestructible = $4000;  // red
-    lfObject         = $2000;
+    lfObject         = $2000;  // white
     lfDamaged        = $1000;  //
     lfIce            = $0800;  // blue
     lfBouncy         = $0400;  // green
--- a/hedgewars/uLand.pas	Wed Dec 24 13:24:38 2014 -0500
+++ b/hedgewars/uLand.pas	Wed Dec 24 14:42:05 2014 -0500
@@ -56,18 +56,18 @@
     begin
         yd:= LAND_HEIGHT - 1;
         repeat
-            while (yd > 0) and (Land[yd, x] =  0) do dec(yd);
+            while (yd > 0) and (Land[yd, x] <> lfBasic) do dec(yd);
 
             if (yd < 0) then
                 yd:= 0;
 
-            while (yd < LAND_HEIGHT) and (Land[yd, x] <> 0) do
+            while (yd < LAND_HEIGHT) and (Land[yd, x] = lfBasic) do
                 inc(yd);
             dec(yd);
             yu:= yd;
 
-            while (yu > 0  ) and (Land[yu, x] <> 0) do dec(yu);
-            while (yu < yd ) and (Land[yu, x] =  0) do inc(yu);
+            while (yu > 0  ) and (Land[yu, x] = lfBasic) do dec(yu);
+            while (yu < yd ) and (Land[yu, x] <>  lfBasic) do inc(yu);
 
             if (yd < LAND_HEIGHT - 1) and ((yd - yu) >= 16) then
                 begin