mirror of
https://github.com/minetest/minetest.git
synced 2024-11-27 01:53:45 +01:00
Fix lighting of upright_sprite entities (#12336)
Use MeshNode materials to set the light since ReadOnlyMaterials is now false
This commit is contained in:
parent
604fb2b738
commit
a4ef62f5b2
@ -905,12 +905,8 @@ void GenericCAO::setNodeLight(const video::SColor &light_color)
|
|||||||
if (m_prop.visual == "upright_sprite") {
|
if (m_prop.visual == "upright_sprite") {
|
||||||
if (!m_meshnode)
|
if (!m_meshnode)
|
||||||
return;
|
return;
|
||||||
|
for (u32 i = 0; i < m_meshnode->getMaterialCount(); ++i)
|
||||||
scene::IMesh *mesh = m_meshnode->getMesh();
|
m_meshnode->getMaterial(i).EmissiveColor = light_color;
|
||||||
for (u32 i = 0; i < mesh->getMeshBufferCount(); ++i) {
|
|
||||||
scene::IMeshBuffer *buf = mesh->getMeshBuffer(i);
|
|
||||||
buf->getMaterial().EmissiveColor = light_color;
|
|
||||||
}
|
|
||||||
} else {
|
} else {
|
||||||
scene::ISceneNode *node = getSceneNode();
|
scene::ISceneNode *node = getSceneNode();
|
||||||
if (!node)
|
if (!node)
|
||||||
|
Loading…
Reference in New Issue
Block a user