forked from Mirrorlandia_minetest/minetest
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