23#define CONTENT_MAX UINT16_MAX
31#define MAX_REGISTERED_CONTENT 0x7fffU
40#define CONTENT_UNKNOWN 125
46#define CONTENT_AIR 126
58#define CONTENT_IGNORE 127
99#define LIQUID_LEVEL_MASK 0x07
100#define LIQUID_FLOW_DOWN_MASK 0x08
106#define LIQUID_LEVEL_MAX LIQUID_LEVEL_MASK
107#define LIQUID_LEVEL_SOURCE (LIQUID_LEVEL_MAX+1)
109#define LIQUID_INFINITY_MASK 0x80
112#define LEVELED_MASK 0x7F
113#define LEVELED_MAX LEVELED_MASK
156 return (param0 == other.param0
157 && param1 == other.param1
158 && param2 == other.param2);
202 param1 |= a_light & 0x0f;
206 param1 |= (a_light & 0x0f)<<4;
222 u8 raw_light = getLightRaw(bank, f);
223 return MYMAX(f.light_source, raw_light);
234 return bank ==
LIGHTBANK_DAY ? param1 & 0x0f : (param1 >> 4) & 0x0f;
244 return blend_light(daylight_factor, lightday, lightnight);
247 u8 getFaceDir(
const NodeDefManager *nodemgr,
bool allow_wallmounted =
false)
const;
261 u8 getNeighbors(
v3s16 p,
Map *map)
const;
266 void getNodeBoxes(
const NodeDefManager *nodemgr, std::vector<aabb3f> *boxes,
267 u8 neighbors = 0)
const;
273 std::vector<aabb3f> *boxes, u8 neighbors = 0)
const;
279 std::vector<aabb3f> *boxes, u8 neighbors = 0)
const;
293 static u32 serializedLength(u8 version);
294 void serialize(u8 *dest, u8 version)
const;
295 void deSerialize(u8 *source, u8 version);
305 const MapNode *nodes, u32 nodecount,
306 u8 content_width, u8 params_width);
307 static void deSerializeBulk(std::istream &is,
int version,
309 u8 content_width, u8 params_width);
313 void deSerialize_pre22(
const u8 *source, u8 version);
#define MYMAX(a, b)
Definition basic_macros.h:11
This class is for getting the actual properties of nodes from their content ID.
Definition nodedef.h:541
core::vector3d< s16 > v3s16
Definition irr_v3d.h:13
u8 blend_light(u32 daylight_factor, u8 lightday, u8 lightnight)
Definition light.h:61
Rotation
Definition mapnode.h:88
@ ROTATE_180
Definition mapnode.h:91
@ ROTATE_270
Definition mapnode.h:92
@ ROTATE_RAND
Definition mapnode.h:93
@ ROTATE_90
Definition mapnode.h:90
@ ROTATE_0
Definition mapnode.h:89
u16 content_t
Definition mapnode.h:22
LightBank
Definition mapnode.h:80
@ LIGHTBANK_NIGHT
Definition mapnode.h:82
@ LIGHTBANK_DAY
Definition mapnode.h:81
bool light_propagates
Definition mapnode.h:66
bool sunlight_propagates
Definition mapnode.h:67
u8 light_source
Definition mapnode.h:64
bool operator!=(const ContentLightingFlags &other) const
Definition mapnode.h:75
bool operator==(const ContentLightingFlags &other) const
Definition mapnode.h:69
bool has_light
Definition mapnode.h:65
u8 getParam2() const noexcept
Definition mapnode.h:178
bool isLightDayNightEq(ContentLightingFlags f) const noexcept
Check if the light value for night differs from the light value for day.
Definition mapnode.h:215
content_t getContent() const noexcept
Definition mapnode.h:162
bool operator==(const MapNode &other) const noexcept
Definition mapnode.h:154
u8 param1
Definition mapnode.h:138
u8 param2
Definition mapnode.h:144
u8 getParam1() const noexcept
Definition mapnode.h:170
void setContent(content_t c) noexcept
Definition mapnode.h:166
void setLight(LightBank bank, u8 a_light, ContentLightingFlags f) noexcept
Definition mapnode.h:195
MapNode(content_t content, u8 a_param1=0, u8 a_param2=0) noexcept
Definition mapnode.h:148
u8 getLightRaw(LightBank bank, ContentLightingFlags f) const noexcept
Definition mapnode.h:231
u8 getLight(LightBank bank, ContentLightingFlags f) const noexcept
Definition mapnode.h:220
u16 param0
Definition mapnode.h:128
void setParam2(u8 p) noexcept
Definition mapnode.h:182
void setParam1(u8 p) noexcept
Definition mapnode.h:174
u8 getLightBlend(u32 daylight_factor, ContentLightingFlags f) const
Definition mapnode.h:240
static std::string p(std::string path)
Definition test_filesys.cpp:53