clang-tidy

This commit is contained in:
2025-07-20 12:16:25 +02:00
parent a7ef29b750
commit bfda842d3c
43 changed files with 512 additions and 504 deletions

View File

@@ -19,16 +19,16 @@
#include "ui/service_menu.h" // Para ServiceMenu
// Singleton
Screen *Screen::instance_ = nullptr;
Screen *Screen::instance = nullptr;
// Inicializa la instancia única del singleton
void Screen::init() { Screen::instance_ = new Screen(); }
void Screen::init() { Screen::instance = new Screen(); }
// Libera la instancia
void Screen::destroy() { delete Screen::instance_; }
void Screen::destroy() { delete Screen::instance; }
// Obtiene la instancia
auto Screen::get() -> Screen * { return Screen::instance_; }
auto Screen::get() -> Screen * { return Screen::instance; }
// Constructor
Screen::Screen()
@@ -214,7 +214,7 @@ void Screen::renderInfo() {
debug_info_.text->writeDX(TEXT_COLOR | TEXT_STROKE, param.game.width - debug_info_.text->lenght(Options::video.info) - 2, 1, Options::video.info, 1, param.debug.color, 1, param.debug.color.DARKEN(150));
// FPS
const std::string FPS_TEXT = std::to_string(fps_.lastValue) + " FPS";
const std::string FPS_TEXT = std::to_string(fps_.last_value) + " FPS";
debug_info_.text->writeDX(TEXT_COLOR | TEXT_STROKE, param.game.width - debug_info_.text->lenght(FPS_TEXT) - 2, 1 + debug_info_.text->getCharacterSize(), FPS_TEXT, 1, param.debug.color, 1, param.debug.color.DARKEN(150));
}
}
@@ -254,7 +254,7 @@ void Screen::adjustWindowSize() {
const int NEW_POS_X = old_pos_x + ((old_width - WIDTH) / 2);
const int NEW_POS_Y = old_pos_y + ((old_height - HEIGHT) / 2);
SDL_SetWindowPosition(window_, std::max(NEW_POS_X, WINDOWS_DECORATIONS_), std::max(NEW_POS_Y, 0));
SDL_SetWindowPosition(window_, std::max(NEW_POS_X, WINDOWS_DECORATIONS), std::max(NEW_POS_Y, 0));
SDL_SetWindowSize(window_, WIDTH, HEIGHT);
}
}
@@ -370,7 +370,7 @@ void Screen::getDisplayInfo() {
std::to_string(static_cast<int>(dm->refresh_rate)) + " Hz";
// Calcula el máximo factor de zoom que se puede aplicar a la pantalla
const int MAX_ZOOM = std::min(dm->w / param.game.width, (dm->h - WINDOWS_DECORATIONS_) / param.game.height);
const int MAX_ZOOM = std::min(dm->w / param.game.width, (dm->h - WINDOWS_DECORATIONS) / param.game.height);
// Normaliza los valores de zoom
Options::window.size = std::min(Options::window.size, MAX_ZOOM);