From 4df3ccd3ebf2376ecdbf4c570fd914606418c75f Mon Sep 17 00:00:00 2001 From: Robin Krens Date: Tue, 14 Jun 2022 20:53:54 +0200 Subject: [PATCH] tools: bmp2tiles correct substraction of columns --- tools/bmp2tiles/bmp2tiles.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/tools/bmp2tiles/bmp2tiles.c b/tools/bmp2tiles/bmp2tiles.c index b005365..380481e 100644 --- a/tools/bmp2tiles/bmp2tiles.c +++ b/tools/bmp2tiles/bmp2tiles.c @@ -88,7 +88,7 @@ void generate_4bpp_tile(unsigned char *buf, swan_gfx_t * gfx, if (!packed) ptr += 8; else { - ptr += (8 * (gfx->row_tiles-1)); + ptr += (8 * (gfx->col_tiles-1)); } } } @@ -170,7 +170,7 @@ int main(int argc, char *argv[]) gfx->data += 8; /* next column */ //printf("\n"); } - gfx->data += (gfx->col_tiles * 64) - 16; + gfx->data += (gfx->col_tiles * 64) - (8 * gfx->col_tiles); } palstream = fopen("out.pal", "w"); -- 2.7.4