]> git.lizzy.rs Git - minetest.git/blobdiff - src/content_cao.cpp
Added debug log level setting
[minetest.git] / src / content_cao.cpp
index c7d21d278368f6d92625152e913b538043f47a37..d71911b952e681d2505fa48aa32f9a1bc2dd8be0 100644 (file)
@@ -472,7 +472,7 @@ void ItemCAO::updateTexture()
                IItemDefManager *idef = m_gamedef->idef();
                ItemStack item;
                item.deSerialize(is, idef);
-               texture = item.getDefinition(idef).inventory_texture;
+               texture = idef->getInventoryTexture(item.getDefinition(idef).name, m_gamedef);
        }
        catch(SerializationError &e)
        {
@@ -923,6 +923,11 @@ class GenericCAO : public ClientActiveObject
                                        m_prop.visual_size.X));
                        u8 li = m_last_light;
                        setMeshColor(m_meshnode->getMesh(), video::SColor(255,li,li,li));
+
+                       m_meshnode->setMaterialFlag(video::EMF_LIGHTING, false);
+                       m_meshnode->setMaterialFlag(video::EMF_BILINEAR_FILTER, false);
+                       m_meshnode->setMaterialType(video::EMT_TRANSPARENT_ALPHA_CHANNEL_REF);
+                       m_meshnode->setMaterialFlag(video::EMF_FOG_ENABLE, true);
                }
                else if(m_prop.visual == "mesh"){
                        infostream<<"GenericCAO::addToScene(): mesh"<<std::endl;
@@ -936,6 +941,11 @@ class GenericCAO : public ClientActiveObject
                                                m_prop.visual_size.X));
                                u8 li = m_last_light;
                                setMeshColor(m_animated_meshnode->getMesh(), video::SColor(255,li,li,li));
+
+                               m_animated_meshnode->setMaterialFlag(video::EMF_LIGHTING, false);
+                               m_animated_meshnode->setMaterialFlag(video::EMF_BILINEAR_FILTER, false);
+                               m_animated_meshnode->setMaterialType(video::EMT_TRANSPARENT_ALPHA_CHANNEL_REF);
+                               m_animated_meshnode->setMaterialFlag(video::EMF_FOG_ENABLE, true);
                        }
                        else
                                errorstream<<"GenericCAO::addToScene(): Could not load mesh "<<m_prop.mesh<<std::endl;
@@ -947,7 +957,7 @@ class GenericCAO : public ClientActiveObject
                                infostream<<"textures[0]: "<<m_prop.textures[0]<<std::endl;
                                IItemDefManager *idef = m_gamedef->idef();
                                ItemStack item(m_prop.textures[0], 1, 0, "", idef);
-                               scene::IMesh *item_mesh = item.getDefinition(idef).wield_mesh;
+                               scene::IMesh *item_mesh = idef->getWieldMesh(item.getDefinition(idef).name, m_gamedef);
                                
                                // Copy mesh to be able to set unique vertex colors
                                scene::IMeshManipulator *manip =