diff options
author | Lars Hofhansl <larsh@apache.org> | 2017-12-04 22:25:09 -0800 |
---|---|---|
committer | Lars Hofhansl <larsh@apache.org> | 2017-12-04 22:29:11 -0800 |
commit | fd9f195fcc2e4e592dbad3290876486eb08318b2 (patch) | |
tree | 5e8df8c8057e1a268f700541f8efdf2e4174a2ce /src/mesh.cpp | |
parent | f470cb7270560a26afff0a0eadfc69070236c109 (diff) | |
download | minetest-fd9f195fcc2e4e592dbad3290876486eb08318b2.tar.xz |
Use Irrlicht's mesh cache for animated meshes.
Fixes #6676.
Allow animated meshes to be cached in Irrlicht's builtin mesh cache.
Use Material.EmmissiveColor instead of manipulating the mesh' vertex colors.
Diffstat (limited to 'src/mesh.cpp')
-rw-r--r-- | src/mesh.cpp | 8 |
1 files changed, 8 insertions, 0 deletions
diff --git a/src/mesh.cpp b/src/mesh.cpp index 218e2d0b2..7fc7531f2 100644 --- a/src/mesh.cpp +++ b/src/mesh.cpp @@ -24,6 +24,7 @@ with this program; if not, write to the Free Software Foundation, Inc., #include <iostream> #include <IAnimatedMesh.h> #include <SAnimatedMesh.h> +#include <IAnimatedMeshSceneNode.h> // In Irrlicht 1.8 the signature of ITexture::lock was changed from // (bool, u32) to (E_TEXTURE_LOCK_MODE, u32). @@ -184,6 +185,13 @@ void setMeshBufferColor(scene::IMeshBuffer *buf, const video::SColor &color) ((video::S3DVertex *) (vertices + i * stride))->Color = color; } +void setAnimatedMeshColor(scene::IAnimatedMeshSceneNode *node, const video::SColor &color) +{ + for (u32 i = 0; i < node->getMaterialCount(); ++i) { + node->getMaterial(i).EmissiveColor = color; + } +} + void setMeshColor(scene::IMesh *mesh, const video::SColor &color) { if (mesh == NULL) |