mirror of
https://github.com/danbulant/heaventaker
synced 2026-06-21 15:51:57 +00:00
optimize sprite generation
This commit is contained in:
parent
972e69c07d
commit
716c5725bb
1 changed files with 1 additions and 0 deletions
|
|
@ -59,6 +59,7 @@ async function getTree({ directory }) {
|
|||
async function makeSprite({ directory, base, out }) {
|
||||
const rel = directory.substr(base.length);
|
||||
const loc = path.join(out, rel) + ".png";
|
||||
if(fsSync.existsSync(loc)) return;
|
||||
const files = (await fs.readdir(directory)).sort((a, b) => parseInt(a) - parseInt(b));
|
||||
|
||||
const canvas = createCanvas(files.length * 100, 100);
|
||||
|
|
|
|||
Loading…
Reference in a new issue