Files
BT411/engine/MUNGA_L4/l4glasswin.h
T
CydandClaude Opus 4.8 7d112ce309 Glass panels: flash at full rate when unfocused + red Panic/Eject button
Two glass-panel indicator fixes reported by playtesters.

1. FLASH SLOW UNLESS FOCUSED.  The per-display panel windows repaint off a
   62ms WM_TIMER, and Windows coalesces/throttles timer + paint messages for a
   window that is in the BACKGROUND (unfocused) -- so with the game window
   holding focus the panels' lamp flash (a repaint-driven animation) crawled,
   and giving a panel focus un-throttled it.  (My earlier surround fix drew in
   the main D3D frame and never touched these separate windows.)  New
   BTGlassPanels_Tick(), called once per frame from the main render loop
   (L4VIDEO), drives a synchronous InvalidateRect+UpdateWindow at the ~16Hz
   flash cadence -- the main loop runs every frame regardless of which window
   has focus, and the forced paint bypasses the throttled timer-message path.
   The WM_TIMER stays for its one-shot re-snap.

2. RED PANIC/EJECT.  0x3D is the Panic/Eject button; on the blue flight panel
   it was just another blue block.  The shared flight-grid geometry (L4RIOBANK)
   now tags 0x3D as colorClass 0 (red); L4GLASSWIN's AdoptBank maps colorClass
   0 -> ClrRed explicitly (the flight bank's ClrBlue default no longer swallows
   it), and the surround (L4VB16) already renders non-blue/yellow as red -- so
   the eject stands out red in both the surround and the exploded window.

Verified: Release links clean (40 tolerated /FORCE externals only); exploded
panels boot + run 13s no crash under the per-frame repaint pump; riobank dump
confirms 0x3d class=0 (red), neighbours class=2 (blue).

Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
2026-08-04 19:28:11 -05:00

52 lines
2.2 KiB
C

#pragma once
//###########################################################################
//
// L4GLASSWIN -- per-display glass cockpit windows (BT_GLASS only; this TU is
// only in the build when the gate is on -- see CMakeLists.txt).
//
// Under `-platform glass` with BT_GLASS_PANELS=1 (the glass preset default),
// each pod SECONDARY display gets its OWN desktop window carrying that
// display's surface AND its RIO button bank placed AROUND it, mirroring the
// physical pod cockpit:
//
// Heat (UL) / Mfd2 (UC) / Comm (UR) / Mfd1 (LL) / Mfd3 (LR) -- red MFD
// banks split 4 buttons ABOVE / 4 BELOW the surface;
// sec radar (center, portrait) -- yellow
// Secondary buttons split LEFT / RIGHT of the surface;
// Flight Controls -- the
// no-display banks (throttle 0x38-3F, joystick/fire 0x40-47, panic).
//
// Each window is a GDI window (like L4PADPANEL + L4PLASMAWIN): the surface is
// CPU-expanded from the shared gauge pixelBuffer (SVGA16::ExpandPlaneToBGRA)
// and StretchDIBits'd in -- NO D3D, so the whole D3D dev-composite path
// (dock / separate window / overlay) stands down while these are up. Clicks
// inject through PadRIO::SetScreenButton; lamps render from GetLampState.
// Created / destroyed by the PadRIO ctor / dtor.
//
//###########################################################################
void
BTGlassPanels_Create();
void
BTGlassPanels_Destroy();
//
// Per-frame repaint pump. Call once per frame from the main render loop so the
// per-display windows' lamp flash keeps animating even when they are in the
// background (Windows throttles a background window's own WM_TIMER; this drives a
// synchronous repaint at the flash cadence instead). No-op unless the windows
// are up. See the note at the definition (L4GLASSWIN.cpp).
//
void
BTGlassPanels_Tick();
//
// True when BT_GLASS_PANELS mode is selected (default ON under `-platform
// glass`, OFF otherwise). Read by the render loop / L4VB16 dev-composite to
// suppress the single L4PADPANEL and the D3D gauge compositing. Cheap +
// cached; safe to call before the windows exist.
//
int
BTGlassPanelsActive();