diff options
author | x2048 <codeforsmile@gmail.com> | 2022-05-20 22:35:03 +0200 |
---|---|---|
committer | GitHub <noreply@github.com> | 2022-05-20 22:35:03 +0200 |
commit | a4ef62f5b215fe0f23e3e50672f1538854db4ed9 (patch) | |
tree | 1140a95491a136d22530a08e0c232f78e64041ec /src/client | |
parent | 604fb2b738c1f369c608b7f3b778034bf3dc2725 (diff) | |
download | minetest-a4ef62f5b215fe0f23e3e50672f1538854db4ed9.tar.gz minetest-a4ef62f5b215fe0f23e3e50672f1538854db4ed9.tar.bz2 minetest-a4ef62f5b215fe0f23e3e50672f1538854db4ed9.zip |
Fix lighting of upright_sprite entities (#12336)
Use MeshNode materials to set the light since ReadOnlyMaterials is now false
Diffstat (limited to 'src/client')
-rw-r--r-- | src/client/content_cao.cpp | 8 |
1 files changed, 2 insertions, 6 deletions
diff --git a/src/client/content_cao.cpp b/src/client/content_cao.cpp index d89bb53b3..9c3e5aa05 100644 --- a/src/client/content_cao.cpp +++ b/src/client/content_cao.cpp @@ -905,12 +905,8 @@ void GenericCAO::setNodeLight(const video::SColor &light_color) if (m_prop.visual == "upright_sprite") { if (!m_meshnode) return; - - scene::IMesh *mesh = m_meshnode->getMesh(); - for (u32 i = 0; i < mesh->getMeshBufferCount(); ++i) { - scene::IMeshBuffer *buf = mesh->getMeshBuffer(i); - buf->getMaterial().EmissiveColor = light_color; - } + for (u32 i = 0; i < m_meshnode->getMaterialCount(); ++i) + m_meshnode->getMaterial(i).EmissiveColor = light_color; } else { scene::ISceneNode *node = getSceneNode(); if (!node) |