This commit is contained in:
Brandon Johnson
2026-01-26 10:36:02 -05:00
parent c84f3426b1
commit 1006c662c7

View File

@@ -0,0 +1,28 @@
import fs from "node:fs";
import path from "node:path";
import ArrayBufferSlice from "../src/noclip/ArrayBufferSlice.js";
import { parseAVTpl } from "../src/noclip/SuperMonkeyBall/AVTpl.js";
import { parseGma } from "../src/noclip/SuperMonkeyBall/Gma.js";
function loadFileBuffer(filePath: string): ArrayBufferSlice {
const data = fs.readFileSync(filePath);
return new ArrayBufferSlice(data.buffer, data.byteOffset, data.byteLength);
}
const root = path.resolve(__dirname, "..");
const commonGmaPath = path.join(root, "smb2_content", "test", "init", "common.gma");
const commonTplPath = path.join(root, "smb2_content", "test", "init", "common.tpl");
const tpl = parseAVTpl(loadFileBuffer(commonTplPath), "common");
const gma = parseGma(loadFileBuffer(commonGmaPath), tpl);
const wanted = [0x5f, 0x60];
for (const id of wanted) {
const model = gma.idMap.get(id);
if (!model) {
console.log(`${id.toString(16)}: <missing>`);
continue;
}
console.log(`${id.toString(16)}: ${model.name}`);
}