diff options
author | Wuzzy <wuzzy2@mail.ru> | 2020-01-20 19:17:54 +0000 |
---|---|---|
committer | Paramat <paramat@users.noreply.github.com> | 2020-01-20 19:17:54 +0000 |
commit | 0877587cce1d96b1c8c009221684ab382e8f1929 (patch) | |
tree | bb7799f5025473071722987e1fe50023d13e5d47 | |
parent | 468eb4bf5710e851b2599baeff870518f979c71a (diff) | |
download | minetest-0877587cce1d96b1c8c009221684ab382e8f1929.tar.gz minetest-0877587cce1d96b1c8c009221684ab382e8f1929.tar.bz2 minetest-0877587cce1d96b1c8c009221684ab382e8f1929.zip |
Resized torchlike sprite now attaches to surface (#9303)
-rw-r--r-- | doc/lua_api.txt | 5 | ||||
-rw-r--r-- | src/client/content_mapblock.cpp | 22 |
2 files changed, 19 insertions, 8 deletions
diff --git a/doc/lua_api.txt b/doc/lua_api.txt index 0b12913d5..b06e08548 100644 --- a/doc/lua_api.txt +++ b/doc/lua_api.txt @@ -6569,8 +6569,9 @@ Used by `minetest.register_node`. -- Supported for drawtypes "plantlike", "signlike", "torchlike", -- "firelike", "mesh". -- For plantlike and firelike, the image will start at the bottom of the - -- node, for the other drawtypes the image will be centered on the node. - -- Note that positioning for "torchlike" may still change. + -- node. For torchlike, the image will start at the surface to which the + -- node "attaches". For the other drawtypes the image will be centered + -- on the node. tiles = {tile definition 1, def2, def3, def4, def5, def6}, -- Textures of node; +Y, -Y, +X, -X, +Z, -Z diff --git a/src/client/content_mapblock.cpp b/src/client/content_mapblock.cpp index 4a0df6171..5be0caf19 100644 --- a/src/client/content_mapblock.cpp +++ b/src/client/content_mapblock.cpp @@ -860,17 +860,27 @@ void MapblockMeshGenerator::drawTorchlikeNode() for (v3f &vertex : vertices) { switch (wall) { case DWM_YP: - vertex.rotateXZBy(-45); break; + vertex.Y += -size + BS/2; + vertex.rotateXZBy(-45); + break; case DWM_YN: - vertex.rotateXZBy( 45); break; + vertex.Y += size - BS/2; + vertex.rotateXZBy(45); + break; case DWM_XP: - vertex.rotateXZBy( 0); break; + vertex.X += -size + BS/2; + break; case DWM_XN: - vertex.rotateXZBy(180); break; + vertex.X += -size + BS/2; + vertex.rotateXZBy(180); + break; case DWM_ZP: - vertex.rotateXZBy( 90); break; + vertex.X += -size + BS/2; + vertex.rotateXZBy(90); + break; case DWM_ZN: - vertex.rotateXZBy(-90); break; + vertex.X += -size + BS/2; + vertex.rotateXZBy(-90); } } drawQuad(vertices); |