Merge branch 'NetHack-3.6.2'

This commit is contained in:
nhmall
2019-03-13 20:21:56 -04:00
13 changed files with 51 additions and 33 deletions

View File

@@ -1,4 +1,4 @@
/* NetHack 3.6 winX.c $NHDT-Date: 1552422652 2019/03/12 20:30:52 $ $NHDT-Branch: NetHack-3.6.2-beta01 $:$NHDT-Revision: 1.72 $ */
/* NetHack 3.6 winX.c $NHDT-Date: 1552441031 2019/03/13 01:37:11 $ $NHDT-Branch: NetHack-3.6.2-beta01 $:$NHDT-Revision: 1.73 $ */
/* Copyright (c) Dean Luick, 1992 */
/* NetHack may be freely redistributed. See license for details. */
@@ -1355,14 +1355,15 @@ int how;
time_t when;
{
struct xwindow *wp;
FILE *rip_fp;
FILE *rip_fp = 0;
check_winid(window);
wp = &window_list[window];
/* make sure the graphic_tombstone is available; it's not easy to
revert to ordinary text tombstone once we're past this point... */
rip_fp = fopen(appResources.tombstone, "r"); /* "rip.xpm" */
/* make sure the graphical tombstone is available; it's not easy to
revert to the ASCII-art text tombstone once we're past this point */
if (appResources.tombstone && *appResources.tombstone)
rip_fp = fopen(appResources.tombstone, "r"); /* "rip.xpm" */
if (!rip_fp) {
genl_outrip(window, how, when);
return;

View File

@@ -10,10 +10,10 @@
#include "func_tab.h"
#include <ctype.h>
#if defined(FILENAME_CMP)
#if defined(FILENAME_CMP) && !defined(strcasecmp)
#define strcasecmp FILENAME_CMP
#endif
#if defined(STRNCMPI)
#if defined(STRNCMPI) && !defined(strncasecmp)
#define strncasecmp strncmpi
#endif

View File

@@ -358,8 +358,7 @@ putstr(window, attr, str)
-- Print str on the window with the given attribute. Only
printable ASCII characters (040-0126) must be supported.
Multiple putstr()s are output on separate lines.
Attributes
can be one of
Attributes can be one of
ATR_NONE (or 0)
ATR_ULINE
ATR_BOLD
@@ -616,7 +615,10 @@ curses_print_glyph(winid wid, XCHAR_P x, XCHAR_P y, int glyph,
} else
*/
if ((special & MG_OBJPILE) && iflags.hilite_pile) {
color = 16 + (color * 2) + 1;
if (iflags.wc_color)
color = 16 + (color * 2) + 1;
else
attr = A_REVERSE;
}
}

View File

@@ -81,19 +81,22 @@ curses_read_char()
/* Turn on or off the specified color and / or attribute */
void
curses_toggle_color_attr(WINDOW * win, int color, int attr, int onoff)
curses_toggle_color_attr(WINDOW *win, int color, int attr, int onoff)
{
#ifdef TEXTCOLOR
int curses_color;
/* Map color disabled */
if ((!iflags.wc_color) && (win == mapwin)) {
return;
}
/* GUI color disabled */
if ((!iflags.wc2_guicolor) && (win != mapwin)) {
/* if color is disabled, just show attribute */
if ((win == mapwin) ? !iflags.wc_color : !iflags.wc2_guicolor) {
#endif
if (attr != NONE) {
if (onoff == ON)
wattron(win, attr);
else
wattroff(win, attr);
}
return;
#ifdef TEXTCOLOR
}
if (color == 0) { /* make black fg visible */
@@ -149,6 +152,8 @@ curses_toggle_color_attr(WINDOW * win, int color, int attr, int onoff)
wattroff(win, attr);
}
}
#else
nhUse(color);
#endif /* TEXTCOLOR */
}
@@ -685,7 +690,7 @@ curses_convert_attr(int attr)
success (might be 0), or -1 if not found. */
int
curses_read_attrs(char *attrs)
curses_read_attrs(const char *attrs)
{
int retattr = 0;

View File

@@ -26,7 +26,7 @@ void curses_view_file(const char *filename, boolean must_exist);
void curses_rtrim(char *str);
int curses_get_count(int first_digit);
int curses_convert_attr(int attr);
int curses_read_attrs(char *attrs);
int curses_read_attrs(const char *attrs);
char *curses_fmt_attrs(char *);
int curses_convert_keys(int key);
int curses_get_mouse(int *mousex, int *mousey, int *mod);

View File

@@ -380,10 +380,10 @@ safe_status_init()
return;
}
void
boolean
safe_can_suspend()
{
return;
return FALSE;
}
void
@@ -408,7 +408,7 @@ char def;
}
/*ARGSUSED*/
static void
void
safe_getlin(prompt, outbuf)
const char *prompt UNUSED;
char *outbuf;