mirror of
https://github.com/MihailRis/voxelcore.git
synced 2026-10-07 03:51:50 +00:00
Worlds indexing
This commit is contained in:
parent
eea920d98f
commit
f513c094a9
19 changed files with 383 additions and 141 deletions
|
|
@ -1,5 +1,6 @@
|
|||
#include "Chunk.h"
|
||||
#include "voxel.h"
|
||||
#include "../content/ContentLUT.h"
|
||||
#include "../lighting/Lightmap.h"
|
||||
|
||||
Chunk::Chunk(int xpos, int zpos) : x(xpos), z(zpos){
|
||||
|
|
@ -80,3 +81,10 @@ bool Chunk::decode(ubyte* data) {
|
|||
}
|
||||
return true;
|
||||
}
|
||||
|
||||
void Chunk::convert(ubyte* data, const ContentLUT* lut) {
|
||||
for (size_t i = 0; i < CHUNK_VOL; i++) {
|
||||
blockid_t id = data[i];
|
||||
data[i] = lut->getBlockId(id);
|
||||
}
|
||||
}
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue