X-Git-Url: https://git.lizzy.rs/?a=blobdiff_plain;f=src%2Fmapnode.h;h=afd3a96be38c9da87eb5c3102534bb39ddacdb49;hb=refs%2Fheads%2Fmaster;hp=7a3d30ddc36d21e7ac0a13df5728f2d79c7fa52f;hpb=431d8a9b83be858193328fe59e75026fa023393f;p=dragonfireclient.git diff --git a/src/mapnode.h b/src/mapnode.h index 7a3d30ddc..afd3a96be 100644 --- a/src/mapnode.h +++ b/src/mapnode.h @@ -21,6 +21,7 @@ with this program; if not, write to the Free Software Foundation, Inc., #include "irrlichttypes_bloated.h" #include "light.h" +#include "util/pointer.h" #include #include @@ -240,6 +241,9 @@ struct MapNode u8 getWallMounted(const NodeDefManager *nodemgr) const; v3s16 getWallMountedDir(const NodeDefManager *nodemgr) const; + /// @returns Rotation in range 0–239 (in 1.5° steps) + u8 getDegRotate(const NodeDefManager *nodemgr) const; + void rotateAlongYAxis(const NodeDefManager *nodemgr, Rotation rot); /*! @@ -268,12 +272,12 @@ struct MapNode std::vector *boxes, u8 neighbors = 0) const; /* - Liquid helpers + Liquid/leveled helpers */ u8 getMaxLevel(const NodeDefManager *nodemgr) const; u8 getLevel(const NodeDefManager *nodemgr) const; - u8 setLevel(const NodeDefManager *nodemgr, s8 level = 1); - u8 addLevel(const NodeDefManager *nodemgr, s8 add = 1); + s8 setLevel(const NodeDefManager *nodemgr, s16 level = 1); + s8 addLevel(const NodeDefManager *nodemgr, s16 add = 1); /* Serialization functions @@ -290,12 +294,12 @@ struct MapNode // content_width = the number of bytes of content per node // params_width = the number of bytes of params per node // compressed = true to zlib-compress output - static void serializeBulk(std::ostream &os, int version, + static SharedBuffer serializeBulk(int version, const MapNode *nodes, u32 nodecount, - u8 content_width, u8 params_width, bool compressed); + u8 content_width, u8 params_width); static void deSerializeBulk(std::istream &is, int version, MapNode *nodes, u32 nodecount, - u8 content_width, u8 params_width, bool compressed); + u8 content_width, u8 params_width); private: // Deprecated serialization methods