improve loading time
This commit is contained in:
@@ -4,7 +4,7 @@ window.Gui = class {
|
|||||||
stack.save();
|
stack.save();
|
||||||
stack.fillStyle = color;
|
stack.fillStyle = color;
|
||||||
stack.globalAlpha = alpha;
|
stack.globalAlpha = alpha;
|
||||||
stack.fillRect(left, top, right - left, bottom - top);
|
stack.fillRect(Math.floor(left), Math.floor(top), Math.floor(right - left), Math.floor(bottom - top));
|
||||||
stack.restore();
|
stack.restore();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
@@ -3,7 +3,7 @@ window.World = class {
|
|||||||
static TOTAL_HEIGHT = ChunkSection.SIZE * 8 - 1; // ChunkSection.SIZE * 16 - 1;
|
static TOTAL_HEIGHT = ChunkSection.SIZE * 8 - 1; // ChunkSection.SIZE * 16 - 1;
|
||||||
|
|
||||||
constructor(minecraft) {
|
constructor(minecraft) {
|
||||||
this.minecrat = minecraft;
|
this.minecraft = minecraft;
|
||||||
|
|
||||||
this.group = new THREE.Object3D();
|
this.group = new THREE.Object3D();
|
||||||
this.group.matrixAutoUpdate = false;
|
this.group.matrixAutoUpdate = false;
|
||||||
@@ -17,7 +17,7 @@ window.World = class {
|
|||||||
// Update lights async
|
// Update lights async
|
||||||
let scope = this;
|
let scope = this;
|
||||||
setInterval(function () {
|
setInterval(function () {
|
||||||
let i = 1000;
|
let i = scope.minecraft.loadingScreen === null ? 1000 : 100000;
|
||||||
while (scope.lightUpdateQueue.length >= 10 && i > 0) {
|
while (scope.lightUpdateQueue.length >= 10 && i > 0) {
|
||||||
i--;
|
i--;
|
||||||
scope.lightUpdateQueue.shift().updateBlockLightning(scope);
|
scope.lightUpdateQueue.shift().updateBlockLightning(scope);
|
||||||
@@ -26,7 +26,7 @@ window.World = class {
|
|||||||
}
|
}
|
||||||
|
|
||||||
onTick() {
|
onTick() {
|
||||||
let player = this.minecrat.player;
|
let player = this.minecraft.player;
|
||||||
let cameraChunkX = Math.floor(player.x >> 4);
|
let cameraChunkX = Math.floor(player.x >> 4);
|
||||||
let cameraChunkZ = Math.floor(player.z >> 4);
|
let cameraChunkZ = Math.floor(player.z >> 4);
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user