-/*
- If true, the material allows light propagation and brightness is stored
- in param.
- NOTE: Don't use, use "content_features(m).whatever" instead
-*/
-inline bool light_propagates_content(u8 m)
-{
- return content_features(m).light_propagates;
-}
-/*
- If true, the material allows lossless sunlight propagation.
- NOTE: It doesn't seem to go through torches regardlessly of this
- NOTE: Don't use, use "content_features(m).whatever" instead
-*/
-inline bool sunlight_propagates_content(u8 m)
-{
- return content_features(m).sunlight_propagates;
-}
-/*
- On a node-node surface, the material of the node with higher solidness
- is used for drawing.
- 0: Invisible
- 1: Transparent
- 2: Opaque
- NOTE: Don't use, use "content_features(m).whatever" instead
-*/
-inline u8 content_solidness(u8 m)
-{
- return content_features(m).solidness;
-}
-// Objects collide with walkable contents
-// NOTE: Don't use, use "content_features(m).whatever" instead
-inline bool content_walkable(u8 m)
-{
- return content_features(m).walkable;
-}
-// NOTE: Don't use, use "content_features(m).whatever" instead
-inline bool content_liquid(u8 m)
-{
- return content_features(m).liquid_type != LIQUID_NONE;
-}
-// NOTE: Don't use, use "content_features(m).whatever" instead
-inline bool content_flowing_liquid(u8 m)
-{
- return content_features(m).liquid_type == LIQUID_FLOWING;
-}
-// NOTE: Don't use, use "content_features(m).whatever" instead
-inline bool content_liquid_source(u8 m)
-{
- return content_features(m).liquid_type == LIQUID_SOURCE;
-}
-// CONTENT_WATER || CONTENT_WATERSOURCE -> CONTENT_WATER
-// CONTENT_LAVA || CONTENT_LAVASOURCE -> CONTENT_LAVA
-// NOTE: Don't use, use "content_features(m).whatever" instead
-inline u8 make_liquid_flowing(u8 m)
-{
- u8 c = content_features(m).liquid_alternative_flowing;
- assert(c != CONTENT_IGNORE);
- return c;
-}
-// Pointable contents can be pointed to in the map
-// NOTE: Don't use, use "content_features(m).whatever" instead
-inline bool content_pointable(u8 m)
-{
- return content_features(m).pointable;
-}
-// NOTE: Don't use, use "content_features(m).whatever" instead
-inline bool content_diggable(u8 m)
-{
- return content_features(m).diggable;
-}
-// NOTE: Don't use, use "content_features(m).whatever" instead
-inline bool content_buildable_to(u8 m)
-{
- return content_features(m).buildable_to;
-}
-
-/*
- Nodes make a face if contents differ and solidness differs.
- Return value:
- 0: No face
- 1: Face uses m1's content
- 2: Face uses m2's content
-*/
-inline u8 face_contents(u8 m1, u8 m2)
-{
- if(m1 == CONTENT_IGNORE || m2 == CONTENT_IGNORE)
- return 0;
-
- bool contents_differ = (m1 != m2);
-
- // Contents don't differ for different forms of same liquid
- if(content_liquid(m1) && content_liquid(m2)
- && make_liquid_flowing(m1) == make_liquid_flowing(m2))
- contents_differ = false;
-
- bool solidness_differs = (content_solidness(m1) != content_solidness(m2));
- bool makes_face = contents_differ && solidness_differs;
-
- if(makes_face == false)
- return 0;
-
- if(content_solidness(m1) > content_solidness(m2))
- return 1;
- else
- return 2;
-}
-
-/*
- Packs directions like (1,0,0), (1,-1,0)
-*/
-inline u8 packDir(v3s16 dir)
-{
- u8 b = 0;
-
- if(dir.X > 0)
- b |= (1<<0);
- else if(dir.X < 0)
- b |= (1<<1);
-
- if(dir.Y > 0)
- b |= (1<<2);
- else if(dir.Y < 0)
- b |= (1<<3);
-
- if(dir.Z > 0)
- b |= (1<<4);
- else if(dir.Z < 0)
- b |= (1<<5);
-
- return b;
-}
-inline v3s16 unpackDir(u8 b)
-{
- v3s16 d(0,0,0);
-
- if(b & (1<<0))
- d.X = 1;
- else if(b & (1<<1))
- d.X = -1;
-
- if(b & (1<<2))
- d.Y = 1;
- else if(b & (1<<3))
- d.Y = -1;
-
- if(b & (1<<4))
- d.Z = 1;
- else if(b & (1<<5))
- d.Z = -1;
-
- return d;
-}
-
-/*
- facedir: CPT_FACEDIR_SIMPLE param1 value
- dir: The face for which stuff is wanted
- return value: The face from which the stuff is actually found
-*/
-v3s16 facedir_rotate(u8 facedir, v3s16 dir);
-
-enum LightBank
-{
- LIGHTBANK_DAY,
- LIGHTBANK_NIGHT
-};