From 8284b8d9a7b3b8c6813a0c80aeba558906e0e371 Mon Sep 17 00:00:00 2001 From: Cyd Date: Tue, 28 Jul 2026 17:54:00 -0500 Subject: [PATCH] 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 --- engine/MUNGA_L4/L4GLASSWIN.cpp | 29 +++++++++++++++++++++++++++-- 1 file changed, 27 insertions(+), 2 deletions(-) diff --git a/engine/MUNGA_L4/L4GLASSWIN.cpp b/engine/MUNGA_L4/L4GLASSWIN.cpp index 065cdad..771a3de 100644 --- a/engine/MUNGA_L4/L4GLASSWIN.cpp +++ b/engine/MUNGA_L4/L4GLASSWIN.cpp @@ -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;