Un-pack the 7-display cockpit in-engine (L4MFDSPLIT=1)

The pod drove five monochrome MFDs from the color channels of two video
outputs - SVGA16 packs bit-slices of the shared gauge canvas into R/G/B
of gauge window 3 (upper MFDs) and R/G of window 4 (lower MFDs), with the
map palettized on the secondary and physically mounted portrait. The
desktop reconstruction previously required an external BitBlt-mirror
wrapper.

With L4MFDSPLIT=1, SVGA16 renders each display into its own window
(MFDSplitView, plain GDI) straight from the canvas + port bit-masks:
five green-screen MFD windows and the 90CW-rotated Map, tiled in the pod
grid to the right of the main view (L4MFDSCALE percent, default 50). The
packed D3D windows stay hidden but keep presenting off-screen, leaving
the original path untouched. Handles spanning mode (2-window setups).

Also: the plasma glass now opens directly below the main view (clamped
to the work area; L4PLASMAPOS=x,y overrides) per playtest feedback.

Verified: window grid comes up as main + 5 MFDs + Map + plasma with the
packed windows hidden; screenshots confirm a green MFD score readout and
the portrait tactical map rendering correctly. dist packer and BUILD.md
updated; the launcher wrapper is obsolete for split-mode use.

Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
This commit is contained in:
Cyd
2026-07-12 14:10:52 -05:00
co-authored by Claude Fable 5
parent 7362fd0811
commit 214a8e079c
10 changed files with 497 additions and 8 deletions
+42 -3
View File
@@ -2,6 +2,7 @@
#pragma hdrstop
#include "l4plasmascreen.h"
#include "l4app.h"
namespace
{
@@ -163,14 +164,52 @@ void
bounds.bottom = plasmaHeight * scale;
AdjustWindowRect(&bounds, WS_OVERLAPPED | WS_CAPTION | WS_SYSMENU | WS_MINIMIZEBOX, FALSE);
int window_w = bounds.right - bounds.left;
int window_h = bounds.bottom - bounds.top;
//---------------------------------------------------------------
// Default position: directly below the main view (the pod mounts
// the glass adjacent to the displays). The main window sits at
// (0,0) with the -res size; clamp to the work area in case the
// main view fills the screen. L4PLASMAPOS=x,y overrides.
//---------------------------------------------------------------
int x = 0;
int y = (int) L4Application::GetScreenHeight();
const char *pos_string = getenv("L4PLASMAPOS");
if (pos_string != NULL)
{
int px = 0, py = 0;
if (sscanf(pos_string, "%d,%d", &px, &py) == 2)
{
x = px;
y = py;
}
}
else
{
RECT work;
if (SystemParametersInfoA(SPI_GETWORKAREA, 0, &work, 0))
{
if (y + window_h > work.bottom)
{
y = work.bottom - window_h;
}
if (y < 0)
{
y = 0;
}
}
}
window = CreateWindowExA(
0,
plasmaWindowClass,
"Plasma Display",
WS_OVERLAPPED | WS_CAPTION | WS_SYSMENU | WS_MINIMIZEBOX,
CW_USEDEFAULT, CW_USEDEFAULT,
bounds.right - bounds.left,
bounds.bottom - bounds.top,
x, y,
window_w,
window_h,
NULL, NULL, instance, NULL
);