m_colors.emplace_back();
// overlay is white, if present
m_colors.emplace_back(true, video::SColor(0xFFFFFFFF));
+ // initialize the color
+ if (!m_lighting)
+ setColor(video::SColor(0xFFFFFFFF));
return;
}
material.setFlag(video::EMF_BILINEAR_FILTER, m_bilinear_filter);
material.setFlag(video::EMF_TRILINEAR_FILTER, m_trilinear_filter);
}
+
+ // initialize the color
+ if (!m_lighting)
+ setColor(video::SColor(0xFFFFFFFF));
return;
} else {
if (!def.inventory_image.empty()) {
m_colors.emplace_back();
// overlay is white, if present
m_colors.emplace_back(true, video::SColor(0xFFFFFFFF));
+
+ // initialize the color
+ if (!m_lighting)
+ setColor(video::SColor(0xFFFFFFFF));
return;
}
material.EmissiveColor = color;
}
}
-
- setColor(color);
+ else {
+ setColor(color);
+ }
}
void WieldMeshSceneNode::render()
m_meshnode->setMaterialFlag(video::EMF_NORMALIZE_NORMALS, m_lighting);
m_meshnode->setVisible(true);
- // Add mesh to shadow caster
- if (m_shadow)
+ if (m_shadow) {
+ // Add mesh to shadow caster
m_shadow->addNodeToShadowList(m_meshnode);
+
+ // Set shadow texture
+ for (u32 i = 0; i < m_meshnode->getMaterialCount(); i++)
+ m_meshnode->setMaterialTexture(3, m_shadow->get_texture());
+ }
}
void getItemMesh(Client *client, const ItemStack &item, ItemMesh *result)