tools: bmp2tiles correct substraction of columns
authorRobin Krens <robin@robinkrens.nl>
Tue, 14 Jun 2022 18:53:54 +0000 (20:53 +0200)
committerRobin Krens <robin@robinkrens.nl>
Tue, 14 Jun 2022 18:53:54 +0000 (20:53 +0200)
tools/bmp2tiles/bmp2tiles.c

index b005365..380481e 100644 (file)
@@ -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");