Skip to content

Commit b3ace8f

Browse files
authoredSep 4, 2020
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)
1 parent 050964b commit b3ace8f

File tree

2 files changed

+11
-0
lines changed

2 files changed

+11
-0
lines changed
 

‎games/devtest/mods/testnodes/drawtypes.lua

+9
Original file line numberDiff line numberDiff line change
@@ -514,6 +514,15 @@ local scale = function(subname, desc_double, desc_half)
514514
minetest.register_node("testnodes:"..subname.."_half", def)
515515
end
516516

517+
scale("allfaces",
518+
S("Double-sized Allfaces Drawtype Test Node"),
519+
S("Half-sized Allfaces Drawtype Test Node"))
520+
scale("allfaces_optional",
521+
S("Double-sized Allfaces Optional Drawtype Test Node"),
522+
S("Half-sized Allfaces Optional Drawtype Test Node"))
523+
scale("allfaces_optional_waving",
524+
S("Double-sized Waving Allfaces Optional Drawtype Test Node"),
525+
S("Half-sized Waving Allfaces Optional Drawtype Test Node"))
517526
scale("plantlike",
518527
S("Double-sized Plantlike Drawtype Test Node"),
519528
S("Half-sized Plantlike Drawtype Test Node"))

‎src/client/wieldmesh.cpp

+2
Original file line numberDiff line numberDiff line change
@@ -562,6 +562,8 @@ void getItemMesh(Client *client, const ItemStack &item, ItemMesh *result)
562562
// add overlays
563563
postProcessNodeMesh(mesh, f, false, false, nullptr,
564564
&result->buffer_colors, true);
565+
if (f.drawtype == NDT_ALLFACES)
566+
scaleMesh(mesh, v3f(f.visual_scale));
565567
break;
566568
}
567569
case NDT_PLANTLIKE: {

0 commit comments

Comments
 (0)
Please sign in to comment.