Added 3 unicode pages for font, fixed UI, added Block.breakable

Added 1, 2, 3 and 4 unicode pages from Minecraft.
Font now uses std::wstring instead of std::string
Added Block.breakable field (the only unbreakable block is bedrock)
Bedrock is now selectable
This commit is contained in:
MihailRis 2022-07-14 19:23:31 +03:00 • committed by GitHub
parent b2872650d6
commit bdd3fbf7d4
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
17 changed files with 94 additions and 47 deletions

View file

@ -3,6 +3,8 @@
#include "Chunk.h"
#include "Chunks.h"
#include "Block.h"
#include "voxel.h"
#include "../world/World.h"
#include "WorldGenerator.h"
#include "../lighting/Lighting.h"
@ -36,6 +38,12 @@ void ChunksLoader::_thread(){
WorldGenerator::generate(chunk->voxels, chunk->x, chunk->y, chunk->z, world->seed);
}
for (size_t i = 0; i < CHUNK_VOL; i++){
if (Block::blocks[chunk->voxels[i].id] == nullptr){
std::cout << "corruped block detected at " << i << " of chunk " << chunk->x << "x" << chunk->z << std::endl;
chunk->voxels[i].id = 11;
}
}
lighting.onChunkLoaded(chunk->x, chunk->y, chunk->z, true);
}
else if (state == RENDER){