move the debug stats panel out of the renderer

This commit is contained in:
2026-08-05 21:27:21 +02:00
parent e5dcb9de5f
commit f39fe9a118
5 changed files with 57 additions and 64 deletions

View File

@@ -6,7 +6,6 @@
#include <string>
#include <vector>
#include <QCoreApplication>
#include <QColor>
#include <QPoint>
#include <QPointF>
@@ -70,16 +69,13 @@ struct WorldRenderFrame
//
// Reads the simulation and never writes it, and knows nothing about input — the
// view resolves clicks and owns the interaction state, and hands the parts the
// renderer needs over in a WorldRenderFrame. Screen-anchored chrome that is not
// part of the world (the pause and deconstruct vignettes, the replay overlay)
// stays with the view, which is also why those never took a WorldCoordinates.
// renderer needs over in a WorldRenderFrame.
//
// Everything here is positioned in tiles. Screen-anchored chrome — the pause and
// deconstruct vignettes, the replay overlay, the debug stats panel — stays with
// the view, which is why nothing in this class draws translatable text.
class WorldRenderer
{
// Not a QObject, but drawDebugOverlay puts text on screen, so it still needs
// tr() for translation (REQ-UI-...): this declares the tr() overloads without
// dragging in the meta-object system.
Q_DECLARE_TR_FUNCTIONS(WorldRenderer)
public:
// `itemIcons` is the window-wide per-item icon cache (REQ-UI-ITEM-ICON); not
// owned, must outlive this renderer. `configDir` is used once, to load the
@@ -121,10 +117,6 @@ private:
const WorldRenderFrame& frame);
void drawOverlays(QPainter& painter, const WorldCoordinates& coordinates,
const WorldRenderFrame& frame);
// Screen-anchored, but drawn mid-world so ships and effects still paint over
// it, as they always have.
void drawDebugOverlay(QPainter& painter);
// Draws a single item centered at widget-space `center`, spanning `halfPx` in
// each direction (a half-tile). Uses the item's icon when one exists
// (REQ-UI-ITEM-ICON), otherwise falls back to the colored square from