tools: bmp2tiles correct substraction of columns
[swan-dev] / 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");