Started rewrite for chunks to come. Left old face and voxel code

This commit is contained in:
Ben Kyd
2019-10-17 16:43:50 +01:00
parent 5a1a226ef2
commit 9dffa6f24f
10 changed files with 59 additions and 23 deletions

View File

@@ -3,10 +3,41 @@
#include "../common.hpp"
static std::vector<std::pair<int, std::string>> TextureIdsAndPaths {
{0, "dirt.png"},
{1, "grass_side.png"},
{2, "grass_top.png"}
class CBlockEntry {
public:
uint8_t ID;
};
// TODO: Make design of the class data oriented
class CBlockDictionary {
public:
void Build();
// The index of the texutres path in this array is equal to
// that textures ID, to be referenced in the block entry
std::vector<std::string> Textures;
// Only supports up to 255 blocs, 0 being air
// word stores vectors of chunks which are 16x16x256
// vectors of uint8_t which reference the block dictionary
std::map<uint8_t, CBlockEntry> BlockEntries;
private:
void registerTexture();
void registerBlock();
};
static CBlockDictionary BlockDictionary;
// static std::vector<std::pair<int, std::string>> TextureIdsAndPaths {
// {0, "dirt.png"},
// {1, "grass_side.png"},
// {2, "grass_top.png"}
// };
#endif