Skip to content
Permalink
Browse files

Scale inventory image for scaled allfaces nodes (#10225)

The inventory image size of the inventory image of nodes with drawtype allfaces (and related) is scaled as well if visual_scale is set (previously, the inventory image size was always the same)
  • Loading branch information
Wuzzy2 committed Sep 4, 2020
1 parent 050964b commit b3ace8f19746b53f839e7b0bdff0843c83866f64
Showing with 11 additions and 0 deletions.
  1. +9 −0 games/devtest/mods/testnodes/drawtypes.lua
  2. +2 −0 src/client/wieldmesh.cpp
@@ -514,6 +514,15 @@ local scale = function(subname, desc_double, desc_half)
minetest.register_node("testnodes:"..subname.."_half", def)
end

scale("allfaces",
S("Double-sized Allfaces Drawtype Test Node"),
S("Half-sized Allfaces Drawtype Test Node"))
scale("allfaces_optional",
S("Double-sized Allfaces Optional Drawtype Test Node"),
S("Half-sized Allfaces Optional Drawtype Test Node"))
scale("allfaces_optional_waving",
S("Double-sized Waving Allfaces Optional Drawtype Test Node"),
S("Half-sized Waving Allfaces Optional Drawtype Test Node"))
scale("plantlike",
S("Double-sized Plantlike Drawtype Test Node"),
S("Half-sized Plantlike Drawtype Test Node"))
@@ -562,6 +562,8 @@ void getItemMesh(Client *client, const ItemStack &item, ItemMesh *result)
// add overlays
postProcessNodeMesh(mesh, f, false, false, nullptr,
&result->buffer_colors, true);
if (f.drawtype == NDT_ALLFACES)
scaleMesh(mesh, v3f(f.visual_scale));
break;
}
case NDT_PLANTLIKE: {

0 comments on commit b3ace8f

Please sign in to comment.
You can’t perform that action at this time.