]> git.lizzy.rs Git - minetest.git/commitdiff
Fix NDT_GLASSLIKE normals
authorKahrl <kahrl@gmx.net>
Fri, 23 Jan 2015 00:01:21 +0000 (01:01 +0100)
committerCraig Robbins <kde.psych@gmail.com>
Fri, 30 Jan 2015 17:06:34 +0000 (03:06 +1000)
Remove inventorycube() workaround for default:glass in minimal game

games/minimal/mods/default/init.lua
src/content_mapblock.cpp

index 038bf9abc51754964626864e9d045855b78bb134..01bf65b9593bfc6c189ce16b74efc24ef1b72399 100644 (file)
@@ -886,7 +886,6 @@ minetest.register_node("default:glass", {
        description = "Glass",
        drawtype = "glasslike",
        tiles ={"default_glass.png"},
-       inventory_image = minetest.inventorycube("default_glass.png"),
        paramtype = "light",
        sunlight_propagates = true,
        groups = {snappy=2,cracky=3,oddly_breakable_by_hand=3},
index b84b69629d99082ad6cc490d3da65449e20be7a7..9af3be7891ce7a2fd560b4fc902d6ade92578a3d 100644 (file)
@@ -756,7 +756,8 @@ void mapblock_mesh_generate_special(MeshMakeData *data,
                        for(u32 j=0; j<6; j++)
                        {
                                // Check this neighbor
-                               v3s16 n2p = blockpos_nodes + p + g_6dirs[j];
+                               v3s16 dir = g_6dirs[j];
+                               v3s16 n2p = blockpos_nodes + p + dir;
                                MapNode n2 = data->m_vmanip.getNodeNoEx(n2p);
                                // Don't make face if neighbor is of same type
                                if(n2.getContent() == n.getContent())
@@ -764,10 +765,10 @@ void mapblock_mesh_generate_special(MeshMakeData *data,
 
                                // The face at Z+
                                video::S3DVertex vertices[4] = {
-                                       video::S3DVertex(-BS/2,-BS/2,BS/2, 0,0,0, c, 1,1),
-                                       video::S3DVertex(BS/2,-BS/2,BS/2, 0,0,0, c, 0,1),
-                                       video::S3DVertex(BS/2,BS/2,BS/2, 0,0,0, c, 0,0),
-                                       video::S3DVertex(-BS/2,BS/2,BS/2, 0,0,0, c, 1,0),
+                                       video::S3DVertex(-BS/2,-BS/2,BS/2, dir.X,dir.Y,dir.Z, c, 1,1),
+                                       video::S3DVertex(BS/2,-BS/2,BS/2, dir.X,dir.Y,dir.Z, c, 0,1),
+                                       video::S3DVertex(BS/2,BS/2,BS/2, dir.X,dir.Y,dir.Z, c, 0,0),
+                                       video::S3DVertex(-BS/2,BS/2,BS/2, dir.X,dir.Y,dir.Z, c, 1,0),
                                };
                                
                                // Rotations in the g_6dirs format