From 75320e7e88ab5088a46c9e42c1e789cbdacb13b0 Mon Sep 17 00:00:00 2001 From: Vitaliy Date: Sun, 15 Oct 2017 10:34:14 +0300 Subject: Real global textures (#6105) * Real global textures * Add world-aligned textures * Update minimal to support world-aligned tiles * Update minimal --- src/mapnode.cpp | 8 ++++++-- 1 file changed, 6 insertions(+), 2 deletions(-) (limited to 'src/mapnode.cpp') diff --git a/src/mapnode.cpp b/src/mapnode.cpp index c46719a68..9d3459173 100644 --- a/src/mapnode.cpp +++ b/src/mapnode.cpp @@ -26,6 +26,7 @@ with this program; if not, write to the Free Software Foundation, Inc., #include "serialization.h" // For ser_ver_supported #include "util/serialize.h" #include "log.h" +#include "util/directiontables.h" #include "util/numeric.h" #include #include @@ -152,12 +153,15 @@ bool MapNode::getLightBanks(u8 &lightday, u8 &lightnight, INodeDefManager *nodem return f.param_type == CPT_LIGHT || f.light_source != 0; } -u8 MapNode::getFaceDir(INodeDefManager *nodemgr) const +u8 MapNode::getFaceDir(INodeDefManager *nodemgr, bool allow_wallmounted) const { const ContentFeatures &f = nodemgr->get(*this); if (f.param_type_2 == CPT2_FACEDIR || f.param_type_2 == CPT2_COLORED_FACEDIR) return (getParam2() & 0x1F) % 24; + if (allow_wallmounted && (f.param_type_2 == CPT2_WALLMOUNTED || + f.param_type_2 == CPT2_COLORED_WALLMOUNTED)) + return wallmounted_to_facedir[getParam2() & 0x07]; return 0; } @@ -246,7 +250,7 @@ void transformNodeBox(const MapNode &n, const NodeBox &nodebox, if (nodebox.type == NODEBOX_FIXED || nodebox.type == NODEBOX_LEVELED) { const std::vector &fixed = nodebox.fixed; - int facedir = n.getFaceDir(nodemgr); + int facedir = n.getFaceDir(nodemgr, true); u8 axisdir = facedir>>2; facedir&=0x03; for (aabb3f box : fixed) { -- cgit v1.2.3