From 0877587cce1d96b1c8c009221684ab382e8f1929 Mon Sep 17 00:00:00 2001 From: Wuzzy Date: Mon, 20 Jan 2020 19:17:54 +0000 Subject: Resized torchlike sprite now attaches to surface (#9303) --- src/client/content_mapblock.cpp | 22 ++++++++++++++++------ 1 file changed, 16 insertions(+), 6 deletions(-) (limited to 'src/client/content_mapblock.cpp') 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); -- cgit v1.2.3