Validate battle UI icon PNG color mode

This commit is contained in:
2026-07-05 15:18:26 +09:00
parent 91842d2e30
commit f7599784df

View File

@@ -54,6 +54,9 @@ function validateBattleUiIconAtlas(errors, manifest) {
if (dimensions.width !== expectedWidth || dimensions.height !== expectedHeight) {
errors.push(`battle UI icon atlas is ${dimensions.width}x${dimensions.height}, expected ${expectedWidth}x${expectedHeight}`);
}
if (dimensions.bitDepth !== 8 || dimensions.colorType !== 6) {
errors.push(`battle UI icon atlas must be 8-bit RGBA PNG color type 6, got bitDepth=${dimensions.bitDepth} colorType=${dimensions.colorType}`);
}
const frameLimit = manifest.columns * manifest.rows;
Object.entries(manifest.frames).forEach(([key, frame]) => {
@@ -129,7 +132,9 @@ function readPngDimensions(path) {
return {
width: bytes.readUInt32BE(16),
height: bytes.readUInt32BE(20)
height: bytes.readUInt32BE(20),
bitDepth: bytes[24],
colorType: bytes[25]
};
}