]> granicus.if.org Git - nethack/commitdiff
Avoid magic numbers in tile2bmp
authorPasi Kallinen <paxed@alt.org>
Thu, 12 Jan 2023 15:34:58 +0000 (17:34 +0200)
committerPasi Kallinen <paxed@alt.org>
Thu, 12 Jan 2023 15:34:58 +0000 (17:34 +0200)
win/share/tile2bmp.c

index d20e87e6d59f7a15f1900f0000535e46ef7d2878..64a25dacf94d83d70ff5ebe9c5c4367792fbb0ae 100644 (file)
@@ -196,8 +196,8 @@ main(int argc, char *argv[])
     /* count monsters twice for grayscale variation */
     magictileno += tilecnt[0];
 
-    max_x = 16 * 40;
-    max_y = ((16 *  magictileno) / 40) + 16;
+    max_x = TILE_X * max_tiles_in_row;
+    max_y = ((TILE_Y * magictileno) / max_tiles_in_row) + TILE_Y;
     bmpsize = (sizeof bmp - sizeof bmp.packtile)
                   + (max_y * (max_x * sizeof(uchar)));
     newbmp = malloc(bmpsize);