Woups. Erratas.

This commit is contained in:
MarcEricMartel
2023-08-28 16:23:34 -04:00
parent 8666aceb39
commit 2f8a5893f0
4 changed files with 22 additions and 10 deletions

View File

@@ -454,7 +454,14 @@ void World::UpdateWorld(Player& player, BlockInfo* blockinfo[BTYPE_LAST]) {
threads = 0;
while (!m_tbDeleted.empty() && !frameDelete) {
int del = THREADS_DELETE_CHUNKS;
while (!m_tbDeleted.empty() && del--) { // Moins rapide que le bout en dessous, mais -beaucoup- plus stable.
m_tbDeleted.back()->FlushVBO();
m_tbDeleted.back()->~Chunk();
m_tbDeleted.pop_back();
}
/*while (!m_tbDeleted.empty() && !frameDelete) {
if (m_tbDeleted.back()) {
m_tbDeleted.back()->FlushVBO();
delThList[threads] =
@@ -464,7 +471,7 @@ void World::UpdateWorld(Player& player, BlockInfo* blockinfo[BTYPE_LAST]) {
if (++threads > THREADS_DELETE_CHUNKS) frameDelete = FRAMES_DELETE_CHUNKS;
}
else m_tbDeleted.pop_back();
}
}*/
for (int x = 0; x < threads; ++x) {
delThList[x].wait();