1
0
Fork 0
mirror of https://github.com/luanti-org/luanti.git synced 2025-08-01 17:38:41 +00:00

Reuse object_shader for "wielditem" and "item" entity drawtypes (#9537)

This commit is contained in:
Danila Shutov 2020-04-19 19:47:13 +03:00 committed by GitHub
parent c87d52a5fa
commit cdbe3c5e57
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
6 changed files with 24 additions and 165 deletions

View file

@ -826,11 +826,12 @@ void GenericCAO::setNodeLight(u8 light)
video::SColor color(255, light, light, light);
if (m_prop.visual == "wielditem" || m_prop.visual == "item") {
// Since these types of visuals are using their own shader
// they should be handled separately
if (m_wield_meshnode)
m_wield_meshnode->setColor(color);
} else if (m_enable_shaders) {
m_wield_meshnode->setNodeLightColor(color);
return;
}
if (m_enable_shaders) {
scene::ISceneNode *node = getSceneNode();
if (node == nullptr)