Lazy load bitmap map

This commit is contained in:
Varun Patil 2020-10-20 12:34:24 +05:30
parent f75a1e6866
commit 61e8b248f6
2 changed files with 7 additions and 3 deletions

View file

@ -9,7 +9,6 @@
<script src="js/drive.js"></script>
<script src="js/dpad.js"></script>
<script src="gameasync/mapping.js"></script>
<script src="gameasync/bitmap-map.js"></script>
<title>MKXP</title>
<style>
@ -238,8 +237,15 @@
const s = document.createElement('script');
s.setAttribute('src', 'mkxp.js');
document.body.appendChild(s);
getLazyAsset('gameasync/bitmap-map.js', 'Primary assets', () => {
const s = document.createElement('script');
s.setAttribute('src', 'gameasync/bitmap-map.js');
document.body.appendChild(s);
});
});
}, 200);
var bitmapSizeMapping = {};
if (!is_touch_device()) {
document.getElementById('dpad').style.display = 'none';