Remove new_style_water
authorRealBadAngel <maciej.kasatkin@o2.pl>
Sun, 21 Feb 2016 06:34:29 +0000 (07:34 +0100)
committerparamat <mat.gregory@virginmedia.com>
Fri, 26 Feb 2016 00:50:46 +0000 (00:50 +0000)
builtin/settingtypes.txt
minetest.conf.example
src/content_mapblock.cpp
src/defaultsettings.cpp
src/nodedef.cpp

index 9e1997cc6f6600ea287efdccce270d84cc77fe36..003a6685e5f99b21aa88dfb10cd24eb2dc03406e 100644 (file)
@@ -255,11 +255,6 @@ serverlist_file (Serverlist file) string favoriteservers.txt
 #    Whether to fog out the end of the visible area.
 enable_fog (Fog) bool true
 
-#    Enable a bit lower water surface, so it doesn't "fill" the node completely.
-#    Note that this is not quite optimized and that smooth lighting on the
-#    water surface doesn't work with this.
-new_style_water (New style water) bool false
-
 #    Leaves style:
 #    -   Fancy:  all faces visible
 #    -   Simple: only outer faces, if defined special_tiles are used
index ee60545365042c2216d7acb7aeed3b8a08c6d000..5cf43aca61d9446f6e035d6f846ec41f5a08d8f7 100644 (file)
 #    type: bool
 # enable_fog = true
 
-#    Enable a bit lower water surface, so it doesn't "fill" the node completely.
-#    Note that this is not quite optimized and that smooth lighting on the
-#    water surface doesn't work with this.
-#    type: bool
-# new_style_water = false
-
 #    Leaves style:
 #    -   Fancy:  all faces visible
 #    -   Simple: only outer faces, if defined special_tiles are used
