Procházet zdrojové kódy

update all chunks at once

fix/style
Martin Dørum před 3 roky
rodič
revize
6e1b068d1c
1 změnil soubory, kde provedl 7 přidání a 2 odebrání
  1. 7
    2
      libswan/src/LightServer.cc

+ 7
- 2
libswan/src/LightServer.cc Zobrazit soubor

@@ -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();
}
}

Načítá se…
Zrušit
Uložit