diff options
author | 3gg <3gg@shellblade.net> | 2025-09-04 19:02:08 -0700 |
---|---|---|
committer | 3gg <3gg@shellblade.net> | 2025-09-04 19:02:08 -0700 |
commit | 380d74403d63768fa808dfc0bcfa5102ae66cc58 (patch) | |
tree | 5e88110607fe689f6a2aa67805034cee1a5b40a4 | |
parent | cf5f90d20f12d3e13a285bd199639b7aaea8395e (diff) |
Fix carving of images when handling single-image tile sets.
-rw-r--r-- | tools/mkasset.py | 5 |
1 files changed, 3 insertions, 2 deletions
diff --git a/tools/mkasset.py b/tools/mkasset.py index c8311b6..a402e3c 100644 --- a/tools/mkasset.py +++ b/tools/mkasset.py | |||
@@ -65,8 +65,9 @@ def carve_image(rgba_bytes, tile_width, tile_height, columns) -> Generator[bytea | |||
65 | image_y = image_y0 + y # y of current pixel inside image | 65 | image_y = image_y0 + y # y of current pixel inside image |
66 | for x in range(tile_width): | 66 | for x in range(tile_width): |
67 | image_x = image_x0 + x # x of current pixel inside image | 67 | image_x = image_x0 + x # x of current pixel inside image |
68 | tile_bytes[(y * tile_width + x) * 4] = ( | 68 | for c in range(4): |
69 | rgba_bytes)[(image_y * image_width + image_x) * 4] | 69 | tile_bytes[((y * tile_width + x) * 4) + c] = ( |
70 | rgba_bytes)[((image_y * image_width + image_x) * 4) + c] | ||
70 | yield tile_bytes.copy() | 71 | yield tile_bytes.copy() |
71 | 72 | ||
72 | 73 | ||