minor refactor
This commit is contained in:
@@ -65,14 +65,13 @@ void Lighting::buildSkyLight(int cx, int cz){
|
||||
Chunk* chunk = chunks->getChunk(cx, cz);
|
||||
for (int z = 0; z < CHUNK_D; z++){
|
||||
for (int x = 0; x < CHUNK_W; x++){
|
||||
int gx = x + cx * CHUNK_W;
|
||||
int gz = z + cz * CHUNK_D;
|
||||
for (int y = chunk->lightmap.highestPoint; y >= 0; y--){
|
||||
int gx = x + cx * CHUNK_W;
|
||||
int gz = z + cz * CHUNK_D;
|
||||
while (y > 0 && !blockDefs[chunk->voxels[vox_index(x, y, z)].id]->lightPassing) {
|
||||
y--;
|
||||
}
|
||||
if (chunk->lightmap.getS(x, y, z) != 15) {
|
||||
solverS->add(gx,y+1,gz);
|
||||
for (; y >= 0; y--){
|
||||
solverS->add(gx+1,y,gz);
|
||||
solverS->add(gx-1,y,gz);
|
||||
|
||||
Reference in New Issue
Block a user