1
0
Fork 0
mirror of https://github.com/luanti-org/luanti.git synced 2025-06-27 16:36:03 +00:00

Do not shade inventory items with textures (#5869)

This commit restores the old behavior: if an inventory item has an own
inventory texture, it will not be shaded.
This commit is contained in:
Dániel Juhász 2017-06-01 23:18:55 +02:00 committed by Loïc Blot
parent 1c69476d9f
commit 001de6ffba
5 changed files with 34 additions and 10 deletions

View file

@ -440,10 +440,15 @@ void getItemMesh(Client *client, const ItemStack &item, ItemMesh *result)
scene::SMesh *mesh = NULL;
// Shading is on by default
result->needs_shading = true;
// If inventory_image is defined, it overrides everything else
if (def.inventory_image != "") {
mesh = getExtrudedMesh(tsrc, def.inventory_image);
result->buffer_colors.push_back(ItemPartColor());
// Items with inventory images do not need shading
result->needs_shading = false;
} else if (def.type == ITEM_NODE) {
if (f.mesh_ptr[0]) {
mesh = cloneMesh(f.mesh_ptr[0]);