Browse Source

lighting fix

fix/style
Martin Dørum 3 years ago
parent
commit
b3eb668ef3
1 changed files with 4 additions and 4 deletions
  1. 4
    4
      libswan/src/LightServer.cc

+ 4
- 4
libswan/src/LightServer.cc View File

@@ -116,10 +116,10 @@ void LightServer::processEvent(const Event &evt, std::vector<NewLightChunk> &new

auto markChunksModified = [&](ChunkPos cpos, Vec2i rpos, float light) {
markChunks(cpos, rpos,
light * attenuate(rpos.x) > LIGHT_CUTOFF,
light * attenuate(CHUNK_WIDTH - rpos.x) > LIGHT_CUTOFF,
light * attenuate(rpos.y) > LIGHT_CUTOFF,
light * attenuate(CHUNK_HEIGHT - rpos.y) > LIGHT_CUTOFF);
light * attenuate(std::max(rpos.x - 5, 0)) >= LIGHT_CUTOFF,
light * attenuate(std::max(CHUNK_WIDTH - rpos.x - 5, 0)) >= LIGHT_CUTOFF,
light * attenuate(std::max(rpos.y - 5, 0)) >= LIGHT_CUTOFF,
light * attenuate(std::max(CHUNK_HEIGHT - rpos.y - 5, 0)) >= LIGHT_CUTOFF);
};

auto markChunksModifiedRange = [&](ChunkPos cpos, Vec2i rpos, int range) {

Loading…
Cancel
Save