move the debug stats panel out of the renderer
It was the one thing in WorldRenderer positioned in pixels rather than tiles, kept there only to preserve its draw order. With the order agreed not to matter, the world-space / screen-space split becomes exact. The real payoff is translation. drawDebugOverlay was the only caller of tr() in the renderer, so Q_DECLARE_TR_FUNCTIONS and the QCoreApplication include go with it. Nothing left in the renderer draws translatable text - its text is config-driven glyphs, ASCII port arrows and numbers - so it no longer needs a tie to the meta-object system at all. That is the argument I should have weighed originally instead of anchoring on draw order. The panel now paints on top of ships and beams rather than under them, and the widget gates it on its own m_debugDraw directly. The frame still carries isDebugDrawEnabled, because the sensor ranges and target lines it also gates are genuinely world-space. Dropped the painter.resetTransform() the function opened with: it was vestigial from the older design that drew the world through painter.translate, and has been a no-op since every conversion became explicit arithmetic. Co-Authored-By: Claude Opus 5 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01JcReq7hVk4KUPhTDKWAG7K
This commit is contained in:
@@ -150,6 +150,10 @@ private:
|
||||
// Screen-anchored chrome, drawn after the world (see WorldRenderer): these
|
||||
// need no world transform, which is exactly why they stayed here.
|
||||
void drawScreenSpace(QPainter& painter);
|
||||
// Threat and production readout shown while debug draw is on (F3). Positioned
|
||||
// in pixels at the top-left corner, so it belongs with the chrome rather than
|
||||
// with the world.
|
||||
void drawDebugOverlay(QPainter& painter);
|
||||
// Vignette-style border shown while the game is paused (speed 0x, REQ-UI-PAUSE-BORDER)
|
||||
// to make the paused state hard to miss: a black frame whose alpha fades from 50% at
|
||||
// the viewport edges to 0% toward the center.
|
||||
|
||||
Reference in New Issue
Block a user