From 1bb8b7eda56de815bcfc9c6f8b07df399cf400a0 Mon Sep 17 00:00:00 2001 From: lonkaars Date: Wed, 22 Mar 2023 18:34:53 +0100 Subject: fix endianness in `tilepack` and add `tilemap2png` script for previewing finished tilemap --- scripts/tilepack | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) (limited to 'scripts/tilepack') 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('