mirror of
https://github.com/MihailRis/voxelcore.git
synced 2026-10-04 18:41:51 +00:00
increased world loading speed and ui scroll
This commit is contained in:
parent
ac9d0d7993
commit
1938ccc803
3 changed files with 11 additions and 12 deletions
|
|
@ -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;
|
||||
}
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue