Generic NodeMetadata text input
[oweals/minetest.git] / src / map.cpp
index 3ecdfa00fc5f365db47f7d7eb1337cb710d1dde5..858c08b63705d4f3ca3414960e2649767ee85176 100644 (file)
@@ -37,6 +37,7 @@ with this program; if not, write to the Free Software Foundation, Inc.,
 #include "settings.h"
 #include "log.h"
 #include "profiler.h"
+#include "mapnode_contentfeatures.h"
 
 #define PP(x) "("<<(x).X<<","<<(x).Y<<","<<(x).Z<<")"
 
@@ -1773,7 +1774,7 @@ void Map::transformLiquids(core::map<v3s16, MapBlock*> & modified_blocks)
                /*
                        update the current node
                 */
-               bool flow_down_enabled = (flowing_down && ((n0.param2 & LIQUID_FLOW_DOWN_MASK) != LIQUID_FLOW_DOWN_MASK));
+               //bool flow_down_enabled = (flowing_down && ((n0.param2 & LIQUID_FLOW_DOWN_MASK) != LIQUID_FLOW_DOWN_MASK));
                if (content_features(new_node_content).liquid_type == LIQUID_FLOWING) {
                        // set level to last 3 bits, flowing down bit to 4th bit
                        n0.param2 = (flowing_down ? LIQUID_FLOW_DOWN_MASK : 0x00) | (new_node_level & LIQUID_LEVEL_MASK);
@@ -3786,9 +3787,6 @@ void ClientMap::renderMap(video::IVideoDriver* driver, s32 pass)
 
                        blocks_in_range++;
                        
-                       // This block is in range. Reset usage timer.
-                       block->resetUsageTimer();
-
 #if 1
                        /*
                                Update expired mesh (used for day/night change)
@@ -3844,10 +3842,10 @@ void ClientMap::renderMap(video::IVideoDriver* driver, s32 pass)
                                Occlusion culling
                        */
 
-                       v3s16 cpn = v3s16(block->getPos() * MAP_BLOCKSIZE)
-                                       + v3s16(MAP_BLOCKSIZE)/2;
+                       v3s16 cpn = block->getPos() * MAP_BLOCKSIZE;
+                       cpn += v3s16(MAP_BLOCKSIZE/2, MAP_BLOCKSIZE/2, MAP_BLOCKSIZE/2);
                        float step = BS*1;
-                       float stepfac = 1.2;
+                       float stepfac = 1.1;
                        float startoff = BS*1;
                        float endoff = -BS*MAP_BLOCKSIZE*1.42*1.42;
                        v3s16 spn = cam_pos_nodes + v3s16(0,0,0);
@@ -3878,6 +3876,9 @@ void ClientMap::renderMap(video::IVideoDriver* driver, s32 pass)
                                continue;
                        }
                        
+                       // This block is in range. Reset usage timer.
+                       block->resetUsageTimer();
+
                        /*
                                Ignore if mesh doesn't exist
                        */