diff --git a/engine/MUNGA_L4/L4VB16.cpp b/engine/MUNGA_L4/L4VB16.cpp index 89a75ea..58f1fc1 100644 --- a/engine/MUNGA_L4/L4VB16.cpp +++ b/engine/MUNGA_L4/L4VB16.cpp @@ -650,10 +650,18 @@ int BTCockpitButtonAt(int px, int py, int clientW, int clientH) return -1; } +// Backtick (`) toggle: hide the SECONDARY cockpit displays -- the MFD/radar +// panel (and its button banks) that frame the 3D viewscreen -- for an +// unobstructed view. Flipped from the main WndProc (btl4main.cpp) on the '`' +// key; read here so the composite simply skips itself when hidden. The primary +// 3D viewscreen already fills the window, so hiding the panel needs nothing else. +int gBTHideSecondaryDisplays = 0; + // void BTDrawCockpitPanel(LPDIRECT3DDEVICE9 device) { if (!DevCockpitPanel() || device == NULL) return; + if (gBTHideSecondaryDisplays) return; // '`' hid the instrument panel IDirect3DSurface9 *rt = NULL; if (FAILED(device->GetRenderTarget(0, &rt)) || rt == NULL) return; D3DSURFACE_DESC d; diff --git a/game/btl4main.cpp b/game/btl4main.cpp index 536cc14..4021f05 100644 --- a/game/btl4main.cpp +++ b/game/btl4main.cpp @@ -80,6 +80,16 @@ LRESULT CALLBACK WndProc(HWND hWnd, UINT uMsg, WPARAM wParam, LPARAM lParam) switch (uMsg) { case WM_KEYDOWN: + // Backtick (`) toggles the SECONDARY cockpit displays (the MFD/radar + // panel that frames the 3D viewscreen) on/off, for an unobstructed + // view. Edge-triggered via lParam bit 30 (the previous key state) so + // auto-repeat while the key is held does not flicker the panel. + if (wParam == VK_OEM_3 && (lParam & (1 << 30)) == 0) + { + extern int gBTHideSecondaryDisplays; + gBTHideSecondaryDisplays = !gBTHideSecondaryDisplays; + } + return 0; case WM_KEYUP: // Drive keys are NOT read here: the engine's keyboard reader // (L4CTRL.cpp:1506) GetMessage()s every WM_KEYUP / WM_CHAR out of the