Commented out debug statements again
[oweals/minetest.git] / src / mapnode.h
index 3b7ef58787899aa0780f3a0d8fd5e227c9c57cc0..19dfb28025c199d5e0cb23aa46fff5d6dcb6ce13 100644 (file)
@@ -96,7 +96,7 @@ enum LiquidType
        LIQUID_SOURCE
 };
 
-class MapNode;
+struct MapNode;
 class NodeMetadata;
 
 struct ContentFeatures
@@ -115,11 +115,13 @@ struct ContentFeatures
        TileSpec tiles[6];
        
        video::ITexture *inventory_texture;
-
+       
+       // True for all ground-like things like stone and mud, false for eg. trees
        bool is_ground_content;
        bool light_propagates;
        bool sunlight_propagates;
        u8 solidness; // Used when choosing which face is drawn
+       u8 visual_solidness; // When solidness=0, this tells how it looks like
        // This is used for collision detection.
        // Also for general solidness queries.
        bool walkable;
@@ -127,6 +129,8 @@ struct ContentFeatures
        bool pointable;
        // Player can dig these
        bool diggable;
+       // Player can climb these
+       bool climbable;
        // Player can build on these
        bool buildable_to;
        // Whether the node has no liquid, source liquid or flowing liquid
@@ -150,12 +154,25 @@ struct ContentFeatures
        content_t liquid_alternative_flowing;
        // If the content is liquid, this is the source version of the liquid.
        content_t liquid_alternative_source;
+       // Viscosity for fluid flow, ranging from 1 to 7, with
+       // 1 giving almost instantaneous propagation and 7 being
+       // the slowest possible
+       u8 liquid_viscosity;
+       // Used currently for flowing liquids
+       u8 vertex_alpha;
+       // Post effect color, drawn when the camera is inside the node.
+       video::SColor post_effect_color;
+       // Special irrlicht material, used sometimes
+       video::SMaterial *special_material;
+       AtlasPointer *special_atlas;
        
        // Amount of light the node emits
        u8 light_source;
        
        // Digging properties for different tools
        DiggingPropertiesList digging_properties;
+
+       u32 damage_per_second;
        
        // NOTE: Move relevant properties to here from elsewhere
 
@@ -167,9 +184,11 @@ struct ContentFeatures
                light_propagates = false;
                sunlight_propagates = false;
                solidness = 2;
+               visual_solidness = 0;
                walkable = true;
                pointable = true;
                diggable = true;
+               climbable = false;
                buildable_to = false;
                liquid_type = LIQUID_NONE;
                wall_mounted = false;
@@ -177,8 +196,15 @@ struct ContentFeatures
                dug_item = "";
                initial_metadata = NULL;
                liquid_alternative_flowing = CONTENT_IGNORE;
+               liquid_alternative_source = CONTENT_IGNORE;
+               liquid_viscosity = 0;
+               vertex_alpha = 255;
+               post_effect_color = video::SColor(0, 0, 0, 0);
+               special_material = NULL;
+               special_atlas = NULL;
                light_source = 0;
                digging_properties.clear();
+               damage_per_second = 0;
        }
 
        ContentFeatures()
@@ -390,6 +416,9 @@ inline v3s16 unpackDir(u8 b)
        facedir: CPT_FACEDIR_SIMPLE param1 value
        dir: The face for which stuff is wanted
        return value: The face from which the stuff is actually found
+
+       NOTE: Currently this uses 2 bits for Z-,X-,Z+,X+, should there be Y+
+             and Y- too?
 */
 v3s16 facedir_rotate(u8 facedir, v3s16 dir);
 
@@ -399,10 +428,21 @@ enum LightBank
        LIGHTBANK_NIGHT
 };
 
+/*
+       Masks for MapNode.param2 of flowing liquids
+ */
+#define LIQUID_LEVEL_MASK 0x07
+#define LIQUID_FLOW_DOWN_MASK 0x08
+
+/* maximum amount of liquid in a block */
+#define LIQUID_LEVEL_MAX LIQUID_LEVEL_MASK
+#define LIQUID_LEVEL_SOURCE (LIQUID_LEVEL_MAX+1)
+
 /*
        This is the stuff what the whole world consists of.
 */
 
+
 struct MapNode
 {
        /*