This commit is contained in:
Aotumuri
2025-06-01 19:54:33 +09:00
parent 698f886697
commit e7d8e05013
+4
View File
@@ -40,6 +40,10 @@ export class PatternDecoder {
this.tileWidth = (bytes[1] << 8) | bytes[2];
this.tileHeight = (bytes[3] << 8) | bytes[4];
this.scale = (bytes[5] << 8) | bytes[6];
const shift = Math.log2(this.scale);
if (!Number.isInteger(shift)) {
throw new Error("Scale must be a power of 2.");
}
this.dataStart = 7;
this.bytes = bytes;
}