+ fprintf(stdout, "generating %d tile(s) \
+ in %d gfx file(s) \
+ with %d pal file(s)\n",
+ gfx->row_tiles * gfx->col_tiles,
+ seperate_gfx ? gfx->row_tiles * gfx->col_tiles : 1,
+ seperate_pal ? gfx->row_tiles * gfx->col_tiles : 1);
+
+
+ for (int i = 0, cnt = 0; i < gfx->row_tiles; ++i) {
+ for (int j = 0; j < gfx->col_tiles; ++j, ++cnt) {
+
+ if (i == 0 && j == 0) {
+ gfxstream = openstream(outfile, "gfx", 0, false);
+ palstream = openstream(outfile, "pal", 0, false);
+ } else {
+ if (seperate_gfx) {
+ gfxstream = openstream(outfile, "gfx", cnt, false);
+ }
+ if (seperate_pal) {
+ palstream = openstream(outfile, "pal", cnt, false);
+ }
+ }