Fix Lint broken by b662a4577d692329b9ca83525e6039f2ddcd1ac1
[oweals/minetest.git] / src / mapnode.h
index 82c53e7d4474b4fc86a9e11fe14e093f5f841cb8..9c56a7e170c9b4b73d8b5217041356e27ee328d1 100644 (file)
@@ -20,14 +20,13 @@ with this program; if not, write to the Free Software Foundation, Inc.,
 #ifndef MAPNODE_HEADER
 #define MAPNODE_HEADER
 
-#include "irrlichttypes.h"
-#include "irr_v3d.h"
-#include "irr_aabb3d.h"
+#include "irrlichttypes_bloated.h"
 #include "light.h"
 #include <string>
 #include <vector>
 
 class INodeDefManager;
+class Map;
 
 /*
        Naming scheme:
@@ -142,11 +141,6 @@ struct MapNode
        MapNode()
        { }
 
-       MapNode(const MapNode & n)
-       {
-               *this = n;
-       }
-
        MapNode(content_t content, u8 a_param1=0, u8 a_param2=0)
                : param0(content),
                  param1(a_param1),
@@ -191,9 +185,34 @@ struct MapNode
                param2 = p;
        }
 
+       /*!
+        * Returns the color of the node.
+        *
+        * \param f content features of this node
+        * \param color output, contains the node's color.
+        */
+       void getColor(const ContentFeatures &f, video::SColor *color) const;
+
+       void setLight(enum LightBank bank, u8 a_light, const ContentFeatures &f);
+
        void setLight(enum LightBank bank, u8 a_light, INodeDefManager *nodemgr);
+
+       /**
+        * Check if the light value for night differs from the light value for day.
+        *
+        * @return If the light values are equal, returns true; otherwise false
+        */
+       bool isLightDayNightEq(INodeDefManager *nodemgr) const;
+
        u8 getLight(enum LightBank bank, INodeDefManager *nodemgr) const;
 
+       /*!
+        * Returns the node's light level from param1.
+        * If the node emits light, it is ignored.
+        * \param f the ContentFeatures of this node.
+        */
+       u8 getLightRaw(enum LightBank bank, const ContentFeatures &f) const;
+
        /**
         * This function differs from getLight(enum LightBank bank, INodeDefManager *nodemgr)
         * in that the ContentFeatures of the node in question are not retrieved by
@@ -209,7 +228,7 @@ struct MapNode
         * @pre f != NULL
         * @pre f->param_type == CPT_LIGHT
         */
-       u8 getLightNoChecks(LightBank bank, const ContentFeatures *f);
+       u8 getLightNoChecks(LightBank bank, const ContentFeatures *f) const;
 
        bool getLightBanks(u8 &lightday, u8 &lightnight, INodeDefManager *nodemgr) const;
 
@@ -229,20 +248,27 @@ struct MapNode
 
        void rotateAlongYAxis(INodeDefManager *nodemgr, Rotation rot);
 
+       /*!
+        * Checks which neighbors does this node connect to.
+        *
+        * \param p coordinates of the node
+        */
+       u8 getNeighbors(v3s16 p, Map *map);
+
        /*
                Gets list of node boxes (used for rendering (NDT_NODEBOX))
        */
-       std::vector<aabb3f> getNodeBoxes(INodeDefManager *nodemgr) const;
+       void getNodeBoxes(INodeDefManager *nodemgr, std::vector<aabb3f> *boxes, u8 neighbors = 0);
 
        /*
                Gets list of selection boxes
        */
-       std::vector<aabb3f> getSelectionBoxes(INodeDefManager *nodemgr) const;
+       void getSelectionBoxes(INodeDefManager *nodemg, std::vector<aabb3f> *boxes, u8 neighbors = 0);
 
        /*
                Gets list of collision boxes
        */
-       std::vector<aabb3f> getCollisionBoxes(INodeDefManager *nodemgr) const;
+       void getCollisionBoxes(INodeDefManager *nodemgr, std::vector<aabb3f> *boxes, u8 neighbors = 0);
 
        /*
                Liquid helpers