refactor(#28): DebugOverlay rep Config::RenderingConfig per referència
Pas 2/N del hallazgo #28. DebugOverlay deixa d'incloure game/options.hpp i passa a rebre un const Config::RenderingConfig& en el seu constructor. El Director li passa Options::rendering (que ja és un alias d'engine_config.rendering). Eliminat: include "game/options.hpp" des de core/system/debug_overlay.cpp. Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
This commit is contained in:
@@ -7,14 +7,18 @@
|
||||
|
||||
#pragma once
|
||||
|
||||
#include "core/config/engine_config.hpp"
|
||||
#include "core/graphics/vector_text.hpp"
|
||||
#include "core/rendering/render_context.hpp"
|
||||
|
||||
namespace System {
|
||||
|
||||
class DebugOverlay {
|
||||
public:
|
||||
explicit DebugOverlay(Rendering::Renderer* renderer);
|
||||
class DebugOverlay {
|
||||
public:
|
||||
// El rendering_cfg ha de viure tant com l'overlay (el posseeix
|
||||
// el Director, que sobreviu a tots els sistemes).
|
||||
DebugOverlay(Rendering::Renderer* renderer,
|
||||
const Config::RenderingConfig& rendering_cfg);
|
||||
|
||||
// Acumula FPS. Llamar una vez por frame con el delta del Director.
|
||||
void update(float delta_time);
|
||||
@@ -25,14 +29,15 @@ class DebugOverlay {
|
||||
void toggle() { visible_ = !visible_; }
|
||||
[[nodiscard]] auto isVisible() const -> bool { return visible_; }
|
||||
|
||||
private:
|
||||
private:
|
||||
Graphics::VectorText text_;
|
||||
const Config::RenderingConfig* rendering_cfg_;
|
||||
bool visible_{true};
|
||||
|
||||
// FPS counter — se actualiza cada FPS_UPDATE_INTERVAL segundos.
|
||||
float fps_accumulator_{0.0F};
|
||||
int fps_frame_count_{0};
|
||||
int fps_display_{0};
|
||||
};
|
||||
};
|
||||
|
||||
} // namespace System
|
||||
|
||||
Reference in New Issue
Block a user