diff options
author | Dániel Juhász <juhdanad@gmail.com> | 2017-06-01 23:18:55 +0200 |
---|---|---|
committer | Loïc Blot <nerzhul@users.noreply.github.com> | 2017-06-01 23:18:55 +0200 |
commit | 001de6ffbac83bcd41ecda075d79d265a69c7d42 (patch) | |
tree | 59b1857bb89be11a59746d4479f047806a7a42f6 /src/wieldmesh.cpp | |
parent | 1c69476d9f10540088ead63c8bcae91f46bc84d8 (diff) | |
download | minetest-001de6ffbac83bcd41ecda075d79d265a69c7d42.tar.gz minetest-001de6ffbac83bcd41ecda075d79d265a69c7d42.tar.bz2 minetest-001de6ffbac83bcd41ecda075d79d265a69c7d42.zip |
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.
Diffstat (limited to 'src/wieldmesh.cpp')
-rw-r--r-- | src/wieldmesh.cpp | 5 |
1 files changed, 5 insertions, 0 deletions
diff --git a/src/wieldmesh.cpp b/src/wieldmesh.cpp index 8b1477bb7..7736ec2a2 100644 --- a/src/wieldmesh.cpp +++ b/src/wieldmesh.cpp @@ -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]); |