Renders BT's 128x32 plasma display into a desktop window instead of streaming to serial hardware. L4PLASMASCREEN.* copied verbatim from RP412; the L4GREND.cpp selector diff applied (BT's only divergence there is a comment -- no collision). Verified: a 'Plasma Display' window opens and the game ticks normally beside it (L4GAUGE=640x480x16 L4PLASMA=SCREEN). Phase 3b (single-window MFD-split cockpit) is DEFERRED -- blocked on the missing BT cockpit-layout geometry and BT's unfinished upstream MFD dev-composite; the L4VB16 hand-merge is HIGH-risk (BT's dev-gauge docking overlaps RP412's split rewrite). See context/steamification.md and docs/BT412-ROADMAP.md. (Phase 3 of the roadmap) Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
65 lines
1.5 KiB
C++
65 lines
1.5 KiB
C++
#pragma once
|
|
|
|
#include "l4vb8.h"
|
|
|
|
//########################################################################
|
|
//############################ PlasmaScreen ##############################
|
|
//########################################################################
|
|
//
|
|
// The cockpit's 128x32 plasma display rendered as a desktop window
|
|
// instead of streamed to serial hardware. The gauge system draws into
|
|
// the same Video8BitBuffered surface it always has; Update() just blits
|
|
// the buffer into a small "glass" window in plasma orange.
|
|
//
|
|
// Selected with L4PLASMA=SCREEN. L4PLASMASCALE sets the pixel size
|
|
// (default 4 -> a 512x128 window).
|
|
//
|
|
class PlasmaScreen :
|
|
public Video8BitBuffered
|
|
{
|
|
public:
|
|
enum
|
|
{
|
|
plasmaWidth=128,
|
|
plasmaHeight=32
|
|
};
|
|
|
|
PlasmaScreen();
|
|
|
|
~PlasmaScreen();
|
|
|
|
Logical
|
|
TestInstance() const;
|
|
|
|
Logical
|
|
Update(Logical forceall);
|
|
|
|
void
|
|
WaitForUpdate();
|
|
|
|
// Reposition/resize the live glass (client-area size; the paint
|
|
// stretches to fit, so this also rescales it). With a parent the
|
|
// glass becomes a chrome-less child pane of the cockpit window.
|
|
// Used by SVGA16's split-view layout; no-op when no plasma exists.
|
|
static void
|
|
Position(void *parent, int x, int y, int client_width, int client_height);
|
|
|
|
// Hide the glass entirely (cockpit currently runs without it).
|
|
static void
|
|
Hide();
|
|
|
|
protected:
|
|
static PlasmaScreen
|
|
*activeInstance;
|
|
|
|
void
|
|
CreateGlassWindow();
|
|
|
|
void
|
|
*window; // HWND, kept untyped so this header stays lean
|
|
void
|
|
*bitmapInfo; // BITMAPINFOHEADER + 256-entry orange palette
|
|
int
|
|
scale;
|
|
};
|