diff -Naurd ../nethack-3.4.0/win/X11/dialogs.c ./win/X11/dialogs.c --- ../nethack-3.4.0/win/X11/dialogs.c Wed Mar 20 23:44:30 2002 +++ ./win/X11/dialogs.c Mon Feb 24 15:25:05 2003 @@ -241,7 +241,7 @@ Arg args[4]; Widget response; XFontStruct *font; - Dimension width, nwidth, tmp, leftMargin, rightMargin; + Dimension width, nwidth, leftMargin, rightMargin; response = XtNameToWidget(w, "response"); XtSetArg(args[0], XtNfont, &font); @@ -249,10 +249,10 @@ XtSetArg(args[2], XtNrightMargin, &rightMargin); XtSetArg(args[3], XtNwidth, &width); XtGetValues(response, args, FOUR); + /* width includes margins as per Xaw documentation */ nwidth = (font->max_bounds.width * strlen(s))+leftMargin+rightMargin; - tmp = width-(leftMargin+rightMargin); - if (nwidth < tmp) - nwidth = tmp; + if (nwidth < width) + nwidth = width; XtSetArg(args[0], XtNstring, s); XtSetArg(args[1], XtNwidth, nwidth); diff -Naurd ../nethack-3.4.0/win/X11/Install.X11 ./win/X11/Install.X11 --- ../nethack-3.4.0/win/X11/Install.X11 Wed Mar 20 23:44:30 2002 +++ ./win/X11/Install.X11 Mon Feb 24 15:25:05 2003 @@ -50,8 +50,11 @@ This causes NetHack to use the XPM file format for the "x11tiles" file rather than a custom format. Since the XPM format can be processed by existing tools such as PBMPlus and XV, you can modify the tiles to suit -your environment. For example, you may magnify them for display on -high-resolution screens using the following command: +your environment. However, you need to make sure the number of tiles +in each row of the image remains the same (currently 40), as the code +depends on this to calculate the size of each tile. For example, you may +magnify them for display on high-resolution screens using the following +command: xpmtoppm x11tiles | pnmscale -xscale 1 -yscale 1.6875 | pnmdepth 255 | ppmquant 100 | ppmtoxpm >x11tiles_big.xpm To use XPM, you must have the free XPM libraries installed in your system. diff -Naurd ../nethack-3.4.0/win/X11/NetHack.ad ./win/X11/NetHack.ad --- ../nethack-3.4.0/win/X11/NetHack.ad Wed Mar 20 23:44:30 2002 +++ ./win/X11/NetHack.ad Mon Feb 24 15:25:05 2003 @@ -6,9 +6,9 @@ NetHack*font: variable NetHack*display_file*font: fixed NetHack*tombstone*font: fixed -NetHack*rip*font: -*-times-medium-r-*-*-12-*-*-*-*-*-*-* +NetHack*text*rip*font: -*-times-medium-r-*-*-12-*-*-*-*-*-*-* NetHack*menu*font: fixed -!NetHack*text*font: fixed +NetHack*text*font: fixed NetHack*map*font: nh10 ! To use full-color tiles for the map, uncomment the tile file name. diff -Naurd ../nethack-3.4.0/win/X11/winmap.c ./win/X11/winmap.c --- ../nethack-3.4.0/win/X11/winmap.c Wed Mar 20 23:44:32 2002 +++ ./win/X11/winmap.c Mon Feb 24 15:25:05 2003 @@ -306,7 +306,8 @@ } /* assume a fixed number of tiles per row */ - if (tile_image->width % TILES_PER_ROW != 0) { + if (tile_image->width % TILES_PER_ROW != 0 || + tile_image->width <= TILES_PER_ROW) { Sprintf(buf, "%s is not a multiple of %d (number of tiles/row) pixels wide", appResources.tile_file, TILES_PER_ROW); @@ -317,20 +318,16 @@ goto tiledone; } - /* infer tile dimensions from image size, assume square tiles */ + /* infer tile dimensions from image size and TILES_PER_ROW */ image_width = tile_image->width; image_height = tile_image->height; - tile_width = image_width / TILES_PER_ROW; - tile_height = tile_width; - tile_count = (image_width * image_height) / (tile_width * tile_height); - if (tile_count < total_tiles_used) { - Sprintf(buf, "%s incomplete, expecting %d tiles, found %d", - appResources.tile_file, total_tiles_used, tile_count); - X11_raw_print(buf); - result = FALSE; - goto tiledone; + tile_count = total_tiles_used; + if ((tile_count % TILES_PER_ROW) != 0) { + tile_count += TILES_PER_ROW - (tile_count % TILES_PER_ROW); } + tile_width = image_width / TILES_PER_ROW; + tile_height = image_height / (tile_count / TILES_PER_ROW); #else /* any less than 16 colours makes tiles useless */ ddepth = DefaultDepthOfScreen(screen); diff -Naurd ../nethack-3.4.0/win/X11/winmenu.c ./win/X11/winmenu.c --- ../nethack-3.4.0/win/X11/winmenu.c Wed Mar 20 23:44:33 2002 +++ ./win/X11/winmenu.c Mon Feb 24 15:25:05 2003 @@ -713,7 +713,10 @@ for (i = 0; i < SIZE(gcnt); i++) gcnt[i] = 0; for (n = 0, curr = menu_info->new_menu.base; curr; curr = curr->next) - if (curr->gselector) ++n, ++gcnt[GSELIDX(curr->gselector)]; + if (curr->gselector && curr->gselector != curr->selector) { + ++n; + ++gcnt[GSELIDX(curr->gselector)]; + } if (n > 0) /* at least one group accelerator found */ for (ap = gacc, curr = menu_info->new_menu.base;