add Chunk.blocksMetadata
This commit is contained in:
parent
3d219b9a1c
commit
44753904dc
@ -3,6 +3,7 @@
|
|||||||
#include <utility>
|
#include <utility>
|
||||||
|
|
||||||
#include "core_defs.hpp"
|
#include "core_defs.hpp"
|
||||||
|
#include "data/StructLayout.hpp"
|
||||||
#include "util/stringutil.hpp"
|
#include "util/stringutil.hpp"
|
||||||
|
|
||||||
std::string to_string(BlockModel model) {
|
std::string to_string(BlockModel model) {
|
||||||
@ -102,6 +103,8 @@ Block::Block(const std::string& name)
|
|||||||
} {
|
} {
|
||||||
}
|
}
|
||||||
|
|
||||||
|
Block::~Block() {}
|
||||||
|
|
||||||
Block::Block(std::string name, const std::string& texture)
|
Block::Block(std::string name, const std::string& texture)
|
||||||
: name(std::move(name)),
|
: name(std::move(name)),
|
||||||
textureFaces {texture, texture, texture, texture, texture, texture} {
|
textureFaces {texture, texture, texture, texture, texture, texture} {
|
||||||
|
|||||||
@ -9,6 +9,10 @@
|
|||||||
#include "maths/aabb.hpp"
|
#include "maths/aabb.hpp"
|
||||||
#include "typedefs.hpp"
|
#include "typedefs.hpp"
|
||||||
|
|
||||||
|
namespace data {
|
||||||
|
class StructLayout;
|
||||||
|
}
|
||||||
|
|
||||||
inline std::string BLOCK_ITEM_SUFFIX = ".item";
|
inline std::string BLOCK_ITEM_SUFFIX = ".item";
|
||||||
|
|
||||||
inline constexpr uint FACE_MX = 0;
|
inline constexpr uint FACE_MX = 0;
|
||||||
@ -184,6 +188,8 @@ public:
|
|||||||
// @brief Block tick interval (1 - 20tps, 2 - 10tps)
|
// @brief Block tick interval (1 - 20tps, 2 - 10tps)
|
||||||
uint tickInterval = 1;
|
uint tickInterval = 1;
|
||||||
|
|
||||||
|
std::unique_ptr<data::StructLayout> dataStruct;
|
||||||
|
|
||||||
/// @brief Runtime indices (content indexing results)
|
/// @brief Runtime indices (content indexing results)
|
||||||
struct {
|
struct {
|
||||||
/// @brief block runtime integer id
|
/// @brief block runtime integer id
|
||||||
@ -211,6 +217,7 @@ public:
|
|||||||
Block(const std::string& name);
|
Block(const std::string& name);
|
||||||
Block(std::string name, const std::string& texture);
|
Block(std::string name, const std::string& texture);
|
||||||
Block(const Block&) = delete;
|
Block(const Block&) = delete;
|
||||||
|
~Block();
|
||||||
|
|
||||||
void cloneTo(Block& dst);
|
void cloneTo(Block& dst);
|
||||||
};
|
};
|
||||||
|
|||||||
@ -7,11 +7,11 @@
|
|||||||
|
|
||||||
#include "constants.hpp"
|
#include "constants.hpp"
|
||||||
#include "lighting/Lightmap.hpp"
|
#include "lighting/Lightmap.hpp"
|
||||||
|
#include "util/SmallHeap.hpp"
|
||||||
#include "voxel.hpp"
|
#include "voxel.hpp"
|
||||||
|
|
||||||
inline constexpr int CHUNK_DATA_LEN = CHUNK_VOL * 4;
|
inline constexpr int CHUNK_DATA_LEN = CHUNK_VOL * 4;
|
||||||
|
|
||||||
class Lightmap;
|
|
||||||
class ContentReport;
|
class ContentReport;
|
||||||
class Inventory;
|
class Inventory;
|
||||||
|
|
||||||
@ -40,6 +40,8 @@ public:
|
|||||||
|
|
||||||
/// @brief Block inventories map where key is index of block in voxels array
|
/// @brief Block inventories map where key is index of block in voxels array
|
||||||
chunk_inventories_map inventories;
|
chunk_inventories_map inventories;
|
||||||
|
/// @brief Blocks metadata heap
|
||||||
|
util::SmallHeap<uint16_t, uint8_t> blocksMetadata;
|
||||||
|
|
||||||
Chunk(int x, int z);
|
Chunk(int x, int z);
|
||||||
|
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user