diff options
author | lonkaars <loek@pipeframe.xyz> | 2023-03-22 18:34:53 +0100 |
---|---|---|
committer | lonkaars <loek@pipeframe.xyz> | 2023-03-22 18:34:53 +0100 |
commit | 1bb8b7eda56de815bcfc9c6f8b07df399cf400a0 (patch) | |
tree | 0711d750eb6eb18d1009a1c1208eb9da51b1d68c /scripts/tilepack | |
parent | 1cd0285b22755a21cbc367213a143ec33d298c95 (diff) |
fix endianness in `tilepack` and add `tilemap2png` script for previewing finished tilemap
Diffstat (limited to 'scripts/tilepack')
-rwxr-xr-x | scripts/tilepack | 4 |
1 files changed, 2 insertions, 2 deletions
diff --git a/scripts/tilepack b/scripts/tilepack index aff417d..a07cbb6 100755 --- a/scripts/tilepack +++ b/scripts/tilepack @@ -11,8 +11,8 @@ for byte in sys.stdin.buffer.read(): pixel_idx = i % 5 word |= (byte & 0b111) << 3 * pixel_idx - if i % 5 == 4 or i == 0xff: - sys.stdout.buffer.write(struct.pack('!H', word)) + if pixel_idx == 4 or i == 0xff: + sys.stdout.buffer.write(struct.pack('<H', word)) word = 0x0000 i += 1 |