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 <noreply@anthropic.com>
This commit is contained in:
@@ -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);
|
||||
}
|
||||
}
|
||||
|
||||
@@ -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
|
||||
|
||||
Reference in New Issue
Block a user