mirror of
https://github.com/openfrontio/OpenFrontIO.git
synced 2026-07-01 16:23:30 +00:00
fixed
This commit is contained in:
@@ -54,7 +54,7 @@ export class PatternDecoder {
|
||||
const py = norm((y / this.scale) | 0, this.tileHeight);
|
||||
const idx = py * this.tileWidth + px;
|
||||
const byteIndex = idx >> 3;
|
||||
const bitIndex = 7 - (idx % 8);
|
||||
const bitIndex = idx & 7;
|
||||
const byte = this.bytes[this.dataStart + byteIndex];
|
||||
if (byte === undefined) throw new Error("Invalid pattern");
|
||||
return (byte & (1 << bitIndex)) !== 0;
|
||||
|
||||
Reference in New Issue
Block a user