From: Robin Krens Date: Tue, 14 Jun 2022 18:53:54 +0000 (+0200) Subject: tools: bmp2tiles correct substraction of columns X-Git-Url: https://robinkrens.nl/gitweb/?a=commitdiff_plain;h=4df3ccd3ebf2376ecdbf4c570fd914606418c75f;p=swan-dev tools: bmp2tiles correct substraction of columns --- 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");