NBT: Allow parsing from compressed data

This commit is contained in:
DankParrot 2020-08-12 19:36:40 -07:00
parent 935d29a30d
commit 35f91c17a1
2 changed files with 10 additions and 1 deletions

View File

@ -164,6 +164,11 @@ namespace NBT
{ {
} }
CompoundTag::CompoundTag(const void* data, size_t length)
: CompoundTag(nbt_parse_compressed(data, length))
{
}
CompoundTag::~CompoundTag() CompoundTag::~CompoundTag()
{ {
nbt_free(m_node); nbt_free(m_node);

View File

@ -136,7 +136,11 @@ namespace NBT
public: public:
CompoundTag(nbt_node* node) : Tag(node) {} CompoundTag(nbt_node* node) : Tag(node) {}
CompoundTag(const char *filename); CompoundTag(const char* filename);
// Read a compound tag from compressed data
CompoundTag(const void* data, size_t length);
~CompoundTag(); ~CompoundTag();
template <typename T> template <typename T>