Glass panels: MFD phosphor green (21FF42) + respect BT_COCKPIT_TINT

The BT_GLASS_PANELS=1 per-display windows tinted the mono MFD surfaces pure
WHITE (MfdMonoTint 0x00FFFFFF) -- the cockpit surround already used phosphor
green via BT_COCKPIT_TINT (L4VB16 CkTint).  New GlassMfdTint(): default the
standard green rgb(33,255,66)=0x0021FF42, overridable by the SAME
BT_COCKPIT_TINT=RRGGBB env the surround honours (used verbatim as the
0x00RRGGBB ExpandPlaneToBGRA tint -- no R5G6B5 packing, which is the
surround's D3D path).

Pixel-verified live (BT_GLASS_PANELS=1): all lit interior MFD pixels
R33 G255 B66 = 21FF42 by default (was white); BT_COCKPIT_TINT=FF8000 ->
R255 G128 B0.  Radar keeps its amber palette (monoTint -1, unchanged).

Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
This commit is contained in:
Cyd
2026-07-28 20:27:26 -05:00
co-authored by Claude Fable 5
parent 2cbf9cd88f
commit 8284b8d9a7
+27 -2
View File
@@ -57,9 +57,34 @@ enum
RadarSurfW = 480, RadarSurfH = 640, // portrait secondary/radar CRT at native (rotated 640x480)
RepaintTimerId = 1,
RepaintMilliseconds = 62, // == L4PADPANEL (half the fastest lamp half-period)
MfdMonoTint = 0x00FFFFFF // mono MFD phosphor colour (BGRA); tunable
MfdMonoTint = 0x0021FF42 // standard phosphor green rgb(33,255,66);
// 0x00RRGGBB, env BT_COCKPIT_TINT overrides
};
//
// The mono-MFD phosphor tint for the glass-panel windows: the standard green
// (MfdMonoTint), or BT_COCKPIT_TINT=RRGGBB (the SAME env the cockpit surround
// honours -- L4VB16.cpp CkTint). Read once. ExpandPlaneToBGRA wants the tint
// as 0x00RRGGBB (its palette path builds Red<<16 | Green<<8 | Blue), so the
// hex is used verbatim -- no R5G6B5 packing (that is the surround's D3D path).
//
static unsigned long
GlassMfdTint()
{
static unsigned long t = 0;
if (t == 0)
{
const char *e = getenv("BT_COCKPIT_TINT");
if (e != NULL && strlen(e) >= 6)
t = (unsigned long)(strtoul(e, NULL, 16) & 0x00FFFFFF);
else
t = (unsigned long)MfdMonoTint;
if (t == 0)
t = (unsigned long)MfdMonoTint; // a literal "000000" -> green, not invisible
}
return t;
}
enum ColorClass { ClrRed, ClrYellow, ClrBlue };
struct GButton
@@ -181,7 +206,7 @@ static void
w.title = title;
w.portPrimary = portP;
w.portAlt = portA;
w.monoTint = MfdMonoTint;
w.monoTint = (int)GlassMfdTint(); // standard green or BT_COCKPIT_TINT
w.rotate = 0;
BTRioBankMetrics metrics;