Merge branch 'NetHack:NetHack-3.7' into NetHack-3.7

This commit is contained in:
RainRat
2024-04-13 09:15:39 -07:00
committed by GitHub
20 changed files with 340 additions and 78 deletions
+15 -7
View File
@@ -44,8 +44,8 @@ extern glyph_info mesg_gi;
static void dummy_update_position_bar(char *);
#endif
#ifdef CHANGE_COLOR
static void dummy_change_color(int, long, int);
static char *dummy_get_color_string(void);
static void curses_change_color(int, long, int);
static char *curses_get_color_string(void);
#endif
/* Public functions for curses NetHack interface */
@@ -119,12 +119,12 @@ struct window_procs curses_procs = {
curses_number_pad,
curses_delay_output,
#ifdef CHANGE_COLOR
dummy_change_color,
curses_change_color,
#ifdef MAC /* old OS 9, not OSX */
(void (*)(int)) 0,
(short (*)(winid, char *)) 0,
#endif
dummy_get_color_string,
curses_get_color_string,
#endif
curses_start_screen,
curses_end_screen,
@@ -1278,13 +1278,21 @@ dummy_update_position_bar(char *arg UNUSED)
#ifdef CHANGE_COLOR
static void
dummy_change_color(int a1 UNUSED, long a2 UNUSED, int a3 UNUSED)
curses_change_color(int color, long rgb, int reverse UNUSED)
{
return;
short r, g, b;
if (!can_change_color())
return;
r = (rgb >> 16) & 0xFF;
g = (rgb >> 8) & 0xFF;
b = rgb & 0xFF;
init_color(color % 16, r * 4, g * 4, b * 4);
}
static char *
dummy_get_color_string(void)
curses_get_color_string(void)
{
return (char *) 0;
}
+14
View File
@@ -550,5 +550,19 @@ stdio_nhgetch(void)
return getchar();
}
#ifdef CHANGE_COLOR
void
safe_change_color(int color UNUSED, long rgb UNUSED, int reverse UNUSED)
{
}
char *
safe_get_color_string(void)
{
return ("");
}
#endif
/* safeprocs.c */
+9
View File
@@ -1495,6 +1495,15 @@ term_curs_set(int visibility)
xputs(nh_VE);
}
#ifdef CHANGE_COLOR
void
tty_change_color(int color UNUSED, long rgb UNUSED, int reverse UNUSED)
{
return;
}
#endif /* CHANGE_COLOR */
#ifndef SEP2
#define tcfmtstr "\033[38;2;%ld;%ld;%ldm"
#ifdef UNIX
+16
View File
@@ -803,6 +803,14 @@ tty_resume_nhwindows(void)
docrt();
}
#ifdef CHANGE_COLOR
char *
tty_get_color_string(void)
{
return (char *) 0;
}
#endif /* CHANGE_COLOR */
void
tty_exit_nhwindows(const char *str)
{
@@ -3941,6 +3949,14 @@ term_curs_set(int visibility UNUSED)
/* nothing */
}
#ifdef CHANGE_COLOR
void
tty_change_color(int color UNUSED, long rgb UNUSED, int reverse UNUSED)
{
/* nothing */
}
#endif /* CHANGE_COLOR */
#endif /* NO_TERMS */
void
+3 -3
View File
@@ -115,7 +115,7 @@ struct window_procs mswin_procs = {
mswin_nh_poskey, mswin_nhbell, mswin_doprev_message, mswin_yn_function,
mswin_getlin, mswin_get_ext_cmd, mswin_number_pad, mswin_delay_output,
#ifdef CHANGE_COLOR /* only a Mac option currently */
mswin, mswin_change_background,
mswin_change_color, mswin_get_color_string,
#endif
/* other defs that really should go away (they're tty specific) */
mswin_start_screen, mswin_end_screen, mswin_outrip,
@@ -1901,9 +1901,9 @@ mswin_delay_output(void)
}
void
mswin_change_color(void)
mswin_change_color(int color, long rgb, int reverse)
{
logDebug("mswin_change_color()\n");
logDebug("mswin_change_color(%d, %ld, %d)\n", color, rgb, reverse);
}
char *
+1 -1
View File
@@ -178,7 +178,7 @@ void mswin_getlin(const char *question, char *input);
int mswin_get_ext_cmd(void);
void mswin_number_pad(int state);
void mswin_delay_output(void);
void mswin_change_color(void);
void mswin_change_color(int color, long rgb, int reverse);
char *mswin_get_color_string(void);
void mswin_start_screen(void);
void mswin_end_screen(void);