1
0
mirror of https://github.com/luanti-org/minetestmapper.git synced 2025-10-08 06:35:26 +02:00

Move source files into folder

This commit is contained in:
sfan5
2025-02-18 15:45:14 +01:00
parent 1c16c40ccc
commit 527a56f22e
31 changed files with 40 additions and 32 deletions

28
src/BlockDecoder.h Normal file
View File

@@ -0,0 +1,28 @@
#pragma once
#include <cstdint>
#include <unordered_map>
#include "types.h"
#include <ZstdDecompressor.h>
class BlockDecoder {
public:
BlockDecoder();
void reset();
void decode(const ustring &data);
bool isEmpty() const;
// returns "" for air, ignore and invalid nodes
const std::string &getNode(u8 x, u8 y, u8 z) const;
private:
typedef std::unordered_map<uint16_t, std::string> NameMap;
NameMap m_nameMap;
uint16_t m_blockAirId, m_blockIgnoreId;
u8 m_version, m_contentWidth;
ustring m_mapData;
// one instance for performance
ZstdDecompressor m_zstd_decompressor;
};