mirror of
https://github.com/MihailRis/voxelcore.git
synced 2026-10-07 20:11:50 +00:00
converting block states to a bitfield
This commit is contained in:
parent
5dd06b233e
commit
6d933ac263
17 changed files with 197 additions and 164 deletions
|
|
@ -10,7 +10,7 @@ void FlatWorldGenerator::generate(voxel* voxels, int cx, int cz, int seed) {
|
|||
for (int x = 0; x < CHUNK_W; x++) {
|
||||
for (int cur_y = 0; cur_y < CHUNK_H; cur_y++){
|
||||
int id = BLOCK_AIR;
|
||||
int states = 0;
|
||||
blockstate state {};
|
||||
|
||||
if(cur_y == 2) {
|
||||
id = idBazalt;
|
||||
|
|
@ -21,7 +21,7 @@ void FlatWorldGenerator::generate(voxel* voxels, int cx, int cz, int seed) {
|
|||
}
|
||||
|
||||
voxels[(cur_y * CHUNK_D + z) * CHUNK_W + x].id = id;
|
||||
voxels[(cur_y * CHUNK_D + z) * CHUNK_W + x].states = states;
|
||||
voxels[(cur_y * CHUNK_D + z) * CHUNK_W + x].state = state;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue