38#define CONTENT_MAX UINT16_MAX
46#define MAX_REGISTERED_CONTENT 0x7fffU
55#define CONTENT_UNKNOWN 125
61#define CONTENT_AIR 126
73#define CONTENT_IGNORE 127
114#define LIQUID_LEVEL_MASK 0x07
115#define LIQUID_FLOW_DOWN_MASK 0x08
121#define LIQUID_LEVEL_MAX LIQUID_LEVEL_MASK
122#define LIQUID_LEVEL_SOURCE (LIQUID_LEVEL_MAX+1)
124#define LIQUID_INFINITY_MASK 0x80
127#define LEVELED_MASK 0x7F
128#define LEVELED_MAX LEVELED_MASK
171 return (param0 == other.param0
172 && param1 == other.param1
173 && param2 == other.param2);
217 param1 |= a_light & 0x0f;
221 param1 |= (a_light & 0x0f)<<4;
237 u8 raw_light = getLightRaw(bank, f);
238 return MYMAX(f.light_source, raw_light);
249 return bank ==
LIGHTBANK_DAY ? param1 & 0x0f : (param1 >> 4) & 0x0f;
259 return blend_light(daylight_factor, lightday, lightnight);
262 u8 getFaceDir(
const NodeDefManager *nodemgr,
bool allow_wallmounted =
false)
const;
276 u8 getNeighbors(
v3s16 p,
Map *map)
const;
281 void getNodeBoxes(
const NodeDefManager *nodemgr, std::vector<aabb3f> *boxes,
282 u8 neighbors = 0)
const;
288 std::vector<aabb3f> *boxes, u8 neighbors = 0)
const;
294 std::vector<aabb3f> *boxes, u8 neighbors = 0)
const;
308 static u32 serializedLength(u8 version);
309 void serialize(u8 *dest, u8 version)
const;
310 void deSerialize(u8 *source, u8 version);
320 const MapNode *nodes, u32 nodecount,
321 u8 content_width, u8 params_width);
322 static void deSerializeBulk(std::istream &is,
int version,
324 u8 content_width, u8 params_width);
328 void deSerialize_pre22(
const u8 *source, u8 version);
#define MYMAX(a, b)
Definition basic_macros.h:26
This class is for getting the actual properties of nodes from their content ID.
Definition nodedef.h:556
core::vector3d< s16 > v3s16
Definition irr_v3d.h:28
u8 blend_light(u32 daylight_factor, u8 lightday, u8 lightnight)
Definition light.h:75
Rotation
Definition mapnode.h:103
@ ROTATE_180
Definition mapnode.h:106
@ ROTATE_270
Definition mapnode.h:107
@ ROTATE_RAND
Definition mapnode.h:108
@ ROTATE_90
Definition mapnode.h:105
@ ROTATE_0
Definition mapnode.h:104
u16 content_t
Definition mapnode.h:37
LightBank
Definition mapnode.h:95
@ LIGHTBANK_NIGHT
Definition mapnode.h:97
@ LIGHTBANK_DAY
Definition mapnode.h:96
bool light_propagates
Definition mapnode.h:81
bool sunlight_propagates
Definition mapnode.h:82
u8 light_source
Definition mapnode.h:79
bool operator!=(const ContentLightingFlags &other) const
Definition mapnode.h:90
bool operator==(const ContentLightingFlags &other) const
Definition mapnode.h:84
bool has_light
Definition mapnode.h:80
u8 getParam2() const noexcept
Definition mapnode.h:193
bool isLightDayNightEq(ContentLightingFlags f) const noexcept
Check if the light value for night differs from the light value for day.
Definition mapnode.h:230
content_t getContent() const noexcept
Definition mapnode.h:177
bool operator==(const MapNode &other) const noexcept
Definition mapnode.h:169
u8 param1
Definition mapnode.h:153
u8 param2
Definition mapnode.h:159
u8 getParam1() const noexcept
Definition mapnode.h:185
void setContent(content_t c) noexcept
Definition mapnode.h:181
void setLight(LightBank bank, u8 a_light, ContentLightingFlags f) noexcept
Definition mapnode.h:210
MapNode(content_t content, u8 a_param1=0, u8 a_param2=0) noexcept
Definition mapnode.h:163
u8 getLightRaw(LightBank bank, ContentLightingFlags f) const noexcept
Definition mapnode.h:246
u8 getLight(LightBank bank, ContentLightingFlags f) const noexcept
Definition mapnode.h:235
u16 param0
Definition mapnode.h:143
void setParam2(u8 p) noexcept
Definition mapnode.h:197
void setParam1(u8 p) noexcept
Definition mapnode.h:189
u8 getLightBlend(u32 daylight_factor, ContentLightingFlags f) const
Definition mapnode.h:255
static std::string p(std::string path)
Definition test_filesys.cpp:66