Minetest  5.4.0
nodedef.cpp File Reference
#include "nodedef.h"
#include "itemdef.h"
#include "client/mesh.h"
#include "client/shader.h"
#include "client/client.h"
#include "client/renderingengine.h"
#include "client/tile.h"
#include <IMeshManipulator.h>
#include "log.h"
#include "settings.h"
#include "nameidmapping.h"
#include "util/numeric.h"
#include "util/serialize.h"
#include "exceptions.h"
#include "debug.h"
#include "gamedef.h"
#include "mapnode.h"
#include <fstream>
#include <algorithm>
#include <cmath>
+ Include dependency graph for nodedef.cpp:

Macros

#define WRITEBOX(box)
 
#define READBOXES(box)
 
#define TILE_FLAG_BACKFACE_CULLING   (1 << 0)
 
#define TILE_FLAG_TILEABLE_HORIZONTAL   (1 << 1)
 
#define TILE_FLAG_TILEABLE_VERTICAL   (1 << 2)
 
#define TILE_FLAG_HAS_COLOR   (1 << 3)
 
#define TILE_FLAG_HAS_SCALE   (1 << 4)
 
#define TILE_FLAG_HAS_ALIGN_STYLE   (1 << 5)
 

Functions

static void fillTileAttribs (ITextureSource *tsrc, TileLayer *layer, const TileSpec &tile, const TileDef &tiledef, video::SColor color, u8 material_type, u32 shader_id, bool backface_culling, const TextureSettings &tsettings)
 
bool isWorldAligned (AlignStyle style, WorldAlignMode mode, NodeDrawType drawtype)
 
void boxVectorUnion (const std::vector< aabb3f > &boxes, aabb3f *box_union)
 
void getNodeBoxUnion (const NodeBox &nodebox, const ContentFeatures &features, aabb3f *box_union)
 
NodeDefManagercreateNodeDefManager ()
 
static void removeDupes (std::vector< content_t > &list)
 

Macro Definition Documentation

◆ READBOXES

#define READBOXES (   box)
Value:
{ \
count = readU16(is); \
(box).reserve(count); \
while (count--) { \
v3f min = readV3F32(is); \
v3f max = readV3F32(is); \
(box).emplace_back(min, max); }; }
u16 readU16(const u8 *data)
Definition: serialize.h:112
v3f readV3F32(const u8 *data)
Definition: serialize.h:270

◆ TILE_FLAG_BACKFACE_CULLING

#define TILE_FLAG_BACKFACE_CULLING   (1 << 0)

◆ TILE_FLAG_HAS_ALIGN_STYLE

#define TILE_FLAG_HAS_ALIGN_STYLE   (1 << 5)

◆ TILE_FLAG_HAS_COLOR

#define TILE_FLAG_HAS_COLOR   (1 << 3)

◆ TILE_FLAG_HAS_SCALE

#define TILE_FLAG_HAS_SCALE   (1 << 4)

◆ TILE_FLAG_TILEABLE_HORIZONTAL

#define TILE_FLAG_TILEABLE_HORIZONTAL   (1 << 1)

◆ TILE_FLAG_TILEABLE_VERTICAL

#define TILE_FLAG_TILEABLE_VERTICAL   (1 << 2)

◆ WRITEBOX

#define WRITEBOX (   box)
Value:
writeU16(os, (box).size()); \
for (const aabb3f &i: (box)) { \
writeV3F32(os, i.MinEdge); \
writeV3F32(os, i.MaxEdge); \
};
core::aabbox3d< f32 > aabb3f
Definition: irr_aabb3d.h:26
void writeU16(u8 *data, u16 i)
Definition: serialize.h:134

Function Documentation

◆ boxVectorUnion()

void boxVectorUnion ( const std::vector< aabb3f > &  boxes,
aabb3f box_union 
)

Returns the smallest box that contains all boxes in the vector. Box_union is expanded.

Parameters
[in]boxesthe vector containing the boxes
[in,out]box_unionthe union of the arguments

Referenced by getNodeBoxUnion().

+ Here is the caller graph for this function:

◆ createNodeDefManager()

NodeDefManager* createNodeDefManager ( )

Referenced by TestGameDef::TestGameDef(), and Game::init().

+ Here is the caller graph for this function:

◆ fillTileAttribs()

static void fillTileAttribs ( ITextureSource tsrc,
TileLayer layer,
const TileSpec tile,
const TileDef tiledef,
video::SColor  color,
u8  material_type,
u32  shader_id,
bool  backface_culling,
const TextureSettings tsettings 
)
static

◆ getNodeBoxUnion()

void getNodeBoxUnion ( const NodeBox nodebox,
const ContentFeatures features,
aabb3f box_union 
)

Returns a box that contains the nodebox in every case. The argument node_union is expanded.

Parameters
[in]nodeboxthe nodebox to be measured
[in]featuresused to decide whether the nodebox can be rotated
[in,out]box_unionthe union of the arguments

References boxVectorUnion(), BS, NodeBox::connect_back, NodeBox::connect_bottom, NodeBox::connect_front, NodeBox::connect_left, NodeBox::connect_right, NodeBox::connect_top, CPT2_COLORED_FACEDIR, CPT2_FACEDIR, NodeBox::disconnected, NodeBox::disconnected_back, NodeBox::disconnected_bottom, NodeBox::disconnected_front, NodeBox::disconnected_left, NodeBox::disconnected_right, NodeBox::disconnected_sides, NodeBox::disconnected_top, NodeBox::fixed, NODEBOX_CONNECTED, NODEBOX_FIXED, NODEBOX_LEVELED, NODEBOX_WALLMOUNTED, ContentFeatures::param_type_2, NodeBox::type, NodeBox::wall_bottom, NodeBox::wall_side, and NodeBox::wall_top.

Referenced by NodeDefManager::deSerialize(), and NodeDefManager::set().

+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ isWorldAligned()

bool isWorldAligned ( AlignStyle  style,
WorldAlignMode  mode,
NodeDrawType  drawtype 
)

References ALIGN_STYLE_USER_DEFINED, ALIGN_STYLE_WORLD, NDT_NODEBOX, NDT_NORMAL, WORLDALIGN_DISABLE, WORLDALIGN_FORCE, and WORLDALIGN_FORCE_NODEBOX.

Referenced by ContentFeatures::updateTextures().

+ Here is the caller graph for this function:

◆ removeDupes()

static void removeDupes ( std::vector< content_t > &  list)
static

Referenced by NodeDefManager::resolveCrossrefs().

+ Here is the caller graph for this function: