Move tool stuff to tool.{h,cpp}
[oweals/minetest.git] / src / mapblock_mesh.cpp
index 7ee49986f1465ef2d4b5e34d6a3c26df4c26b0a2..c81d5adc16e59fa542a851ac36759bda718d9708 100644 (file)
@@ -25,6 +25,7 @@ with this program; if not, write to the Free Software Foundation, Inc.,
 #include "content_mapblock.h"
 #include "settings.h"
 #include "profiler.h"
+#include "mapnode_contentfeatures.h"
 
 void MeshMakeData::fill(u32 daynight_ratio, MapBlock *block)
 {
@@ -427,7 +428,8 @@ void getTileInfo(
        // This is hackish
        content_t content0 = getNodeContent(p, n0, temp_mods);
        content_t content1 = getNodeContent(p + face_dir, n1, temp_mods);
-       u8 mf = face_contents(content0, content1);
+       bool equivalent = false;
+       u8 mf = face_contents(content0, content1, &equivalent);
 
        if(mf == 0)
        {
@@ -450,6 +452,10 @@ void getTileInfo(
                face_dir_corrected = -face_dir;
        }
        
+       // eg. water and glass
+       if(equivalent)
+               tile.material_flags |= MATERIAL_FLAG_BACKFACE_CULLING;
+       
        if(smooth_lighting == false)
        {
                lights[0] = lights[1] = lights[2] = lights[3] =