mirror of
https://github.com/luanti-org/luanti.git
synced 2025-06-27 16:36:03 +00:00
Real global textures (#6105)
* Real global textures * Add world-aligned textures * Update minimal to support world-aligned tiles * Update minimal
This commit is contained in:
parent
6bab695479
commit
75320e7e88
26 changed files with 469 additions and 160 deletions
|
@ -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) {
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue