fix: const a punters i refs (13 troballes)

This commit is contained in:
2026-05-14 20:47:34 +02:00
parent 1b40c90a00
commit f4dea6d39b
10 changed files with 15 additions and 15 deletions

View File

@@ -1278,7 +1278,7 @@ auto MapEditor::createNewRoom(const std::string& direction) -> std::string { //
// Comprobar que no hay ya una room en esa dirección
if (!direction.empty()) {
std::string* existing = nullptr;
const std::string* existing = nullptr;
if (direction == "UP") {
existing = &room_data_.upper_room;
} else if (direction == "DOWN") {
@@ -1294,7 +1294,7 @@ auto MapEditor::createNewRoom(const std::string& direction) -> std::string { //
}
// Encontrar el primer número libre (reutiliza huecos)
auto& rooms = Resource::Cache::get()->getRooms();
const auto& rooms = Resource::Cache::get()->getRooms();
std::set<int> used;
for (const auto& r : rooms) {
try {

View File

@@ -79,7 +79,7 @@ void MiniMap::buildTileColorTable(const std::string& tileset_name) {
// Posiciona las rooms en un grid usando BFS desde las conexiones
void MiniMap::layoutRooms() {
auto& rooms = Resource::Cache::get()->getRooms();
const auto& rooms = Resource::Cache::get()->getRooms();
if (rooms.empty()) { return; }
// Mapa de nombre → Room::Data

View File

@@ -45,7 +45,7 @@ Cheevos::~Cheevos() {
// Inicializa los logros
void Cheevos::init() { // NOLINT(readability-convert-member-functions-to-static)
cheevos_list_.clear();
auto* loc = Locale::get();
const auto* loc = Locale::get();
cheevos_list_.emplace_back(Achievement{.id = 1, .caption = loc->get("achievements.c1"), .description = loc->get("achievements.d1"), .icon = 2});
cheevos_list_.emplace_back(Achievement{.id = 2, .caption = loc->get("achievements.c2"), .description = loc->get("achievements.d2"), .icon = 2});
cheevos_list_.emplace_back(Achievement{.id = 3, .caption = loc->get("achievements.c3"), .description = loc->get("achievements.d3"), .icon = 2});

View File

@@ -50,7 +50,7 @@ void Credits::handleInput() {
// Inicializa los textos
void Credits::iniTexts() { // NOLINT(readability-convert-member-functions-to-static)
auto* loc = Locale::get();
const auto* loc = Locale::get();
texts_.clear();
texts_.push_back({.label = "", .color = static_cast<Uint8>(PaletteColor::WHITE)});

View File

@@ -172,7 +172,7 @@ void Ending::updateState(float delta_time) {
void Ending::iniTexts() { // NOLINT(readability-convert-member-functions-to-static)
// Vector con los textos (traducidos según el idioma activo)
std::vector<TextAndPosition> texts;
auto* loc = Locale::get();
const auto* loc = Locale::get();
// Escena #0
texts.push_back({.caption = loc->get("ending.t0"), .pos = 32});

View File

@@ -68,7 +68,7 @@ void GameOver::render() {
auto text = Resource::Cache::get()->getText("smb2");
// Escribe el texto de GAME OVER
auto* loc = Locale::get();
const auto* loc = Locale::get();
text->writeDX(Text::CENTER_FLAG | Text::COLOR_FLAG, GameCanvas::CENTER_X, TEXT_Y, loc->get("game_over.title"), 1, color_); // NOLINT(readability-static-accessed-through-instance)
// Dibuja los sprites (ya posicionados en el constructor, solo ajustamos Y)

View File

@@ -544,7 +544,7 @@ void Title::renderMainMenu() {
const int TOTAL_HEIGHT = 3 * SPACING; // 3 espacios entre 4 items
const int START_Y = MENU_CENTER_Y - (TOTAL_HEIGHT / 2);
auto* loc = Locale::get();
const auto* loc = Locale::get();
menu_text_->writeDX(Text::CENTER_FLAG | Text::COLOR_FLAG, PlayArea::CENTER_X, START_Y, loc->get("title.menu.play"), 1, COLOR);
menu_text_->writeDX(Text::CENTER_FLAG | Text::COLOR_FLAG, PlayArea::CENTER_X, START_Y + SPACING, loc->get("title.menu.keyboard"), 1, COLOR);
menu_text_->writeDX(Text::CENTER_FLAG | Text::COLOR_FLAG, PlayArea::CENTER_X, START_Y + (2 * SPACING), loc->get("title.menu.joystick"), 1, COLOR);
@@ -683,7 +683,7 @@ void Title::renderKeyboardRemap() const {
const int START_Y = MENU_CENTER_Y - (2 * TEXT_SIZE); // Centrado aproximado
// Mensaje principal: "PRESS KEY FOR [ACTION]" o "KEYS DEFINED" si completado
auto* loc = Locale::get();
const auto* loc = Locale::get();
if (remap_step_ >= 3) {
menu_text_->writeDX(Text::CENTER_FLAG | Text::COLOR_FLAG, PlayArea::CENTER_X, START_Y, loc->get("title.keys.defined"), 1, COLOR);
} else {
@@ -731,7 +731,7 @@ void Title::renderJoystickRemap() const {
const int START_Y = MENU_CENTER_Y - (2 * TEXT_SIZE); // Centrado aproximado
// Mensaje principal: "PRESS BUTTON FOR [ACTION]" o "BUTTONS DEFINED" si completado
auto* loc = Locale::get();
const auto* loc = Locale::get();
if (remap_step_ >= 3) {
menu_text_->writeDX(Text::CENTER_FLAG | Text::COLOR_FLAG, PlayArea::CENTER_X, START_Y, loc->get("title.buttons.defined"), 1, COLOR);
} else {

View File

@@ -32,7 +32,7 @@
// Toggle genérico para comandos booleanos ON/OFF (reemplaza macro BOOL_TOGGLE_CMD)
static auto boolToggle(
const std::string& label,
bool& option,
const bool& option,
const std::function<void()>& toggle_fn,
const std::vector<std::string>& args) -> std::string {
if (args.empty()) {