Crusader_Decomp/inspect_l0.cjs

15 lines
967 B
JavaScript
Raw Normal View History

2026-04-18 16:53:43 +02:00
const fs = require('fs');
const path = require('path');
const jsonPath = 'psx-map-exporter/.output-render/L0/auto/L0.json';
const cacheDir = 'psx-map-exporter/.cache/L0/sprites';
const data = JSON.parse(fs.readFileSync(jsonPath, 'utf8'));
const items = (data.items || []).filter(item => item.bundleAbsoluteOffset !== undefined && item.frameIndex !== undefined && item.width > 0).slice(0, 5);
items.forEach(item => {
const bundleHex = item.bundleAbsoluteOffset.toString(16).padStart(8, '0');
const frameIdx = item.frameIndex.toString().padStart(3, '0');
const fileName = `bundle_${bundleHex}/frame_${frameIdx}.png`;
const fullPath = path.join(cacheDir, fileName);
const exists = fs.existsSync(fullPath);
console.log(`recordIndex: ${item.recordIndex}, bundleAbsoluteOffset: ${item.bundleAbsoluteOffset}, frameIndex: ${item.frameIndex}, width: ${item.width}, height: ${item.height}`);
console.log(`File: ${fileName}, Exists: ${exists}`);
});