index ab8091dee87eda4203ab9e4e7b0a7aa8cbc1b646..c15b9c4240c9f7c170b86ac770c140d8174cafd0 100644 (file)
@@ -181,11 +181,6 @@ void mapblock_mesh_generate_special(MeshMakeData *data,
                Some settings
        */
        bool enable_mesh_cache  = g_settings->getBool("enable_mesh_cache");
-       bool new_style_water = g_settings->getBool("new_style_water");
-
-       float node_liquid_level = 1.0;
-       if (new_style_water)
-               node_liquid_level = 0.85;
 
        v3s16 blockpos_nodes = data->m_blockpos*MAP_BLOCKSIZE;
 
@@ -287,35 +282,29 @@ void mapblock_mesh_generate_special(MeshMakeData *data,
                                        If our topside is liquid, set upper border of face
                                        at upper border of node
                                */
-                               if(top_is_same_liquid)
-                               {
-                                       vertices[2].Pos.Y = 0.5*BS;
-                                       vertices[3].Pos.Y = 0.5*BS;
-                               }
+                               if (top_is_same_liquid) {
+                                       vertices[2].Pos.Y = 0.5 * BS;
+                                       vertices[3].Pos.Y = 0.5 * BS;
+                               } else {
                                /*
                                        Otherwise upper position of face is liquid level
                                */
-                               else
-                               {
-                                       vertices[2].Pos.Y = (node_liquid_level-0.5)*BS;
-                                       vertices[3].Pos.Y = (node_liquid_level-0.5)*BS;
+                                       vertices[2].Pos.Y = 0.5 * BS;
+                                       vertices[3].Pos.Y = 0.5 * BS;
                                }
                                /*
                                        If neighbor is liquid, lower border of face is liquid level
                                */
-                               if(neighbor_is_same_liquid)
-                               {
-                                       vertices[0].Pos.Y = (node_liquid_level-0.5)*BS;
-                                       vertices[1].Pos.Y = (node_liquid_level-0.5)*BS;
-                               }
+                               if (neighbor_is_same_liquid) {
+                                       vertices[0].Pos.Y = 0.5 * BS;
+                                       vertices[1].Pos.Y = 0.5 * BS;
+                               } else {
                                /*
                                        If neighbor is not liquid, lower border of face is
                                        lower border of node
                                */
-                               else
-                               {
-                                       vertices[0].Pos.Y = -0.5*BS;
-                                       vertices[1].Pos.Y = -0.5*BS;
+                                       vertices[0].Pos.Y = -0.5 * BS;
+                                       vertices[1].Pos.Y = -0.5 * BS;
                                }
 
                                for(s32 j=0; j<4; j++)
@@ -358,7 +347,7 @@ void mapblock_mesh_generate_special(MeshMakeData *data,
                                video::S3DVertex(-BS/2,0,-BS/2, 0,0,0, c, 0,0),
                        };
 
-                       v3f offset(p.X*BS, p.Y*BS + (-0.5+node_liquid_level)*BS, p.Z*BS);
+                       v3f offset(p.X * BS, (p.Y + 0.5) * BS, p.Z * BS);
                        for(s32 i=0; i<4; i++)
                        {
                                vertices[i].Pos += offset;
@@ -431,14 +420,14 @@ void mapblock_mesh_generate_special(MeshMakeData *data,
                                        content = n2.getContent();
 
                                        if(n2.getContent() == c_source)
-                                               level = (-0.5+node_liquid_level) * BS;
+                                               level = 0.5 * BS;
                                        else if(n2.getContent() == c_flowing){
                                                u8 liquid_level = (n2.param2&LIQUID_LEVEL_MASK);
                                                if (liquid_level <= LIQUID_LEVEL_MAX+1-range)
                                                        liquid_level = 0;
                                                else
                                                        liquid_level -= (LIQUID_LEVEL_MAX+1-range);
-                                               level = (-0.5 + ((float)liquid_level+ 0.5) / (float)range * node_liquid_level) * BS;
+                                               level = (-0.5 + ((float)liquid_level + 0.5) / (float)range) * BS;
                                        }
 
                                        // Check node above neighbor.
@@ -486,7 +475,7 @@ void mapblock_mesh_generate_special(MeshMakeData *data,
                                        // Source is always the same height
                                        else if(content == c_source)
                                        {
-                                               cornerlevel = (-0.5+node_liquid_level)*BS;
+                                               cornerlevel = 0.5 * BS;
                                                valid_count = 1;
                                                break;
                                        }
index 49e03a26001cb5f754598fc9cd3db638e51450dd..f7ac310be437a309fab612c2019242c03cc3c47d 100644 (file)
@@ -106,7 +106,6 @@ void set_default_settings(Settings *settings)
        settings->setDefault("enable_fog", "true");
        settings->setDefault("fov", "72");
        settings->setDefault("view_bobbing", "true");
-       settings->setDefault("new_style_water", "false");
        settings->setDefault("leaves_style", "fancy");
        settings->setDefault("connected_glass", "false");
        settings->setDefault("smooth_lighting", "true");
index 31366f7e08f2858b2be969f1e08f15fb5183f4c6..6d740fac339eb9276b3a3210412527d65c5a2b58 100644 (file)
@@ -806,7 +806,6 @@ void CNodeDefManager::updateTextures(IGameDef *gamedef,
        scene::ISceneManager* smgr = gamedef->getSceneManager();
        scene::IMeshManipulator* meshmanip = smgr->getMeshManipulator();
 
-       bool new_style_water           = g_settings->getBool("new_style_water");
        bool connected_glass           = g_settings->getBool("connected_glass");
        bool opaque_water              = g_settings->getBool("opaque_water");
        bool enable_shaders            = g_settings->getBool("enable_shaders");
@@ -854,7 +853,7 @@ void CNodeDefManager::updateTextures(IGameDef *gamedef,
                        assert(f->liquid_type == LIQUID_SOURCE);
                        if (opaque_water)
                                f->alpha = 255;
-                       f->solidness = new_style_water ? 0 : 1;
+                       f->solidness = 0;
                        is_liquid = true;
                        break;
                case NDT_FLOWINGLIQUID: