]> git.lizzy.rs Git - dragonfireclient.git/blobdiff - src/mapnode.h
mapgen tweaking
[dragonfireclient.git] / src / mapnode.h
index 37a0b3aa6529bdb8046adb27ffdd1eb7ba1cc2e7..03a294ad27bddc2b4fc6575540ab3c47439031df 100644 (file)
@@ -154,7 +154,13 @@ struct ContentFeatures
        bool diggable;
        bool buildable_to;
        enum LiquidType liquid_type;
-       bool wall_mounted; // If true, param2 is set to direction when placed
+       // If true, param2 is set to direction when placed
+       // NOTE: the direction format is quite inefficient and should be changed
+       bool wall_mounted;
+       
+       // Inventory item string as which the node appears in inventory when dug.
+       // Mineral overrides this.
+       std::string dug_item;
 
        //TODO: Move more properties here
 
@@ -173,6 +179,7 @@ struct ContentFeatures
                buildable_to = false;
                liquid_type = LIQUID_NONE;
                wall_mounted = false;
+               dug_item = "";
        }
 
        ~ContentFeatures();
@@ -191,23 +198,6 @@ struct ContentFeatures
                }
        }
 
-       /*void setTexture(u16 i, AtlasPointer p, u8 alpha=255)
-       {
-               tiles[i].texture = p;
-               if(alpha != 255)
-               {
-                       tiles[i].alpha = alpha;
-                       tiles[i].material_type = MATERIAL_ALPHA_VERTEX;
-               }
-       }
-       void setAllTextures(AtlasPointer p, u8 alpha=255)
-       {
-               for(u16 i=0; i<6; i++)
-               {
-                       setTexture(i, p, alpha);
-               }
-       }*/
-
        void setTile(u16 i, const TileSpec &tile)
        {
                tiles[i] = tile;
@@ -676,32 +666,6 @@ struct MapNode
        }
 };
 
-/*
-       Returns integer position of the node in given
-       floating point position.
-*/
-inline v3s16 floatToInt(v3f p)
-{
-       v3s16 p2(
-               (p.X + (p.X>0 ? BS/2 : -BS/2))/BS,
-               (p.Y + (p.Y>0 ? BS/2 : -BS/2))/BS,
-               (p.Z + (p.Z>0 ? BS/2 : -BS/2))/BS);
-       return p2;
-}
-
-/*
-       The same thing backwards
-*/
-inline v3f intToFloat(v3s16 p)
-{
-       v3f p2(
-               p.X * BS,
-               p.Y * BS,
-               p.Z * BS
-       );
-       return p2;
-}
-
 
 
 #endif