summaryrefslogtreecommitdiff
path: root/src/content_cao.cpp
diff options
context:
space:
mode:
authorSapier <sapier AT gmx dot net>2015-12-29 19:53:38 +0100
committerSapier <sapier AT gmx dot net>2015-12-29 19:53:38 +0100
commit25d128da36bb5aaa27f0dcd32b86fb5616684426 (patch)
treea372c94fed2009568d6f1deb709258a9f1e589a3 /src/content_cao.cpp
parent61cb4d52a6873a0af69bb8c9a295586f09b2c27a (diff)
downloadminetest-25d128da36bb5aaa27f0dcd32b86fb5616684426.tar.gz
minetest-25d128da36bb5aaa27f0dcd32b86fb5616684426.tar.bz2
minetest-25d128da36bb5aaa27f0dcd32b86fb5616684426.zip
Revert "Add support for using arbitrary meshes as items"
This reverts commit 91bafceee6606fab79db1bde4cba01b84fed65c7. Reverted due to missinterpretation of agreement, obvious dislike and me not interested in doing fights for feature I don't actually need
Diffstat (limited to 'src/content_cao.cpp')
-rw-r--r--src/content_cao.cpp61
1 files changed, 9 insertions, 52 deletions
diff --git a/src/content_cao.cpp b/src/content_cao.cpp
index bde0dd320..1b8e84c8f 100644
--- a/src/content_cao.cpp
+++ b/src/content_cao.cpp
@@ -954,43 +954,15 @@ void GenericCAO::addToScene(scene::ISceneManager *smgr, ITextureSource *tsrc,
IItemDefManager *idef = m_gamedef->idef();
ItemStack item(m_prop.textures[0], 1, 0, "", idef);
- if (!item.getDefinition(idef).meshname.empty())
- {
- scene::IAnimatedMesh *mesh = m_gamedef->getMesh(item.getDefinition(idef).meshname);
- if(mesh)
- {
- m_animated_meshnode = smgr->addAnimatedMeshSceneNode(mesh, NULL);
-
- m_animated_meshnode->grab();
- mesh->drop(); // The scene node took hold of it
- m_animated_meshnode->animateJoints(); // Needed for some animations
- m_animated_meshnode->setScale(v3f(m_prop.visual_size.X,
- m_prop.visual_size.Y,
- m_prop.visual_size.X));
- u8 li = m_last_light;
- setMeshColor(m_animated_meshnode->getMesh(), video::SColor(255,li,li,li));
-
- bool backface_culling = m_prop.backface_culling;
- if (m_is_player)
- backface_culling = false;
-
- 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);
- m_animated_meshnode->setMaterialFlag(video::EMF_BACK_FACE_CULLING, backface_culling);
- }
- }
- else {
- m_wield_meshnode = new WieldMeshSceneNode(
- smgr->getRootSceneNode(), smgr, -1);
- m_wield_meshnode->setItem(item, m_gamedef);
- m_wield_meshnode->setScale(v3f(m_prop.visual_size.X/2,
- m_prop.visual_size.Y/2,
- m_prop.visual_size.X/2));
- u8 li = m_last_light;
- m_wield_meshnode->setColor(video::SColor(255,li,li,li));
- }
+ m_wield_meshnode = new WieldMeshSceneNode(
+ smgr->getRootSceneNode(), smgr, -1);
+ m_wield_meshnode->setItem(item, m_gamedef);
+
+ m_wield_meshnode->setScale(v3f(m_prop.visual_size.X/2,
+ m_prop.visual_size.Y/2,
+ m_prop.visual_size.X/2));
+ u8 li = m_last_light;
+ m_wield_meshnode->setColor(video::SColor(255,li,li,li));
}
} else {
infostream<<"GenericCAO::addToScene(): \""<<m_prop.visual
@@ -1430,21 +1402,6 @@ void GenericCAO::updateTextures(const std::string &mod)
m_animated_meshnode->getMaterial(i).SpecularColor = m_prop.colors[i];
}
}
- else if (m_prop.visual == "wielditem") {
- IItemDefManager *idef = m_gamedef->idef();
- ItemStack item(m_prop.textures[0], 1, 0, "", idef);
-
- if (!item.getDefinition(idef).meshname.empty()) {
-
- unsigned int materialcount = m_animated_meshnode->getMaterialCount();
-
- for (unsigned int i = 0; i < materialcount; i++) {
- m_animated_meshnode->getMaterial(i)
- .setTexture(0, tsrc->getTexture(item
- .getDefinition(idef).meshtexture));
- }
- }
- }
}
if(m_meshnode)
{