increased world loading speed and ui scroll

This commit is contained in:
MihailRis
2024-01-19 03:53:30 +03:00
parent ac9d0d7993
commit 1938ccc803
3 changed files with 11 additions and 12 deletions
+4 -4
View File
@@ -40,11 +40,11 @@ void ChunksController::update(int64_t maxDuration) {
timeutil::Timer timer;
if (loadVisible()) {
int64_t mcs = timer.stop();
avgDurationMcs = mcs * 0.2 + avgDurationMcs * 0.8;
if (mcstotal + max(avgDurationMcs, mcs) * 2 < maxDuration * 1000) {
if (mcstotal + mcs * 2 < maxDuration * 1000) {
mcstotal += mcs;
continue;
}
mcstotal += mcs;
}
break;
}
@@ -74,8 +74,8 @@ bool ChunksController::loadVisible(){
if (surrounding == MIN_SURROUNDING && !chunk->isLighted()) {
if (!chunk->isLoadedLights()) {
lighting->buildSkyLight(chunk->x, chunk->z);
}
lighting->onChunkLoaded(chunk->x, chunk->z);
lighting->onChunkLoaded(chunk->x, chunk->z);
}
chunk->setLighted(true);
return true;
}