]> granicus.if.org Git - nethack/commitdiff
fix #H4472 & #H4473 - incorrect total_tiles_used
authorPatR <rankin@nethack.org>
Sun, 7 Aug 2016 02:30:44 +0000 (19:30 -0700)
committerPatR <rankin@nethack.org>
Sun, 7 Aug 2016 02:30:44 +0000 (19:30 -0700)
The value calculated for total_tiles_used never got adjusted for
displaying statues-as-monsters.  The most common configuration(s)
using tiles don't care, but the combination of X11 plus USE_XPM
needs an accurate value there.

doc/fixes36.1
win/share/tilemap.c

index 610cb43cb1ee2698c61410869bc81e9acc687bd2..d1bf9973ad65354e7e0b3c030e04e1ed9f761719 100644 (file)
@@ -353,6 +353,8 @@ when autopickup is overridden in a shop, always-pick-up exceptions and
 Platform- and/or Interface-Specific Fixes
 -----------------------------------------
 tiles: wrinkled spellbook had a spurious brown pixel on far right edge of tile
+tiles: when statues are displayed as corresponding monsters, total_tiles_used
+       in generated src/tile.c had incorrect value
 tty: M-N gave "Unknown command 'M-" with "'." finishing the sentence on the
        line below it, leaving bogus '.' displayed on the top row of the map
 tty: specifying all four of role, race, gender, and alignment still prompted
@@ -399,6 +401,8 @@ X11: make the extended command menu be easier to use and look a little nicer
 X11: make the getline text entry widget display a bigger text entry area
 X11: color didn't work when the map was displayed as text rather than tiles
 X11: use grayscale monster tiles for statues
+X11/USE_XPM: [post-3.6.0 issue] the 'tiles' bug of incorrect total_tiles_used
+       for STATUES_LOOK_LIKE_MONSTERS broke XPM manipulation of tiles data
 
 
 General New Features
index cae25fdfbc7a1d05a6559c6077328319c13ba643..a14d9203e6cb03bf6c7b893c0d3922e029b203cc 100644 (file)
@@ -1,4 +1,4 @@
-/* NetHack 3.6 tilemap.c       $NHDT-Date: 1465163425 2016/06/05 21:50:25 $  $NHDT-Branch: NetHack-3.6.0 $:$NHDT-Revision: 1.30 $ */
+/* NetHack 3.6 tilemap.c       $NHDT-Date: 1470537037 2016/08/07 02:30:37 $  $NHDT-Branch: NetHack-3.6.0 $:$NHDT-Revision: 1.32 $ */
 /* NetHack may be freely redistributed.  See license for details. */
 
 /*
@@ -464,8 +464,11 @@ FILE *ofp;
         fprintf(ofp, "%s\n", epilog[i]);
     }
 
-    fprintf(ofp, "\nint total_tiles_used = %d;\n", start);
     lastothtile = start - 1;
+#ifdef STATUES_LOOK_LIKE_MONSTERS
+    start = laststatuetile + 1;
+#endif
+    fprintf(ofp, "\nint total_tiles_used = %d;\n", start);
 }
 
 int
@@ -500,7 +503,9 @@ main()
     fprintf(ofp, "\n#define MAXMONTILE %d\n", lastmontile);
     fprintf(ofp, "#define MAXOBJTILE %d\n", lastobjtile);
     fprintf(ofp, "#define MAXOTHTILE %d\n", lastothtile);
-
+#ifdef STATUES_LOOK_LIKE_MONSTERS
+    fprintf(ofp, "/* #define MAXSTATUETILE %d */\n", laststatuetile);
+#endif
     fprintf(ofp, "\n/*tile.c*/\n");
 
     fclose(ofp);