From 20d2ac726cea70114a42f7ae8e2bfda5bb1f0055 Mon Sep 17 00:00:00 2001 From: nhmall Date: Fri, 16 Feb 2024 22:15:09 -0500 Subject: [PATCH] have tile2bmp describe the bmp file layout --- win/share/tile2bmp.c | 17 ++++++++++++++--- 1 file changed, 14 insertions(+), 3 deletions(-) diff --git a/win/share/tile2bmp.c b/win/share/tile2bmp.c index 4edc3ba22..37dc1e2ef 100644 --- a/win/share/tile2bmp.c +++ b/win/share/tile2bmp.c @@ -142,7 +142,7 @@ DISABLE_WARNING_UNREACHABLE_CODE int main(int argc, char *argv[]) { - int i, j; + int i, j, number_of_rows, number_in_final_row; uchar *c; char tilefile_full_path[256] = { 0 }; @@ -251,8 +251,19 @@ main(int argc, char *argv[]) } fwrite(newbmp, bmpsize, 1, fp); fclose(fp); - Fprintf(stderr, "Total of %d tiles written to %s.\n", - tiles_counted, bmpname); + number_of_rows = tiles_counted / max_tiles_in_row; + number_in_final_row = tiles_counted % max_tiles_in_row; + + Fprintf(stderr, "Total of %d tiles written to %s, " + "%d full rows of %d tiles", + tiles_counted, bmpname, + number_of_rows, max_tiles_in_row); + if (number_in_final_row != 0) { + Fprintf(stderr, ", final row %d has %d tile%s", + number_of_rows + 1, number_in_final_row, + number_in_final_row > 1 ? "s" : ""); + } + (void) fputs(".\n\n", stderr); free((genericptr_t) newbmp); exit(EXIT_SUCCESS);