Merge branch 'NetHack-3.6'

This commit is contained in:
nhmall
2019-11-30 15:41:52 -05:00
22 changed files with 102 additions and 63 deletions

View File

@@ -28,7 +28,9 @@ long amii_scrnmode;
* the intuition interface for the amiga...
*/
struct window_procs amii_procs = {
"amii", WC_COLOR | WC_HILITE_PET | WC_INVERSE, 0L, amii_init_nhwindows,
"amii", WC_COLOR | WC_HILITE_PET | WC_INVERSE,
{1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1}, /* color availability */
0L, amii_init_nhwindows,
amii_player_selection, amii_askname, amii_get_nh_event,
amii_exit_nhwindows, amii_suspend_nhwindows, amii_resume_nhwindows,
amii_create_nhwindow, amii_clear_nhwindow, amii_display_nhwindow,
@@ -60,7 +62,9 @@ struct window_procs amii_procs = {
* a shared library to allow the executable to be smaller.
*/
struct window_procs amiv_procs = {
"amitile", WC_COLOR | WC_HILITE_PET | WC_INVERSE, 0L, amii_init_nhwindows,
"amitile", WC_COLOR | WC_HILITE_PET | WC_INVERSE,
{1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1}, /* color availability */
0L, amii_init_nhwindows,
amii_player_selection, amii_askname, amii_get_nh_event,
amii_exit_nhwindows, amii_suspend_nhwindows, amii_resume_nhwindows,
amii_create_nhwindow, amii_clear_nhwindow, amii_display_nhwindow,

View File

@@ -3251,7 +3251,9 @@ struct window_procs mac_procs = {
WC_COLOR | WC_HILITE_PET | WC_FONT_MAP | WC_FONT_MENU | WC_FONT_MESSAGE
| WC_FONT_STATUS | WC_FONT_TEXT | WC_FONTSIZ_MAP | WC_FONTSIZ_MENU
| WC_FONTSIZ_MESSAGE | WC_FONTSIZ_STATUS | WC_FONTSIZ_TEXT,
0L, mac_init_nhwindows,
0L,
{1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1}, /* color availability */
mac_init_nhwindows,
mac_unimplemented, /* see macmenu.c:mac_askname() for player selection */
mac_askname, mac_get_nh_event, mac_exit_nhwindows, mac_suspend_nhwindows,
mac_unimplemented, mac_create_nhwindow, mac_clear_nhwindow,

View File

@@ -269,6 +269,33 @@ _mt_init_stuff(void)
clear_tty(_mt_window);
InitMenuRes();
{
/* update the window proc has_color table */
int i, setting = 0;
Rect r;
// Point p = {0, 0};
GDHandle gh = (GDHandle) 0;
if (_mt_in_color) {
GetWindowBounds(_mt_window, kWindowContentRgn, &r);
// SetPortWindowPort(_mt_window);
// LocalToGlobal (&p);
// OffsetRect (&r, p.h, p.v);
gh = GetMaxDevice(&r);
/* > 4 bpp */
setting = ((*((*gh)->gdPMap))->pixelSize > 4) ? 1 : 0;
}
for (i = 0; i < CLR_MAX ; ++i) {
tty_procs.has_color[i] =
(i == CLR_BLACK || i == NO_COLOR || i == CLR_WHITE)
? 1
: (_mt_in_color && gh)
? setting
: 0;
}
}
}
int
@@ -302,6 +329,8 @@ getreturn(char *str)
(void) tgetch();
}
#if 0 /* this function is commented out */
/* the tty has_color[] table is filled in during init above */
int
has_color(int color)
{
@@ -327,6 +356,7 @@ has_color(int color)
return (*((*gh)->gdPMap))->pixelSize > 4; /* > 4 bpp */
}
#endif
void
tty_delay_output(void)

View File

@@ -50,6 +50,7 @@ struct window_procs mswin_procs = {
| WC_TILE_WIDTH | WC_TILE_HEIGHT | WC_TILE_FILE | WC_VARY_MSGCOUNT
| WC_WINDOWCOLORS | WC_PLAYER_SELECTION,
WC2_FULLSCREEN | WC2_SOFTKEYBOARD | WC2_WRAPTEXT, mswin_init_nhwindows,
{1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1}, /* color availability */
mswin_player_selection, mswin_askname, mswin_get_nh_event,
mswin_exit_nhwindows, mswin_suspend_nhwindows, mswin_resume_nhwindows,
mswin_create_nhwindow, mswin_clear_nhwindow, mswin_display_nhwindow,

View File

@@ -722,7 +722,6 @@ tty_delay_output()
}
}
#ifdef TEXTCOLOR
/*
* CLR_BLACK 0
* CLR_RED 1
@@ -795,10 +794,10 @@ init_ttycolor()
#endif
init_ttycolor_completed = TRUE;
}
#endif /* TEXTCOLOR */
#if 0
int
has_color(int color)
has_color(int color) /* this function is commented out */
{
#ifdef TEXTCOLOR
if ((color >= 0) && (color < CLR_MAX))
@@ -810,6 +809,7 @@ has_color(int color)
else
return 0;
}
#endif
int
term_attr_fixup(int attrmask)

View File

@@ -114,12 +114,6 @@ backsp()
return;
}
int
has_color(int color)
{
return 1;
}
#ifndef NO_MOUSE_ALLOWED
void
toggle_mouse_support()