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;