refactor Content
This commit is contained in:
@@ -36,7 +36,7 @@ void Lighting::clear(){
|
||||
}
|
||||
|
||||
void Lighting::prebuildSkyLight(Chunk* chunk, const ContentIndices* indices){
|
||||
auto* blockDefs = indices->getBlockDefs();
|
||||
const auto* blockDefs = indices->blocks.getDefs();
|
||||
|
||||
int highestPoint = 0;
|
||||
for (int z = 0; z < CHUNK_D; z++){
|
||||
@@ -60,7 +60,7 @@ void Lighting::prebuildSkyLight(Chunk* chunk, const ContentIndices* indices){
|
||||
}
|
||||
|
||||
void Lighting::buildSkyLight(int cx, int cz){
|
||||
const Block* const* blockDefs = content->getIndices()->getBlockDefs();
|
||||
const auto blockDefs = content->getIndices()->blocks.getDefs();
|
||||
|
||||
Chunk* chunk = chunks->getChunk(cx, cz);
|
||||
for (int z = 0; z < CHUNK_D; z++){
|
||||
@@ -92,8 +92,8 @@ void Lighting::onChunkLoaded(int cx, int cz, bool expand){
|
||||
LightSolver* solverB = this->solverB.get();
|
||||
LightSolver* solverS = this->solverS.get();
|
||||
|
||||
const Block* const* blockDefs = content->getIndices()->getBlockDefs();
|
||||
const Chunk* chunk = chunks->getChunk(cx, cz);
|
||||
auto blockDefs = content->getIndices()->blocks.getDefs();
|
||||
auto chunk = chunks->getChunk(cx, cz);
|
||||
|
||||
for (uint y = 0; y < CHUNK_H; y++){
|
||||
for (uint z = 0; z < CHUNK_D; z++){
|
||||
@@ -150,7 +150,7 @@ void Lighting::onChunkLoaded(int cx, int cz, bool expand){
|
||||
}
|
||||
|
||||
void Lighting::onBlockSet(int x, int y, int z, blockid_t id){
|
||||
Block* block = content->getIndices()->getBlockDef(id);
|
||||
Block* block = content->getIndices()->blocks.get(id);
|
||||
solverR->remove(x,y,z);
|
||||
solverG->remove(x,y,z);
|
||||
solverB->remove(x,y,z);
|
||||
|
||||
Reference in New Issue
Block a user