15 lines
967 B
JavaScript
15 lines
967 B
JavaScript
|
|
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}`);
|
||
|
|
});
|