diff --git a/src/modules/main_menu.js b/src/modules/main_menu.js index 5d7ca0c..711e0dc 100644 --- a/src/modules/main_menu.js +++ b/src/modules/main_menu.js @@ -108,12 +108,15 @@ export default function () { lerp_factor = 0 }) - for (let x = -3; x < 3; x++) - for (let z = -3; z < 3; z++) { - CHUNK_CACHE.get(make_chunk_key({ x, z })).forEach(volume => - instanced_volume.add_volume(volume), - ) - } + // @ts-ignore + CHUNK_CACHE.loading.then(() => { + for (let x = -3; x < 3; x++) + for (let z = -3; z < 3; z++) { + CHUNK_CACHE.get(make_chunk_key({ x, z })).forEach(volume => + instanced_volume.add_volume(volume), + ) + } + }) scene.add(instanced_volume) diff --git a/src/utils/import_map.js b/src/utils/import_map.js index af96990..ed9665b 100644 --- a/src/utils/import_map.js +++ b/src/utils/import_map.js @@ -90,7 +90,8 @@ async function import_chunks() { const time = Date.now() logger.ASSET('Loading heights..') -fetch(heights) +// @ts-ignore +CHUNK_CACHE.loading = fetch(heights) .then(response => response.arrayBuffer()) .then(async heights_buffer => { new Int16Array(HEIGHTS).set(new Int16Array(heights_buffer))