From 4037e3981053d87fba968e1627979f09a9f89beb Mon Sep 17 00:00:00 2001 From: Cyd Date: Sun, 12 Jul 2026 15:12:17 -0500 Subject: [PATCH] Paint the cockpit panes immediately - queued WM_PAINTs starve The game loop pumps ONE message per frame (APPMGR.cpp PeekMessage), and WM_PAINT is synthesized only when the queue is otherwise empty - so the child panes queued invalidations that never delivered: the map stayed black and button lamps froze at their first-paint state on the live screen. (PrintWindow-based captures forced paints and the synthetic SendMessage click bypassed the queue, which is why every automated verification looked fine while the live window was frozen.) MFDSplitView::Repaint and PlasmaScreen::Update now paint synchronously via RedrawWindow(RDW_INVALIDATE|RDW_UPDATENOW) at fill time, and the button press/release feedback goes through the same path. Verified with a true screen capture (CopyFromScreen): map drawing live, timer counting, the active preset lamp bright on the map right column. Lamp anchor sanity-check against the game code: mode switch NOV/STD/ VET/EXP = ButtonAuxUpperRight5-8 = 0x33..0x30 = the upper-right MFD bottom strip left-to-right; presets = Secondary7-12 = 0x18-0x1D = the map right column - both match the placed buttons. Co-Authored-By: Claude Fable 5 --- MUNGA_L4/L4MFDVIEW.cpp | 12 +++++++++--- MUNGA_L4/L4PLASMASCREEN.cpp | 5 ++++- 2 files changed, 13 insertions(+), 4 deletions(-) diff --git a/MUNGA_L4/L4MFDVIEW.cpp b/MUNGA_L4/L4MFDVIEW.cpp index c73daf3..abd6d07 100644 --- a/MUNGA_L4/L4MFDVIEW.cpp +++ b/MUNGA_L4/L4MFDVIEW.cpp @@ -371,7 +371,7 @@ void pressedIndex = i; SetCapture((HWND) window); PadRIO::SetScreenButton(button->unit, True); - InvalidateRect((HWND) window, NULL, FALSE); + Repaint(); return; } } @@ -388,16 +388,22 @@ void { ReleaseCapture(); } - InvalidateRect((HWND) window, NULL, FALSE); + Repaint(); } } +//~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ +// Paint NOW rather than queueing an invalidation: the game loop pumps +// one message per frame, and queued WM_PAINTs (lowest priority) starve +// behind it - panes would freeze on their first frame. +//~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ void MFDSplitView::Repaint() { Check_Pointer(this); if (window != NULL) { - InvalidateRect((HWND) window, NULL, FALSE); + RedrawWindow((HWND) window, NULL, NULL, + RDW_INVALIDATE | RDW_UPDATENOW); } } diff --git a/MUNGA_L4/L4PLASMASCREEN.cpp b/MUNGA_L4/L4PLASMASCREEN.cpp index 89de93f..4b13807 100644 --- a/MUNGA_L4/L4PLASMASCREEN.cpp +++ b/MUNGA_L4/L4PLASMASCREEN.cpp @@ -304,7 +304,10 @@ Logical if (dirty && window != NULL) { - InvalidateRect((HWND) window, NULL, FALSE); + // paint now - queued WM_PAINTs starve behind the game loop's + // one-message-per-frame pump + RedrawWindow((HWND) window, NULL, NULL, + RDW_INVALIDATE | RDW_UPDATENOW); } return False; // 'done' - nothing left to stream