The assembled shell could exceed the work area (1291px tall at default scale) - on a 1080p monitor the whole lower row, map included, hung off the bottom of the screen, which read as the map not rendering, and the lamp-reactive preset buttons were unreachable down there. (The render and click paths themselves were verified fine: a synthetic press on a map preset button lights it through the game lamp command.) The layout now measures SPI_GETWORKAREA and fits: the pane scale steps down (to 20% minimum) and the viewscreen takes the leftover height at the 3D aspect, shrinking below native when needed - Present stretches, so the scene scales cleanly. Rows and viewscreen center in the shell, which is sized to the work area. Verified: at 70% panes in a 1392-high work area the viewscreen reduced to 609x457 with everything on screen. The plasma glass sits out of the cockpit for the moment (PlasmaScreen::Hide) per playtest direction. 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;
|
|
};
|