From a3de6f91226d827d79093c379c0b9289e4466e8e Mon Sep 17 00:00:00 2001 From: "Lukas Rieger (Blue)" Date: Fri, 2 Sep 2022 22:08:00 +0200 Subject: [PATCH] Improve tile-loading --- src/map/TileManager.js | 14 ++------------ 1 file changed, 2 insertions(+), 12 deletions(-) diff --git a/src/map/TileManager.js b/src/map/TileManager.js index d9c7fe3..a379076 100644 --- a/src/map/TileManager.js +++ b/src/map/TileManager.js @@ -192,21 +192,11 @@ export class TileManager { this.tiles.set(tileHash, tile); tile.load(this.tileLoader) .then(() => { - if (!tile.unloaded) - this.tileMap.setTile(tile.x - this.centerTile.x + TileManager.tileMapHalfSize, tile.z - this.centerTile.y + TileManager.tileMapHalfSize, TileMap.LOADED); - if (this.loadTimeout) clearTimeout(this.loadTimeout); this.loadTimeout = setTimeout(this.loadCloseTiles, 0); }) - .catch(error => { - if (error.status && error.status === "empty") return; - if (error.target && error.target.status === 404) return; - if (error.type && error.type === "abort") return; - - //alert(this.events, "Failed to load tile: " + error.type, "warning"); - }) + .catch(error => {}) .finally(() => { - //this.tileMap.setTile(tile.x - this.centerTile.x + TileManager.tileMapHalfSize, tile.z - this.centerTile.y + TileManager.tileMapHalfSize, TileMap.LOADED); this.currentlyLoading--; }); @@ -214,7 +204,7 @@ export class TileManager { } handleLoadedTile = tile => { - //this.tileMap.setTile(tile.x - this.centerTile.x + TileManager.tileMapHalfSize, tile.z - this.centerTile.y + TileManager.tileMapHalfSize, TileMap.LOADED); + this.tileMap.setTile(tile.x - this.centerTile.x + TileManager.tileMapHalfSize, tile.z - this.centerTile.y + TileManager.tileMapHalfSize, TileMap.LOADED); this.scene.add(tile.model); this.onTileLoad(tile);