Skip to content

Commit 0877587

Browse files
Wuzzy2paramat
authored andcommittedJan 20, 2020
Resized torchlike sprite now attaches to surface (#9303)
1 parent 468eb4b commit 0877587

File tree

2 files changed

+19
-8
lines changed

2 files changed

+19
-8
lines changed
 

‎doc/lua_api.txt

+3-2
Original file line numberDiff line numberDiff line change
@@ -6569,8 +6569,9 @@ Used by `minetest.register_node`.
65696569
-- Supported for drawtypes "plantlike", "signlike", "torchlike",
65706570
-- "firelike", "mesh".
65716571
-- For plantlike and firelike, the image will start at the bottom of the
6572-
-- node, for the other drawtypes the image will be centered on the node.
6573-
-- Note that positioning for "torchlike" may still change.
6572+
-- node. For torchlike, the image will start at the surface to which the
6573+
-- node "attaches". For the other drawtypes the image will be centered
6574+
-- on the node.
65746575

65756576
tiles = {tile definition 1, def2, def3, def4, def5, def6},
65766577
-- Textures of node; +Y, -Y, +X, -X, +Z, -Z

‎src/client/content_mapblock.cpp

+16-6
Original file line numberDiff line numberDiff line change
@@ -860,17 +860,27 @@ void MapblockMeshGenerator::drawTorchlikeNode()
860860
for (v3f &vertex : vertices) {
861861
switch (wall) {
862862
case DWM_YP:
863-
vertex.rotateXZBy(-45); break;
863+
vertex.Y += -size + BS/2;
864+
vertex.rotateXZBy(-45);
865+
break;
864866
case DWM_YN:
865-
vertex.rotateXZBy( 45); break;
867+
vertex.Y += size - BS/2;
868+
vertex.rotateXZBy(45);
869+
break;
866870
case DWM_XP:
867-
vertex.rotateXZBy( 0); break;
871+
vertex.X += -size + BS/2;
872+
break;
868873
case DWM_XN:
869-
vertex.rotateXZBy(180); break;
874+
vertex.X += -size + BS/2;
875+
vertex.rotateXZBy(180);
876+
break;
870877
case DWM_ZP:
871-
vertex.rotateXZBy( 90); break;
878+
vertex.X += -size + BS/2;
879+
vertex.rotateXZBy(90);
880+
break;
872881
case DWM_ZN:
873-
vertex.rotateXZBy(-90); break;
882+
vertex.X += -size + BS/2;
883+
vertex.rotateXZBy(-90);
874884
}
875885
}
876886
drawQuad(vertices);

0 commit comments

Comments
 (0)
Please sign in to comment.