summaryrefslogtreecommitdiff
path: root/src/mapnode.cpp
diff options
context:
space:
mode:
authorVitaliy <silverunicorn2011@yandex.ru>2017-10-15 10:34:14 +0300
committerLoïc Blot <nerzhul@users.noreply.github.com>2017-10-15 09:34:14 +0200
commit75320e7e88ab5088a46c9e42c1e789cbdacb13b0 (patch)
treeda71a3134f8b42bdabf25ef1df14c5e1a77a439e /src/mapnode.cpp
parent6bab695479d42ac2b051b8a35639c32b22efbf8d (diff)
downloadminetest-75320e7e88ab5088a46c9e42c1e789cbdacb13b0.tar.gz
minetest-75320e7e88ab5088a46c9e42c1e789cbdacb13b0.tar.bz2
minetest-75320e7e88ab5088a46c9e42c1e789cbdacb13b0.zip
Real global textures (#6105)
* Real global textures * Add world-aligned textures * Update minimal to support world-aligned tiles * Update minimal
Diffstat (limited to 'src/mapnode.cpp')
-rw-r--r--src/mapnode.cpp8
1 files changed, 6 insertions, 2 deletions
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 <string>
#include <sstream>
@@ -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<aabb3f> &fixed = nodebox.fixed;
- int facedir = n.getFaceDir(nodemgr);
+ int facedir = n.getFaceDir(nodemgr, true);
u8 axisdir = facedir>>2;
facedir&=0x03;
for (aabb3f box : fixed) {