From 357b5d5977a70680735a8b959394ad1cf41e7e5a Mon Sep 17 00:00:00 2001 From: Sergio Valor Date: Fri, 24 Oct 2025 10:33:18 +0200 Subject: [PATCH] linter: renombrar variables --- source/background.cpp | 6 +++--- source/bullet_manager.hpp | 6 +++--- source/resource_loader.cpp | 14 +++++++------- 3 files changed, 13 insertions(+), 13 deletions(-) diff --git a/source/background.cpp b/source/background.cpp index bffbf74..064c0ac 100644 --- a/source/background.cpp +++ b/source/background.cpp @@ -514,10 +514,10 @@ void Background::updateAlphaColorTexture(float delta_time) { // 4. Actualiza el valor entero solo si ha cambiado lo suficiente // Usamos std::round para un redondeo más natural. - const auto new_alpha = static_cast(std::round(current_alpha_float_)); + const auto NEW_ALPHA = static_cast(std::round(current_alpha_float_)); - if (new_alpha != previous_alpha_color_texture_) { - previous_alpha_color_texture_ = new_alpha; + if (NEW_ALPHA != previous_alpha_color_texture_) { + previous_alpha_color_texture_ = NEW_ALPHA; // SDL espera un Uint8 (0-255), así que hacemos un cast seguro. SDL_SetTextureAlphaMod(color_texture_, static_cast(previous_alpha_color_texture_)); } diff --git a/source/bullet_manager.hpp b/source/bullet_manager.hpp index d4467e3..f3f7539 100644 --- a/source/bullet_manager.hpp +++ b/source/bullet_manager.hpp @@ -3,9 +3,9 @@ #include // Para SDL_FRect #include // Para function +#include // Para list #include // Para shared_ptr #include // Para vector -#include // Para list #include "bullet.hpp" // for Bullet @@ -71,6 +71,6 @@ class BulletManager { OutOfBoundsCallback out_of_bounds_callback_; // Callback para balas fuera de límites // --- Métodos internos --- - void processBulletUpdate(const std::shared_ptr& bullet, float delta_time); // Procesa actualización individual - auto isBulletOutOfBounds(const std::shared_ptr& bullet) const -> bool; // Verifica si la bala está fuera de límites + void processBulletUpdate(const std::shared_ptr& bullet, float delta_time); // Procesa actualización individual + [[nodiscard]] auto isBulletOutOfBounds(const std::shared_ptr& bullet) const -> bool; // Verifica si la bala está fuera de límites }; \ No newline at end of file diff --git a/source/resource_loader.cpp b/source/resource_loader.cpp index 85e3558..8e7df94 100644 --- a/source/resource_loader.cpp +++ b/source/resource_loader.cpp @@ -24,22 +24,22 @@ ResourceLoader::~ResourceLoader() { shutdown(); } -auto ResourceLoader::initialize(const std::string& packFile, bool enable_fallback) -> bool { +auto ResourceLoader::initialize(const std::string& pack_file, bool enable_fallback) -> bool { shutdown(); fallback_to_files_ = enable_fallback; - pack_path_ = packFile; + pack_path_ = pack_file; - if (std::filesystem::exists(packFile)) { + if (std::filesystem::exists(pack_file)) { resource_pack_ = new ResourcePack(); - if (resource_pack_->loadPack(packFile)) { - std::cout << "Resource pack loaded successfully: " << packFile << '\n'; + if (resource_pack_->loadPack(pack_file)) { + std::cout << "Resource pack loaded successfully: " << pack_file << '\n'; std::cout << "Resources available: " << resource_pack_->getResourceCount() << '\n'; return true; } delete resource_pack_; resource_pack_ = nullptr; - std::cerr << "Failed to load resource pack: " << packFile << std::endl; + std::cerr << "Failed to load resource pack: " << pack_file << std::endl; } if (fallback_to_files_) { @@ -47,7 +47,7 @@ auto ResourceLoader::initialize(const std::string& packFile, bool enable_fallbac return true; } - std::cerr << "Resource pack not found and fallback disabled: " << packFile << '\n'; + std::cerr << "Resource pack not found and fallback disabled: " << pack_file << '\n'; return false; }