(files for X versions)
Install.X11 NetHack.ad Window.c dialogs.c ibm.bdf
nethack.rc nh10.bdf nh32icon nh56icon nh72icon
-nh_icon.xpm pet_mark.xbm rip.xpm tile2x11.c winX.c
-winmap.c winmenu.c winmesg.c winmisc.c winstat.c
-wintext.c winval.c
+nh_icon.xpm pet_mark.xbm pilemark.xbm rip.xpm tile2x11.c
+winX.c winmap.c winmenu.c winmesg.c winmisc.c
+winstat.c wintext.c winval.c
win/gem:
(files for GEM versions)
tty: fix segfault when MD termcap is not defined
tty: do not cut off statuslines at 80 characters for wider term
tty: prevent accidental escapes from string entries
+tty: hilight object piles
unix: remove use of parentheses in nethack man page usage that confused a
man page conversion tool
unix: new -wwindowtype option
X11: ensure vertical scrollbar shows up in text display windows
X11: fix typo in mouse click sanity check; result might have pointed to
spurious location after window resizing
+X11: use a plus sign to mark piles of objects
platforms that support hangup: SAFERHANGUP to avoid losing objects in transit
between lists when hangup occurs, and also avoid cheats due to
well-timed hangups to stop a long melee
square_lbearing;
};
+struct tile_glyph_info_t {
+ unsigned short glyph;
+ unsigned special;
+};
+
struct tile_map_info_t {
- unsigned short glyphs[ROWNO][COLNO]; /* Saved glyph numbers. */
+ struct tile_glyph_info_t glyphs[ROWNO][COLNO]; /* Saved glyph numbers. */
GC white_gc;
GC black_gc;
unsigned long image_width; /* dimensions of tile image */
int message_lines; /* number of lines to attempt to show */
String pet_mark_bitmap; /* X11 bitmap file used to mark pets */
Pixel pet_mark_color; /* color of pet mark */
+ String pilemark_bitmap; /* X11 bitmap file used to mark item piles */
+ Pixel pilemark_color; /* color of item pile mark */
#ifdef GRAPHIC_TOMBSTONE
String tombstone; /* name of XPM file for tombstone */
int tombtext_x; /* x-coord of center of first tombstone text */
pet_mark.xbm: ../win/X11/pet_mark.xbm
cp ../win/X11/pet_mark.xbm pet_mark.xbm
+pilemark.xbm: ../win/X11/pilemark.xbm
+ cp ../win/X11/pilemark.xbm pilemark.xbm
+
rip.xpm: ../win/X11/rip.xpm
cp ../win/X11/rip.xpm rip.xpm
spotless:
-rm -f spec_levs quest_levs *.lev $(VARDAT) dungeon dungeon.pdf
- -rm -f nhdat x11tiles beostiles pet_mark.xbm rip.xpm mapbg.xpm
+ -rm -f nhdat x11tiles beostiles pet_mark.xbm pilemark.xbm rip.xpm mapbg.xpm
-rm -f rip.img GEM_RSC.RSC title.img nh16.img NetHack.ad
pet_mark.xbm:
( cd dat ; $(MAKE) pet_mark.xbm )
+pilemark.xbm:
+ ( cd dat ; $(MAKE) pilemark.xbm )
+
rip.xpm:
( cd dat ; $(MAKE) rip.xpm )
WINOBJ = $(WINX11OBJ)
WINLIB = $(WINX11LIB)
-VARDATND = x11tiles NetHack.ad pet_mark.xbm
+VARDATND = x11tiles NetHack.ad pet_mark.xbm pilemark.xbm
#WINTTYLIB=-lcurses
Theisen. This is from his Ghostview program (which is under
the GNU public license, v2 or higher).
pet_mark.xbm - A pet indicator bitmap for tiles.
+pilemark.xbm - Item pile indicator for tiles.
rip.xpm - A graphical tombstone.
tile2x11.c - Converts win/share tiles for X11 use.
! The annotation of pets.
!NetHack.pet_mark_bitmap: pet_mark.xbm
!NetHack.pet_mark_color: Red
+! The annotation of item piles.
+!NetHack.pilemark_bitmap: pilemark.xbm
+!NetHack.pilemark_color: Green
! Tombstone
! The image file
--- /dev/null
+#define pilemark_width 16
+#define pilemark_height 16
+static unsigned char pilemark_bits[] = {
+ 0x00, 0x00, 0x18, 0x00, 0x18, 0x00, 0x7e, 0x00, 0x7e, 0x00, 0x18, 0x00,
+ 0x18, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00 };
{ nhStr("pet_mark_color"), nhStr("Pet_mark_color"), XtRPixel,
sizeof(XtRPixel), XtOffset(AppResources *, pet_mark_color), XtRString,
nhStr("Red") },
+ { nhStr("pilemark_bitmap"), nhStr("Pilemark_bitmap"), XtRString,
+ sizeof(String), XtOffset(AppResources *, pilemark_bitmap), XtRString,
+ nhStr("pilemark.xbm") },
+ { nhStr("pilemark_color"), nhStr("Pilemark_color"), XtRPixel,
+ sizeof(XtRPixel), XtOffset(AppResources *, pilemark_color), XtRString,
+ nhStr("Green") },
#ifdef GRAPHIC_TOMBSTONE
{ nhStr("tombstone"), "Tombstone", XtRString, sizeof(String),
XtOffset(AppResources *, tombstone), XtRString, "rip.xpm" },
/* update both the tile and text backing stores */
{
- unsigned short *t_ptr = &map_info->tile_map.glyphs[y][x];
+ unsigned short *t_ptr = &map_info->tile_map.glyphs[y][x].glyph;
if (*t_ptr != glyph) {
*t_ptr = glyph;
(void) mapglyph(glyph, &och, &color, &special, x, y);
ch = (uchar) och;
+ if (special != map_info->tile_map.glyphs[y][x].special) {
+ map_info->tile_map.glyphs[y][x].special = special;
+ update_bbox = TRUE;
+ }
+
/* Only update if we need to. */
ch_ptr = &map_info->text_map.text[y][x];
#ifdef TEXTCOLOR
if ((special & MG_PET) && iflags.hilite_pet)
color += CLR_MAX;
+ if ((special & MG_OBJPILE) && iflags.use_inverse)
*co_ptr = color;
#endif
if (!map_info->is_tile)
};
static struct tile_annotation pet_annotation;
+static struct tile_annotation pile_annotation;
static void
init_annotation(annotation, filename, colorpixel)
init_annotation(&pet_annotation, appResources.pet_mark_bitmap,
appResources.pet_mark_color);
+ init_annotation(&pile_annotation, appResources.pilemark_bitmap,
+ appResources.pilemark_color);
}
/*
map_all_stone(map_info)
struct map_info_t *map_info;
{
- int i;
+ int x,y;
unsigned short *sp, stone;
stone = cmap_to_glyph(S_stone);
- for (sp = (unsigned short *) map_info->tile_map.glyphs, i = 0;
- i < ROWNO * COLNO; sp++, i++) {
- *sp = stone;
- }
+ for (x = 0; x < COLNO; x++)
+ for (y = 0; y < ROWNO; y++) {
+ map_info->tile_map.glyphs[y][x].glyph = stone;
+ map_info->tile_map.glyphs[y][x].special = 0;
+ }
}
/*
for (row = start_row; row <= stop_row; row++) {
for (cur_col = start_col; cur_col <= stop_col; cur_col++) {
- int glyph = tile_map->glyphs[row][cur_col];
+ int glyph = tile_map->glyphs[row][cur_col].glyph;
int tile = glyph2tile[glyph];
int src_x, src_y;
int dest_x = cur_col * tile_map->square_width;
XSetForeground(dpy, tile_map->black_gc,
BlackPixelOfScreen(screen));
}
+ if ((tile_map->glyphs[row][cur_col].special & MG_OBJPILE)) {
+ /* draw object pile annotation (a plus sign) */
+ XSetForeground(dpy, tile_map->black_gc,
+ pile_annotation.foreground);
+ XSetClipOrigin(dpy, tile_map->black_gc, dest_x, dest_y);
+ XSetClipMask(dpy, tile_map->black_gc,
+ pile_annotation.bitmap);
+ XCopyPlane(dpy, pile_annotation.bitmap, XtWindow(wp->w),
+ tile_map->black_gc, 0, 0, pile_annotation.width,
+ pile_annotation.height, dest_x, dest_y, 1);
+ XSetClipOrigin(dpy, tile_map->black_gc, 0, 0);
+ XSetClipMask(dpy, tile_map->black_gc, None);
+ XSetForeground(dpy, tile_map->black_gc,
+ BlackPixelOfScreen(screen));
+ }
}
}
XtDisplay(wp->w), XtWindow(wp->w),
#ifdef USE_WHITE
/* kludge for white square... */
- tile_map->glyphs[start_row][start_col] == cmap_to_glyph(S_ice)
+ tile_map->glyphs[start_row][start_col].glyph == cmap_to_glyph(S_ice)
? tile_map->black_gc
: tile_map->white_gc,
#else