Parcourir la source

update all chunks at once

fix/style
Martin Dørum il y a 3 ans
Parent
révision
6e1b068d1c
1 fichiers modifiés avec 7 ajouts et 2 suppressions
  1. 7
    2
      libswan/src/LightServer.cc

+ 7
- 2
libswan/src/LightServer.cc Voir le fichier

@@ -237,8 +237,6 @@ void LightServer::processUpdatedChunk(LightChunk &chunk, ChunkPos cpos) {
auto end = std::chrono::steady_clock::now();
auto dur = std::chrono::duration<double, std::milli>(end - start);
info << "Generating light for " << cpos << " took " << dur.count() << "ms";

cb_.onLightChunkUpdated(chunk, cpos);
}

void LightServer::run() {
@@ -267,6 +265,13 @@ void LightServer::run() {
}
}

for (auto &pos: updated_chunks_) {
auto ch = chunks_.find(pos);
if (ch != chunks_.end()) {
cb_.onLightChunkUpdated(ch->second, pos);
}
}

updated_chunks_.clear();
}
}

Chargement…
Annuler
Enregistrer