revisió de metodes de debug

This commit is contained in:
2026-03-22 10:16:09 +01:00
parent 0cdbeb768d
commit 5e013a8414
6 changed files with 17 additions and 47 deletions

View File

@@ -13,10 +13,6 @@
#include "game/ui/notifier.hpp" // Para Notifier, NotificationText
#include "utils/utils.hpp" // Para stringInVector
#ifdef _DEBUG
#include "core/system/debug.hpp" // Para Debug
#endif
namespace GlobalInputs {
// Funciones internas
@@ -126,18 +122,6 @@ namespace GlobalInputs {
Notifier::get()->show({Locale::get()->get(Options::video.vertical_sync ? "ui.vsync_enabled" : "ui.vsync_disabled")});
}
#ifdef _DEBUG
void handleShowDebugInfo() {
Screen::get()->toggleDebugInfo();
}
/*
void handleToggleDebug() {
Debug::get()->toggleEnabled();
Notifier::get()->show({"DEBUG " + std::string(Debug::get()->isEnabled() ? "ENABLED" : "DISABLED")}, Notifier::TextAlign::CENTER);
}
*/
#endif
// Detecta qué acción global ha sido presionada (si alguna)
auto getPressedAction() -> InputAction {
@@ -257,16 +241,6 @@ void handleToggleDebug() {
handleToggleVSync();
break;
case InputAction::TOGGLE_DEBUG:
// handleToggleDebug();
break;
#ifdef _DEBUG
case InputAction::SHOW_DEBUG_INFO:
handleShowDebugInfo();
break;
#endif
case InputAction::NONE:
default:
// No se presionó ninguna acción global

View File

@@ -393,7 +393,7 @@ auto Screen::findPalette(const std::string& name) -> size_t {
// Muestra información por pantalla
void Screen::renderInfo() const {
if (show_debug_info_ && (Resource::Cache::get() != nullptr)) {
if (show_fps_ && (Resource::Cache::get() != nullptr)) {
auto text = Resource::Cache::get()->getText("smb2");
auto color = static_cast<Uint8>(PaletteColor::YELLOW);
auto shadow = static_cast<Uint8>(PaletteColor::BLACK);
@@ -428,8 +428,8 @@ void Screen::hide() { SDL_HideWindow(window_); }
// Establece la visibilidad de las notificaciones
void Screen::setNotificationsEnabled(bool value) { notifications_enabled_ = value; }
// Activa / desactiva la información de debug
void Screen::toggleDebugInfo() { show_debug_info_ = !show_debug_info_; }
// Activa / desactiva el contador de FPS
void Screen::toggleFPS() { show_fps_ = !show_fps_; }
// Alterna entre activar y desactivar el escalado entero
void Screen::toggleIntegerScale() {

View File

@@ -62,7 +62,7 @@ class Screen {
// Surfaces y notificaciones
void setRendererSurface(const std::shared_ptr<Surface>& surface = nullptr); // Establece el renderizador para las surfaces
void setNotificationsEnabled(bool value); // Establece la visibilidad de las notificaciones
void toggleDebugInfo(); // Activa o desactiva la información de debug
void toggleFPS(); // Activa o desactiva el contador de FPS
// Getters
auto getRenderer() -> SDL_Renderer*;
@@ -158,8 +158,8 @@ class Screen {
std::vector<Uint32> pixel_buffer_; // Buffer intermedio para SDL3GPU path (surface → ARGB)
#ifdef _DEBUG
bool show_debug_info_{true}; // Indica si ha de mostrar la información de debug
bool show_fps_{true}; // Indica si ha de mostrar el contador de FPS
#else
bool show_debug_info_{false}; // Indica si ha de mostrar la información de debug
bool show_fps_{false}; // Indica si ha de mostrar el contador de FPS
#endif
};