Skip to content

Commit

Permalink
Reworking the way we think about Runefiles
Browse files Browse the repository at this point in the history
  • Loading branch information
Michael-F-Bryan committed Jun 7, 2022
1 parent 1c532f3 commit b4304a0
Show file tree
Hide file tree
Showing 6 changed files with 209 additions and 150 deletions.
22 changes: 12 additions & 10 deletions bindings/web/rune/src/RuneLoader.ts
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,6 @@ import {
stageArguments,
} from "./utils";


export class RuneLoader {
logger: Logger;

Expand All @@ -42,7 +41,7 @@ export class RuneLoader {
const procBlocks = await this.instantiateProcBlocks(nodes, zip);
const models = await this.loadModels(nodes.model, zip, this.modelHandlers);

return create(runefile, procBlocks, models, this.rootLogger);
return await create(runefile, procBlocks, models, this.rootLogger);
}

async parseRunefile(zip: JSZip): Promise<DocumentV1> {
Expand Down Expand Up @@ -80,19 +79,22 @@ export class RuneLoader {

const data = await file.async("arraybuffer");
const procBlock = await ProcBlock.load(
data,
this.rootLogger.child({ procBlock: name })
);
return [ name, procBlock ] as const;
data,
this.rootLogger.child({ procBlock: name })
);
return [name, procBlock] as const;
}
);

const procBlocks = Object.fromEntries(await Promise.all(entries));

this.logger.debug({
count: Object.keys(procBlocks).length,
durationMs: Date.now() - start,
}, "Finished instantiating all proc-blocks");
this.logger.debug(
{
count: Object.keys(procBlocks).length,
durationMs: Date.now() - start,
},
"Finished instantiating all proc-blocks"
);

return procBlocks;
}
Expand Down
Loading

0 comments on commit b4304a0

Please sign in to comment.