Clean more
authorPerttu Ahola <celeron55@gmail.com>
Tue, 15 Nov 2011 13:46:52 +0000 (15:46 +0200)
committerPerttu Ahola <celeron55@gmail.com>
Tue, 29 Nov 2011 17:13:44 +0000 (19:13 +0200)
src/content_mapblock.cpp
src/nodedef.cpp
src/nodedef.h

index e0a9b60f98fbd9bc83588f5001542d8bc31c605c..368e6c6114dacd235cf4c3b254385ef67741a52b 100644 (file)
@@ -234,6 +234,10 @@ void mapblock_mesh_generate_special(MeshMakeData *data,
 
                MapNode n = data->m_vmanip.getNodeNoEx(blockpos_nodes+p);
 
+               // Only solidness=0 stuff is drawn here
+               if(nodedef->get(n).solidness != 0)
+                       continue;
+
                /*
                        Add torches to mesh
                */
index 6fa410cc2027ac48aecfb277b1b0d96a564225ee..045615fbbf72f08eb5cd3c20964d1457cbcb7944 100644 (file)
@@ -37,59 +37,6 @@ ContentFeatures::~ContentFeatures()
 #endif
 }
 
-#if 0
-void ContentFeatures::setTexture(ITextureSource *tsrc,
-               u16 i, std::string name, u8 alpha)
-{
-       used_texturenames.insert(name);
-       
-       if(tsrc)
-       {
-               tiles[i].texture = tsrc->getTexture(name);
-       }
-       
-       if(alpha != 255)
-       {
-               tiles[i].alpha = alpha;
-               tiles[i].material_type = MATERIAL_ALPHA_VERTEX;
-       }
-
-       if(inventory_texture == NULL)
-               setInventoryTexture(name, tsrc);
-}
-
-void ContentFeatures::setInventoryTexture(std::string imgname,
-               ITextureSource *tsrc)
-{
-       if(tsrc == NULL)
-               return;
-       
-       imgname += "^[forcesingle";
-       
-       inventory_texture = tsrc->getTextureRaw(imgname);
-}
-
-void ContentFeatures::setInventoryTextureCube(std::string top,
-               std::string left, std::string right, ITextureSource *tsrc)
-{
-       if(tsrc == NULL)
-               return;
-       
-       str_replace_char(top, '^', '&');
-       str_replace_char(left, '^', '&');
-       str_replace_char(right, '^', '&');
-
-       std::string imgname_full;
-       imgname_full += "[inventorycube{";
-       imgname_full += top;
-       imgname_full += "{";
-       imgname_full += left;
-       imgname_full += "{";
-       imgname_full += right;
-       inventory_texture = tsrc->getTextureRaw(imgname_full);
-}
-#endif
-
 void ContentFeatures::setTexture(u16 i, std::string name)
 {
        used_texturenames.insert(name);
index f5662967bf1ef5f0662a73b8694ed6cf70002ebc..e70295616647abb93aa63250a0faee409406d3fb 100644 (file)
@@ -137,6 +137,8 @@ struct ContentFeatures
        MaterialSpec mspec_special[CF_SPECIAL_COUNT];
        u8 alpha;
        bool backface_culling;
+       u8 solidness; // Used when choosing which face is drawn
+       u8 visual_solidness; // When solidness=0, this tells how it looks like
 
        // List of all block textures that have been used (value is dummy)
        // Used for texture atlas making.
@@ -149,8 +151,6 @@ struct ContentFeatures
        bool is_ground_content;
        bool light_propagates;
        bool sunlight_propagates;
-       u8 solidness; // Used when choosing which face is drawn
-       u8 visual_solidness; // When solidness=0, this tells how it looks like
        // This is used for collision detection.
        // Also for general solidness queries.
        bool walkable;
@@ -226,13 +226,13 @@ struct ContentFeatures
                tname_inventory = "";
                alpha = 255;
                backface_culling = true;
+               solidness = 2;
+               visual_solidness = 0;
                used_texturenames.clear();
                param_type = CPT_NONE;
                is_ground_content = false;
                light_propagates = false;
                sunlight_propagates = false;
-               solidness = 2;
-               visual_solidness = 0;
                walkable = true;
                pointable = true;
                diggable = true;