build with TEXTCOLOR undef'd turned up a couple of things

Also, one more has_color in obsolete sys/mac folder. Adjusted code.
This commit is contained in:
nhmall
2019-11-30 15:05:48 -05:00
parent 0843c5d922
commit 31cfe76b67
3 changed files with 31 additions and 3 deletions

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

@@ -715,7 +715,6 @@ tty_delay_output()
}
}
#ifdef TEXTCOLOR
/*
* CLR_BLACK 0
* CLR_RED 1
@@ -788,7 +787,6 @@ init_ttycolor()
#endif
init_ttycolor_completed = TRUE;
}
#endif /* TEXTCOLOR */
#if 0
int

View File

@@ -4311,7 +4311,7 @@ unsigned long *bmarray;
the condition where this gets used always has the same value */
#define condcolor(bm,bmarray) NO_COLOR
#define term_start_color(color) /*empty*/
#define term_end_color(color) /*empty*/
#define term_end_color() /*empty*/
#endif /* TEXTCOLOR */
STATIC_OVL int