]> git.lizzy.rs Git - minetest.git/blobdiff - src/mapblock.h
MeshUpdateQueue: Add a MapBlock cache that minimizes the amount of MapBlock copying...
[minetest.git] / src / mapblock.h
index be2edc791b4aef25163af8c9a99e1870b4b81fba..8816dc817f7ef7f7f18b3ca44c4972dc50028a3f 100644 (file)
@@ -32,6 +32,7 @@ with this program; if not, write to the Free Software Foundation, Inc.,
 #include "modifiedstate.h"
 #include "util/numeric.h" // getContainerPos
 #include "settings.h"
+#include "mapgen.h"
 
 class Map;
 class NodeMetadataList;
@@ -153,6 +154,11 @@ class MapBlock /*: public NodeContainer*/
                raiseModified(MOD_STATE_WRITE_NEEDED, MOD_REASON_REALLOCATE);
        }
 
+       MapNode* getData()
+       {
+               return data;
+       }
+
        ////
        //// Modification tracking methods
        ////
@@ -632,9 +638,10 @@ class MapBlock /*: public NodeContainer*/
        /*!
         * Each bit indicates if light spreading was finished
         * in a direction. (Because the neighbor could also be unloaded.)
-        * Bits: day X+, day Y+, day Z+, day Z-, day Y-, day X-,
-        * night X+, night Y+, night Z+, night Z-, night Y-, night X-,
-        * nothing, nothing, nothing, nothing.
+        * Bits (most significant first):
+        * nothing,  nothing,  nothing,  nothing,
+        * night X-, night Y-, night Z-, night Z+, night Y+, night X+,
+        * day X-,   day Y-,   day Z-,   day Z+,   day Y+,   day X+.
        */
        u16 m_lighting_complete;
 
@@ -689,19 +696,6 @@ inline bool blockpos_over_max_limit(v3s16 p)
                p.Z >  max_limit_bp;
 }
 
-inline bool blockpos_over_mapgen_limit(v3s16 p)
-{
-       const s16 mapgen_limit_bp = rangelim(
-               g_settings->getS16("map_generation_limit"), 0, MAX_MAP_GENERATION_LIMIT) /
-               MAP_BLOCKSIZE;
-       return p.X < -mapgen_limit_bp ||
-               p.X >  mapgen_limit_bp ||
-               p.Y < -mapgen_limit_bp ||
-               p.Y >  mapgen_limit_bp ||
-               p.Z < -mapgen_limit_bp ||
-               p.Z >  mapgen_limit_bp;
-}
-
 /*
        Returns the position of the block where the node is located
 */