diff --git a/source/core/audio/audio.cpp b/source/core/audio/audio.cpp index da8e20b..8ed2f1b 100644 --- a/source/core/audio/audio.cpp +++ b/source/core/audio/audio.cpp @@ -41,7 +41,7 @@ void Audio::update() { } // Reproduce la música -void Audio::playMusic(const std::string& name, const int loop) { // NOLINT(readability-convert-member-functions-to-static) +void Audio::playMusic(const std::string& name, const int loop) { bool new_loop = (loop != 0); // Si ya está sonando exactamente la misma pista y mismo modo loop, no hacemos nada @@ -71,7 +71,7 @@ void Audio::playMusic(const std::string& name, const int loop) { // NOLINT(read } // Pausa la música -void Audio::pauseMusic() { // NOLINT(readability-convert-member-functions-to-static) +void Audio::pauseMusic() { if (music_enabled_ && music_.state == MusicState::PLAYING) { JA_PauseMusic(); music_.state = MusicState::PAUSED; @@ -79,7 +79,7 @@ void Audio::pauseMusic() { // NOLINT(readability-convert-member-functions-to-st } // Continua la música pausada -void Audio::resumeMusic() { // NOLINT(readability-convert-member-functions-to-static) +void Audio::resumeMusic() { if (music_enabled_ && music_.state == MusicState::PAUSED) { JA_ResumeMusic(); music_.state = MusicState::PLAYING; diff --git a/source/core/input/global_inputs.cpp b/source/core/input/global_inputs.cpp index e8537a1..429684a 100644 --- a/source/core/input/global_inputs.cpp +++ b/source/core/input/global_inputs.cpp @@ -29,7 +29,7 @@ namespace GlobalInputs { if (stringInVector(Notifier::get()->getCodes(), CODE)) { SceneManager::current = SceneManager::Scene::TITLE; } else { - Notifier::get()->show({Locale::get()->get("ui.press_again_menu")}, Notifier::Style::DEFAULT, -1, true, CODE); // NOLINT(readability-static-accessed-through-instance) + Notifier::get()->show({Locale::get()->get("ui.press_again_menu")}, Notifier::Style::DEFAULT, -1, true, CODE); } return; } @@ -49,7 +49,7 @@ namespace GlobalInputs { if (stringInVector(Notifier::get()->getCodes(), CODE)) { SceneManager::current = SceneManager::Scene::QUIT; } else { - Notifier::get()->show({Locale::get()->get("ui.press_again_exit")}, Notifier::Style::DEFAULT, -1, true, CODE); // NOLINT(readability-static-accessed-through-instance) + Notifier::get()->show({Locale::get()->get("ui.press_again_exit")}, Notifier::Style::DEFAULT, -1, true, CODE); } } @@ -67,29 +67,29 @@ namespace GlobalInputs { void handleToggleBorder() { Screen::get()->toggleBorder(); - Notifier::get()->show({Locale::get()->get(Options::video.border.enabled ? "ui.border_enabled" : "ui.border_disabled")}); // NOLINT(readability-static-accessed-through-instance) + Notifier::get()->show({Locale::get()->get(Options::video.border.enabled ? "ui.border_enabled" : "ui.border_disabled")}); } void handleToggleVideoMode() { Screen::get()->toggleVideoMode(); - Notifier::get()->show({Locale::get()->get(static_cast(Options::video.fullscreen) == 0 ? "ui.fullscreen_disabled" : "ui.fullscreen_enabled")}); // NOLINT(readability-static-accessed-through-instance) + Notifier::get()->show({Locale::get()->get(static_cast(Options::video.fullscreen) == 0 ? "ui.fullscreen_disabled" : "ui.fullscreen_enabled")}); } void handleDecWindowZoom() { if (Screen::get()->decWindowZoom()) { - Notifier::get()->show({Locale::get()->get("ui.window_zoom") + std::to_string(Options::window.zoom)}); // NOLINT(readability-static-accessed-through-instance) + Notifier::get()->show({Locale::get()->get("ui.window_zoom") + std::to_string(Options::window.zoom)}); } } void handleIncWindowZoom() { if (Screen::get()->incWindowZoom()) { - Notifier::get()->show({Locale::get()->get("ui.window_zoom") + std::to_string(Options::window.zoom)}); // NOLINT(readability-static-accessed-through-instance) + Notifier::get()->show({Locale::get()->get("ui.window_zoom") + std::to_string(Options::window.zoom)}); } } void handleToggleShaders() { Screen::get()->toggleShaders(); - Notifier::get()->show({Locale::get()->get(Options::video.shader.enabled ? "ui.shaders_enabled" : "ui.shaders_disabled")}); // NOLINT(readability-static-accessed-through-instance) + Notifier::get()->show({Locale::get()->get(Options::video.shader.enabled ? "ui.shaders_enabled" : "ui.shaders_disabled")}); } void handleNextShaderPreset() { @@ -97,47 +97,47 @@ namespace GlobalInputs { if (!Options::crtpi_presets.empty()) { Options::video.shader.current_crtpi_preset = (Options::video.shader.current_crtpi_preset + 1) % static_cast(Options::crtpi_presets.size()); Screen::get()->reloadCrtPi(); - Notifier::get()->show({Locale::get()->get("ui.crtpi") + " " + prettyName(Options::crtpi_presets[static_cast(Options::video.shader.current_crtpi_preset)].name)}); // NOLINT(readability-static-accessed-through-instance) + Notifier::get()->show({Locale::get()->get("ui.crtpi") + " " + prettyName(Options::crtpi_presets[static_cast(Options::video.shader.current_crtpi_preset)].name)}); } } else { if (!Options::postfx_presets.empty()) { Options::video.shader.current_postfx_preset = (Options::video.shader.current_postfx_preset + 1) % static_cast(Options::postfx_presets.size()); Screen::get()->reloadPostFX(); - Notifier::get()->show({Locale::get()->get("ui.postfx") + " " + prettyName(Options::postfx_presets[static_cast(Options::video.shader.current_postfx_preset)].name)}); // NOLINT(readability-static-accessed-through-instance) + Notifier::get()->show({Locale::get()->get("ui.postfx") + " " + prettyName(Options::postfx_presets[static_cast(Options::video.shader.current_postfx_preset)].name)}); } } } void handleNextShader() { Screen::get()->nextShader(); - Notifier::get()->show({Locale::get()->get("ui.shader") + " " + // NOLINT(readability-static-accessed-through-instance) + Notifier::get()->show({Locale::get()->get("ui.shader") + " " + (Options::video.shader.current_shader == Rendering::ShaderType::CRTPI ? "CRTPI" : "POSTFX")}); } void handleNextPalette() { Screen::get()->nextPalette(); - Notifier::get()->show({Locale::get()->get("ui.palette") + " " + toUpper(Screen::get()->getPalettePrettyName())}); // NOLINT(readability-static-accessed-through-instance) + Notifier::get()->show({Locale::get()->get("ui.palette") + " " + toUpper(Screen::get()->getPalettePrettyName())}); } void handlePreviousPalette() { Screen::get()->previousPalette(); - Notifier::get()->show({Locale::get()->get("ui.palette") + " " + toUpper(Screen::get()->getPalettePrettyName())}); // NOLINT(readability-static-accessed-through-instance) + Notifier::get()->show({Locale::get()->get("ui.palette") + " " + toUpper(Screen::get()->getPalettePrettyName())}); } void handleNextPaletteSortMode() { Screen::get()->nextPaletteSortMode(); - Notifier::get()->show({Locale::get()->get("ui.palette_sort") + " " + toUpper(Screen::get()->getPaletteSortModeName())}); // NOLINT(readability-static-accessed-through-instance) + Notifier::get()->show({Locale::get()->get("ui.palette_sort") + " " + toUpper(Screen::get()->getPaletteSortModeName())}); } void handleToggleIntegerScale() { Screen::get()->toggleIntegerScale(); Screen::get()->setVideoMode(Options::video.fullscreen); - Notifier::get()->show({Locale::get()->get(Options::video.integer_scale ? "ui.integer_scale_enabled" : "ui.integer_scale_disabled")}); // NOLINT(readability-static-accessed-through-instance) + Notifier::get()->show({Locale::get()->get(Options::video.integer_scale ? "ui.integer_scale_enabled" : "ui.integer_scale_disabled")}); } void handleToggleVSync() { Screen::get()->toggleVSync(); - Notifier::get()->show({Locale::get()->get(Options::video.vertical_sync ? "ui.vsync_enabled" : "ui.vsync_disabled")}); // NOLINT(readability-static-accessed-through-instance) + Notifier::get()->show({Locale::get()->get(Options::video.vertical_sync ? "ui.vsync_enabled" : "ui.vsync_disabled")}); } // Detecta qué acción global ha sido presionada (si alguna) diff --git a/source/core/input/input.cpp b/source/core/input/input.cpp index 4cb2b10..3c0c147 100644 --- a/source/core/input/input.cpp +++ b/source/core/input/input.cpp @@ -14,7 +14,7 @@ Input* Input::instance = nullptr; // Inicializa la instancia única del singleton -void Input::init(const std::string& game_controller_db_path) { // NOLINT(readability-convert-member-functions-to-static) +void Input::init(const std::string& game_controller_db_path) { Input::instance = new Input(game_controller_db_path); } @@ -71,7 +71,7 @@ void Input::applyKeyboardBindingsFromOptions() { } // Aplica configuración de botones del gamepad desde Options al primer gamepad conectado -void Input::applyGamepadBindingsFromOptions() { // NOLINT(readability-convert-member-functions-to-static) +void Input::applyGamepadBindingsFromOptions() { // Si no hay gamepads conectados, no hay nada que hacer if (gamepads_.empty()) { return; @@ -92,21 +92,21 @@ void Input::applyGamepadBindingsFromOptions() { // NOLINT(readability-convert-m } // Asigna inputs a botones del mando -void Input::bindGameControllerButton(const std::shared_ptr& gamepad, Action action, SDL_GamepadButton button) { // NOLINT(readability-convert-member-functions-to-static) +void Input::bindGameControllerButton(const std::shared_ptr& gamepad, Action action, SDL_GamepadButton button) { if (gamepad != nullptr) { gamepad->bindings[action].button = button; } } // Asigna inputs a botones del mando -void Input::bindGameControllerButton(const std::shared_ptr& gamepad, Action action_target, Action action_source) { // NOLINT(readability-convert-member-functions-to-static) +void Input::bindGameControllerButton(const std::shared_ptr& gamepad, Action action_target, Action action_source) { if (gamepad != nullptr) { gamepad->bindings[action_target].button = gamepad->bindings[action_source].button; } } // Comprueba si alguna acción está activa -auto Input::checkAction(Action action, bool repeat, bool check_keyboard, const std::shared_ptr& gamepad) -> bool { // NOLINT(readability-convert-member-functions-to-static) +auto Input::checkAction(Action action, bool repeat, bool check_keyboard, const std::shared_ptr& gamepad) -> bool { bool success_keyboard = false; bool success_controller = false; @@ -144,7 +144,7 @@ auto Input::checkAction(Action action, bool repeat, bool check_keyboard, const s } // Comprueba si hay almenos una acción activa -auto Input::checkAnyInput(bool check_keyboard, const std::shared_ptr& gamepad) -> bool { // NOLINT(readability-convert-member-functions-to-static) +auto Input::checkAnyInput(bool check_keyboard, const std::shared_ptr& gamepad) -> bool { // Obtenemos el número total de acciones posibles para iterar sobre ellas. // --- Comprobación del Teclado --- @@ -181,7 +181,7 @@ auto Input::checkAnyInput(bool check_keyboard, const std::shared_ptr& g } // Comprueba si hay algún botón pulsado -auto Input::checkAnyButton(bool repeat) -> bool { // NOLINT(readability-convert-member-functions-to-static) +auto Input::checkAnyButton(bool repeat) -> bool { // Solo comprueba los botones definidos previamente for (auto bi : BUTTON_INPUTS) { // Comprueba el teclado @@ -221,7 +221,7 @@ auto Input::getControllerNames() const -> std::vector { auto Input::getNumGamepads() const -> int { return gamepads_.size(); } // Obtiene el gamepad a partir de un event.id -auto Input::getGamepad(SDL_JoystickID id) const -> std::shared_ptr { // NOLINT(readability-convert-member-functions-to-static) +auto Input::getGamepad(SDL_JoystickID id) const -> std::shared_ptr { for (const auto& gamepad : gamepads_) { if (gamepad->instance_id == id) { return gamepad; @@ -230,7 +230,7 @@ auto Input::getGamepad(SDL_JoystickID id) const -> std::shared_ptr std::shared_ptr { // NOLINT(readability-convert-member-functions-to-static) +auto Input::getGamepadByName(const std::string& name) const -> std::shared_ptr { for (const auto& gamepad : gamepads_) { if (gamepad && gamepad->name == name) { return gamepad; @@ -240,12 +240,12 @@ auto Input::getGamepadByName(const std::string& name) const -> std::shared_ptr& gamepad, Action action) -> SDL_GamepadButton { // NOLINT(readability-convert-member-functions-to-static) +auto Input::getControllerBinding(const std::shared_ptr& gamepad, Action action) -> SDL_GamepadButton { return static_cast(gamepad->bindings[action].button); } // Comprueba el eje del mando -auto Input::checkAxisInput(Action action, const std::shared_ptr& gamepad, bool repeat) -> bool { // NOLINT(readability-convert-member-functions-to-static) +auto Input::checkAxisInput(Action action, const std::shared_ptr& gamepad, bool repeat) -> bool { // Obtener el binding configurado para esta acción auto& binding = gamepad->bindings[action]; @@ -288,7 +288,7 @@ auto Input::checkAxisInput(Action action, const std::shared_ptr& gamepa } // Comprueba los triggers del mando como botones digitales -auto Input::checkTriggerInput(Action action, const std::shared_ptr& gamepad, bool repeat) -> bool { // NOLINT(readability-convert-member-functions-to-static) +auto Input::checkTriggerInput(Action action, const std::shared_ptr& gamepad, bool repeat) -> bool { // Solo manejamos botones específicos que pueden ser triggers if (gamepad->bindings[action].button != static_cast(SDL_GAMEPAD_BUTTON_INVALID)) { // Solo procesamos L2 y R2 como triggers @@ -335,13 +335,13 @@ auto Input::checkTriggerInput(Action action, const std::shared_ptr& gam return false; } -void Input::addGamepadMappingsFromFile() { // NOLINT(readability-convert-member-functions-to-static) +void Input::addGamepadMappingsFromFile() { if (SDL_AddGamepadMappingsFromFile(gamepad_mappings_file_.c_str()) < 0) { std::cout << "Error, could not load " << gamepad_mappings_file_.c_str() << " file: " << SDL_GetError() << '\n'; } } -void Input::discoverGamepads() { // NOLINT(readability-convert-member-functions-to-static) +void Input::discoverGamepads() { SDL_Event event; while (SDL_PollEvent(&event)) { handleEvent(event); // Comprueba mandos conectados @@ -377,7 +377,7 @@ void Input::resetInputStates() { } } -void Input::update() { // NOLINT(readability-convert-member-functions-to-static) +void Input::update() { // --- TECLADO --- const bool* key_states = SDL_GetKeyboardState(nullptr); @@ -401,7 +401,7 @@ void Input::update() { // NOLINT(readability-convert-member-functions-to-static } } -auto Input::handleEvent(const SDL_Event& event) -> std::string { // NOLINT(readability-convert-member-functions-to-static) +auto Input::handleEvent(const SDL_Event& event) -> std::string { switch (event.type) { case SDL_EVENT_GAMEPAD_ADDED: return addGamepad(event.gdevice.which); @@ -412,7 +412,7 @@ auto Input::handleEvent(const SDL_Event& event) -> std::string { // NOLINT(read } } -auto Input::addGamepad(int device_index) -> std::string { // NOLINT(readability-convert-member-functions-to-static) +auto Input::addGamepad(int device_index) -> std::string { SDL_Gamepad* pad = SDL_OpenGamepad(device_index); if (pad == nullptr) { std::cerr << "Error al abrir el gamepad: " << SDL_GetError() << '\n'; @@ -426,7 +426,7 @@ auto Input::addGamepad(int device_index) -> std::string { // NOLINT(readability return name + " CONNECTED"; } -auto Input::removeGamepad(SDL_JoystickID id) -> std::string { // NOLINT(readability-convert-member-functions-to-static) +auto Input::removeGamepad(SDL_JoystickID id) -> std::string { auto it = std::ranges::find_if(gamepads_, [id](const std::shared_ptr& gamepad) -> bool { return gamepad->instance_id == id; }); @@ -441,7 +441,7 @@ auto Input::removeGamepad(SDL_JoystickID id) -> std::string { // NOLINT(readabi return {}; } -void Input::printConnectedGamepads() const { // NOLINT(readability-convert-member-functions-to-static) +void Input::printConnectedGamepads() const { if (gamepads_.empty()) { std::cout << "No hay gamepads conectados." << '\n'; return; @@ -455,7 +455,7 @@ void Input::printConnectedGamepads() const { // NOLINT(readability-convert-memb } } -auto Input::findAvailableGamepadByName(const std::string& gamepad_name) -> std::shared_ptr { // NOLINT(readability-convert-member-functions-to-static) +auto Input::findAvailableGamepadByName(const std::string& gamepad_name) -> std::shared_ptr { // Si no hay gamepads disponibles, devolver gamepad por defecto if (gamepads_.empty()) { return nullptr; diff --git a/source/core/locale/locale.cpp b/source/core/locale/locale.cpp index a5a340d..c6d3c3e 100644 --- a/source/core/locale/locale.cpp +++ b/source/core/locale/locale.cpp @@ -11,13 +11,13 @@ Locale* Locale::instance = nullptr; // [SINGLETON] Crea el objeto con esta función estática -void Locale::init(const std::string& file_path) { // NOLINT(readability-convert-member-functions-to-static) +void Locale::init(const std::string& file_path) { Locale::instance = new Locale(); Locale::instance->loadFromFile(file_path); } // [SINGLETON] Crea el objeto desde contenido en memoria (para release con pack) -void Locale::initFromContent(const std::string& content) { // NOLINT(readability-convert-member-functions-to-static) +void Locale::initFromContent(const std::string& content) { Locale::instance = new Locale(); Locale::instance->loadFromContent(content); } @@ -34,7 +34,7 @@ auto Locale::get() -> Locale* { } // Devuelve la traducción de la clave o la clave como fallback -auto Locale::get(const std::string& key) const -> std::string { // NOLINT(readability-convert-member-functions-to-static) +auto Locale::get(const std::string& key) const -> std::string { auto it = strings_.find(key); if (it != strings_.end()) { return it->second; @@ -45,7 +45,7 @@ auto Locale::get(const std::string& key) const -> std::string { // NOLINT(reada } // Aplana un nodo YAML de forma recursiva: {a: {b: "val"}} -> {"a.b" -> "val"} -void Locale::flatten(const void* node_ptr, const std::string& prefix) { // NOLINT(readability-convert-member-functions-to-static) +void Locale::flatten(const void* node_ptr, const std::string& prefix) { const auto& node = *static_cast(node_ptr); for (auto itr = node.begin(); itr != node.end(); ++itr) { @@ -63,7 +63,7 @@ void Locale::flatten(const void* node_ptr, const std::string& prefix) { // NOLI } // Carga las traducciones desde contenido YAML en memoria -void Locale::loadFromContent(const std::string& content) { // NOLINT(readability-convert-member-functions-to-static) +void Locale::loadFromContent(const std::string& content) { if (content.empty()) { std::cerr << "Locale: contenido vacío, sin traducciones cargadas\n"; return; @@ -81,7 +81,7 @@ void Locale::loadFromContent(const std::string& content) { // NOLINT(readabilit } // Carga las traducciones desde el fichero YAML indicado -void Locale::loadFromFile(const std::string& file_path) { // NOLINT(readability-convert-member-functions-to-static) +void Locale::loadFromFile(const std::string& file_path) { if (file_path.empty()) { std::cerr << "Locale: ruta de fichero vacía, sin traducciones cargadas\n"; return; diff --git a/source/core/rendering/gif.cpp b/source/core/rendering/gif.cpp index 5fb3bc1..0b5c8c1 100644 --- a/source/core/rendering/gif.cpp +++ b/source/core/rendering/gif.cpp @@ -90,7 +90,7 @@ namespace GIF { return match_len; } - void Gif::decompress(int code_length, const uint8_t* input, int input_length, uint8_t* out) { // NOLINT(readability-convert-member-functions-to-static) + void Gif::decompress(int code_length, const uint8_t* input, int input_length, uint8_t* out) { // Verifica que el code_length tenga un rango razonable. if (code_length < 2 || code_length > 12) { throw std::runtime_error("Invalid LZW code length"); @@ -146,7 +146,7 @@ namespace GIF { } } - auto Gif::readSubBlocks(const uint8_t*& buffer) -> std::vector { // NOLINT(readability-convert-member-functions-to-static) + auto Gif::readSubBlocks(const uint8_t*& buffer) -> std::vector { std::vector data; uint8_t block_size = *buffer; buffer++; @@ -159,7 +159,7 @@ namespace GIF { return data; } - auto Gif::processImageDescriptor(const uint8_t*& buffer, const std::vector& gct, int resolution_bits) -> std::vector { // NOLINT(readability-convert-member-functions-to-static) + auto Gif::processImageDescriptor(const uint8_t*& buffer, const std::vector& gct, int resolution_bits) -> std::vector { ImageDescriptor image_descriptor; // Lee 9 bytes para el image descriptor. readBytes(buffer, &image_descriptor, sizeof(ImageDescriptor)); @@ -175,7 +175,7 @@ namespace GIF { return uncompressed_data; } - auto Gif::loadPalette(const uint8_t* buffer) -> std::vector { // NOLINT(readability-convert-member-functions-to-static) + auto Gif::loadPalette(const uint8_t* buffer) -> std::vector { uint8_t header[6]; std::memcpy(header, buffer, 6); buffer += 6; @@ -199,7 +199,7 @@ namespace GIF { return global_color_table; } - auto Gif::processGifStream(const uint8_t* buffer, uint16_t& w, uint16_t& h) -> std::vector { // NOLINT(readability-convert-member-functions-to-static) + auto Gif::processGifStream(const uint8_t* buffer, uint16_t& w, uint16_t& h) -> std::vector { // Leer la cabecera de 6 bytes ("GIF87a" o "GIF89a") uint8_t header[6]; std::memcpy(header, buffer, 6); diff --git a/source/core/rendering/screen.cpp b/source/core/rendering/screen.cpp index 08ea88e..8367938 100644 --- a/source/core/rendering/screen.cpp +++ b/source/core/rendering/screen.cpp @@ -373,7 +373,7 @@ void Screen::nextPalette() { palette_manager_->next(); } void Screen::previousPalette() { palette_manager_->previous(); } // Copia la surface a la textura -void Screen::surfaceToTexture() { // NOLINT(readability-convert-member-functions-to-static) +void Screen::surfaceToTexture() { if (Options::video.border.enabled) { border_surface_->copyToTexture(renderer_, border_texture_); game_surface_->copyToTexture(renderer_, border_texture_, nullptr, &game_surface_dstrect_); @@ -536,7 +536,7 @@ void Screen::toggleSupersampling() { } // Aplica los parámetros del preset actual al backend de shaders -void Screen::applyCurrentPostFXPreset() { // NOLINT(readability-convert-member-functions-to-static) +void Screen::applyCurrentPostFXPreset() { if (shader_backend_ && !Options::postfx_presets.empty()) { const auto& p = Options::postfx_presets[static_cast(Options::video.shader.current_postfx_preset)]; // Supersampling es un toggle global (Options::video.supersampling.enabled), no por preset. @@ -549,7 +549,7 @@ void Screen::applyCurrentPostFXPreset() { // NOLINT(readability-convert-member- } // Aplica los parámetros del preset CrtPi actual al backend de shaders -void Screen::applyCurrentCrtPiPreset() { // NOLINT(readability-convert-member-functions-to-static) +void Screen::applyCurrentCrtPiPreset() { if (shader_backend_ && !Options::crtpi_presets.empty()) { const auto& p = Options::crtpi_presets[static_cast(Options::video.shader.current_crtpi_preset)]; Rendering::CrtPiParams params{ @@ -633,7 +633,7 @@ void Screen::initShaders() { } // Obtiene información sobre la pantalla -void Screen::getDisplayInfo() { // NOLINT(readability-convert-member-functions-to-static) +void Screen::getDisplayInfo() { std::cout << "\n** VIDEO SYSTEM **\n"; int num_displays = 0; @@ -738,7 +738,7 @@ auto Screen::initSDLVideo() -> bool { } // Crea el objeto de texto -void Screen::createText() { // NOLINT(readability-convert-member-functions-to-static) +void Screen::createText() { // Carga la surface de la fuente directamente del archivo auto surface = std::make_shared(Resource::List::get()->get("aseprite.gif")); diff --git a/source/core/rendering/sdl3gpu/sdl3gpu_shader.cpp b/source/core/rendering/sdl3gpu/sdl3gpu_shader.cpp index ab401ba..81b020b 100644 --- a/source/core/rendering/sdl3gpu/sdl3gpu_shader.cpp +++ b/source/core/rendering/sdl3gpu/sdl3gpu_shader.cpp @@ -1090,7 +1090,7 @@ namespace Rendering { return shader; } - auto SDL3GPUShader::createShaderSPIRV(SDL_GPUDevice* device, // NOLINT(readability-convert-member-functions-to-static) + auto SDL3GPUShader::createShaderSPIRV(SDL_GPUDevice* device, const uint8_t* spv_code, size_t spv_size, const char* entrypoint, diff --git a/source/core/rendering/sprite/animated_sprite.cpp b/source/core/rendering/sprite/animated_sprite.cpp index f27b702..1f7b800 100644 --- a/source/core/rendering/sprite/animated_sprite.cpp +++ b/source/core/rendering/sprite/animated_sprite.cpp @@ -147,7 +147,7 @@ void AnimatedSprite::buildNameIndex() { } // Calcula el frame correspondiente a la animación (time-based) -void AnimatedSprite::animate(float delta_time) { // NOLINT(readability-convert-member-functions-to-static) +void AnimatedSprite::animate(float delta_time) { if (animations_.empty()) { return; } auto& anim = animations_[current_animation_]; if (anim.speeds.empty()) { return; } // Animación estática diff --git a/source/core/rendering/surface.cpp b/source/core/rendering/surface.cpp index a20066e..f5a25bb 100644 --- a/source/core/rendering/surface.cpp +++ b/source/core/rendering/surface.cpp @@ -104,7 +104,7 @@ Surface::Surface(const std::string& file_path) } // Carga una superficie desde un archivo -auto Surface::loadSurface(const std::string& file_path) -> SurfaceData { // NOLINT(readability-convert-member-functions-to-static) +auto Surface::loadSurface(const std::string& file_path) -> SurfaceData { // Load file using ResourceHelper (supports both filesystem and pack) std::vector buffer = Resource::Helper::loadFile(file_path); if (buffer.empty()) { @@ -148,14 +148,14 @@ void Surface::setColor(int index, Uint32 color) { } // Rellena la superficie con un color -void Surface::clear(Uint8 color) { // NOLINT(readability-convert-member-functions-to-static) +void Surface::clear(Uint8 color) { const size_t TOTAL_PIXELS = surface_data_->width * surface_data_->height; Uint8* data_ptr = surface_data_->data.get(); std::fill(data_ptr, data_ptr + TOTAL_PIXELS, color); } // Pone un pixel en la SurfaceData -void Surface::putPixel(int x, int y, Uint8 color) { // NOLINT(readability-convert-member-functions-to-static) +void Surface::putPixel(int x, int y, Uint8 color) { if (x < 0 || y < 0 || x >= surface_data_->width || y >= surface_data_->height) { return; // Coordenadas fuera de rango } @@ -168,7 +168,7 @@ void Surface::putPixel(int x, int y, Uint8 color) { // NOLINT(readability-conve auto Surface::getPixel(int x, int y) -> Uint8 { return surface_data_->data.get()[x + (y * static_cast(surface_data_->width))]; } // Dibuja un rectangulo relleno -void Surface::fillRect(const SDL_FRect* rect, Uint8 color) { // NOLINT(readability-convert-member-functions-to-static) +void Surface::fillRect(const SDL_FRect* rect, Uint8 color) { // Limitar los valores del rectángulo al tamaño de la superficie float x_start = std::max(0.0F, rect->x); float y_start = std::max(0.0F, rect->y); @@ -185,7 +185,7 @@ void Surface::fillRect(const SDL_FRect* rect, Uint8 color) { // NOLINT(readabil } // Dibuja el borde de un rectangulo -void Surface::drawRectBorder(const SDL_FRect* rect, Uint8 color) { // NOLINT(readability-convert-member-functions-to-static) +void Surface::drawRectBorder(const SDL_FRect* rect, Uint8 color) { // Limitar los valores del rectángulo al tamaño de la superficie float x_start = std::max(0.0F, rect->x); float y_start = std::max(0.0F, rect->y); @@ -212,7 +212,7 @@ void Surface::drawRectBorder(const SDL_FRect* rect, Uint8 color) { // NOLINT(re } // Dibuja una linea -void Surface::drawLine(float x1, float y1, float x2, float y2, Uint8 color) { // NOLINT(readability-convert-member-functions-to-static) +void Surface::drawLine(float x1, float y1, float x2, float y2, Uint8 color) { // Calcula las diferencias float dx = std::abs(x2 - x1); float dy = std::abs(y2 - y1); @@ -573,7 +573,7 @@ void Surface::toARGBBuffer(Uint32* buffer) const { } // Vuelca la superficie a una textura -void Surface::copyToTexture(SDL_Renderer* renderer, SDL_Texture* texture) { // NOLINT(readability-convert-member-functions-to-static) +void Surface::copyToTexture(SDL_Renderer* renderer, SDL_Texture* texture) { if ((renderer == nullptr) || (texture == nullptr) || !surface_data_) { throw std::runtime_error("Renderer or texture is null."); } @@ -615,7 +615,7 @@ void Surface::copyToTexture(SDL_Renderer* renderer, SDL_Texture* texture) { // } // Vuelca la superficie a una textura -void Surface::copyToTexture(SDL_Renderer* renderer, SDL_Texture* texture, SDL_FRect* src_rect, SDL_FRect* dest_rect) { // NOLINT(readability-convert-member-functions-to-static) +void Surface::copyToTexture(SDL_Renderer* renderer, SDL_Texture* texture, SDL_FRect* src_rect, SDL_FRect* dest_rect) { if ((renderer == nullptr) || (texture == nullptr) || !surface_data_) { throw std::runtime_error("Renderer or texture is null."); } @@ -664,7 +664,7 @@ void Surface::copyToTexture(SDL_Renderer* renderer, SDL_Texture* texture, SDL_FR } // Realiza un efecto de fundido en la paleta principal -auto Surface::fadePalette() -> bool { // NOLINT(readability-convert-member-functions-to-static) +auto Surface::fadePalette() -> bool { // Verificar que el tamaño mínimo de palette_ sea adecuado static constexpr int PALETTE_SIZE = 19; if (sizeof(palette_) / sizeof(palette_[0]) < PALETTE_SIZE) { @@ -684,7 +684,7 @@ auto Surface::fadePalette() -> bool { // NOLINT(readability-convert-member-func } // Realiza un efecto de fundido en la paleta secundaria -auto Surface::fadeSubPalette(Uint32 delay) -> bool { // NOLINT(readability-convert-member-functions-to-static) +auto Surface::fadeSubPalette(Uint32 delay) -> bool { // Variable estática para almacenar el último tick static Uint32 last_tick_ = 0; @@ -718,4 +718,4 @@ auto Surface::fadeSubPalette(Uint32 delay) -> bool { // NOLINT(readability-conv } // Restaura la sub paleta a su estado original -void Surface::resetSubPalette() { initializeSubPalette(sub_palette_); } // NOLINT(readability-convert-member-functions-to-static) +void Surface::resetSubPalette() { initializeSubPalette(sub_palette_); } diff --git a/source/core/rendering/text.cpp b/source/core/rendering/text.cpp index 2ffd572..20540a6 100644 --- a/source/core/rendering/text.cpp +++ b/source/core/rendering/text.cpp @@ -14,7 +14,7 @@ #include "utils/utils.hpp" // Para getFileName, stringToColor, printWithDots // Extrae el siguiente codepoint UTF-8 de la cadena, avanzando 'pos' al byte siguiente -auto Text::nextCodepoint(const std::string& s, size_t& pos) -> uint32_t { // NOLINT(readability-convert-member-functions-to-static) +auto Text::nextCodepoint(const std::string& s, size_t& pos) -> uint32_t { auto c = static_cast(s[pos]); uint32_t cp = 0; size_t extra = 0; @@ -47,7 +47,7 @@ auto Text::nextCodepoint(const std::string& s, size_t& pos) -> uint32_t { // NO } // Convierte un codepoint Unicode a una cadena UTF-8 -auto Text::codepointToUtf8(uint32_t cp) -> std::string { // NOLINT(readability-convert-member-functions-to-static) +auto Text::codepointToUtf8(uint32_t cp) -> std::string { std::string result; if (cp < 0x80) { result += static_cast(cp); @@ -69,7 +69,7 @@ auto Text::codepointToUtf8(uint32_t cp) -> std::string { // NOLINT(readability- // Carga un fichero de definición de fuente .fnt // Formato: líneas "clave valor", comentarios con #, gliphos como "codepoint ancho" -auto Text::loadTextFile(const std::string& file_path) -> std::shared_ptr { // NOLINT(readability-convert-member-functions-to-static) +auto Text::loadTextFile(const std::string& file_path) -> std::shared_ptr { auto tf = std::make_shared(); auto file_data = Resource::Helper::loadFile(file_path); @@ -145,7 +145,7 @@ Text::Text(const std::shared_ptr& surface, const std::shared_ptr& } // Escribe texto en pantalla -void Text::write(int x, int y, const std::string& text, int kerning, int lenght) { // NOLINT(readability-convert-member-functions-to-static) +void Text::write(int x, int y, const std::string& text, int kerning, int lenght) { int shift = 0; int glyphs_done = 0; size_t pos = 0; @@ -195,7 +195,7 @@ auto Text::writeDXToSurface(Uint8 flags, const std::string& text, int kerning, U } // Escribe el texto con colores -void Text::writeColored(int x, int y, const std::string& text, Uint8 color, int kerning, int lenght) { // NOLINT(readability-convert-member-functions-to-static) +void Text::writeColored(int x, int y, const std::string& text, Uint8 color, int kerning, int lenght) { int shift = 0; int glyphs_done = 0; size_t pos = 0; @@ -217,7 +217,7 @@ void Text::writeColored(int x, int y, const std::string& text, Uint8 color, int } // Escribe texto monoespaciado con color (cada glifo centrado en una celda de ancho fijo) -void Text::writeColoredMono(int x, int y, const std::string& text, Uint8 color, int cell_w) { // NOLINT(readability-convert-member-functions-to-static) +void Text::writeColoredMono(int x, int y, const std::string& text, Uint8 color, int cell_w) { int shift = 0; size_t pos = 0; @@ -260,7 +260,7 @@ void Text::writeCentered(int x, int y, const std::string& text, int kerning, int } // Escribe texto con extras -void Text::writeDX(Uint8 flags, int x, int y, const std::string& text, int kerning, Uint8 text_color, Uint8 shadow_distance, Uint8 shadow_color, int lenght) { // NOLINT(readability-convert-member-functions-to-static) +void Text::writeDX(Uint8 flags, int x, int y, const std::string& text, int kerning, Uint8 text_color, Uint8 shadow_distance, Uint8 shadow_color, int lenght) { const auto CENTERED = ((flags & CENTER_FLAG) == CENTER_FLAG); const auto SHADOWED = ((flags & SHADOW_FLAG) == SHADOW_FLAG); const auto COLORED = ((flags & COLOR_FLAG) == COLOR_FLAG); @@ -293,7 +293,7 @@ void Text::writeDX(Uint8 flags, int x, int y, const std::string& text, int kerni } // Obtiene la longitud en pixels de una cadena UTF-8 -auto Text::length(const std::string& text, int kerning) const -> int { // NOLINT(readability-convert-member-functions-to-static) +auto Text::length(const std::string& text, int kerning) const -> int { int shift = 0; size_t pos = 0; @@ -310,7 +310,7 @@ auto Text::length(const std::string& text, int kerning) const -> int { // NOLIN } // Devuelve el ancho en pixels de un glifo dado su codepoint Unicode -auto Text::glyphWidth(uint32_t codepoint, int kerning) const -> int { // NOLINT(readability-convert-member-functions-to-static) +auto Text::glyphWidth(uint32_t codepoint, int kerning) const -> int { auto it = offset_.find(codepoint); if (it == offset_.end()) { it = offset_.find('?'); } if (it != offset_.end()) { return it->second.w + kerning; } diff --git a/source/core/resources/resource_cache.cpp b/source/core/resources/resource_cache.cpp index 5685162..efafb0a 100644 --- a/source/core/resources/resource_cache.cpp +++ b/source/core/resources/resource_cache.cpp @@ -163,7 +163,7 @@ namespace Resource { } // Obtiene el objeto de texto a partir de un nombre - auto Cache::getText(const std::string& name) -> std::shared_ptr { // NOLINT(readability-convert-member-functions-to-static) + auto Cache::getText(const std::string& name) -> std::shared_ptr { auto it = std::ranges::find_if(texts_, [&name](const auto& t) -> bool { return t.name == name; }); if (it != texts_.end()) { @@ -243,7 +243,7 @@ namespace Resource { } // Helper para lanzar errores de carga con formato consistente - [[noreturn]] void Cache::throwLoadError(const std::string& asset_type, const std::string& file_path, const std::exception& e) { // NOLINT(readability-convert-member-functions-to-static) + [[noreturn]] void Cache::throwLoadError(const std::string& asset_type, const std::string& file_path, const std::exception& e) { std::cerr << "\n[ ERROR ] Failed to load " << asset_type << ": " << getFileName(file_path) << '\n'; std::cerr << "[ ERROR ] Path: " << file_path << '\n'; std::cerr << "[ ERROR ] Reason: " << e.what() << '\n'; @@ -253,7 +253,7 @@ namespace Resource { } // Carga los sonidos - void Cache::loadSounds() { // NOLINT(readability-convert-member-functions-to-static) + void Cache::loadSounds() { std::cout << "\n>> SOUND FILES" << '\n'; auto list = List::get()->getListByType(List::Type::SOUND); sounds_.clear(); @@ -288,7 +288,7 @@ namespace Resource { } // Carga las musicas - void Cache::loadMusics() { // NOLINT(readability-convert-member-functions-to-static) + void Cache::loadMusics() { std::cout << "\n>> MUSIC FILES" << '\n'; auto list = List::get()->getListByType(List::Type::MUSIC); musics_.clear(); @@ -323,7 +323,7 @@ namespace Resource { } // Carga las texturas - void Cache::loadSurfaces() { // NOLINT(readability-convert-member-functions-to-static) + void Cache::loadSurfaces() { std::cout << "\n>> SURFACES" << '\n'; auto list = List::get()->getListByType(List::Type::BITMAP); surfaces_.clear(); @@ -347,7 +347,7 @@ namespace Resource { } // Carga las paletas - void Cache::loadPalettes() { // NOLINT(readability-convert-member-functions-to-static) + void Cache::loadPalettes() { std::cout << "\n>> PALETTES" << '\n'; auto list = List::get()->getListByType(List::Type::PALETTE); palettes_.clear(); @@ -364,7 +364,7 @@ namespace Resource { } // Carga los ficheros de texto - void Cache::loadTextFiles() { // NOLINT(readability-convert-member-functions-to-static) + void Cache::loadTextFiles() { std::cout << "\n>> TEXT FILES" << '\n'; auto list = List::get()->getListByType(List::Type::FONT); text_files_.clear(); @@ -381,7 +381,7 @@ namespace Resource { } // Carga las animaciones - void Cache::loadAnimations() { // NOLINT(readability-convert-member-functions-to-static) + void Cache::loadAnimations() { std::cout << "\n>> ANIMATIONS" << '\n'; auto list = List::get()->getListByType(List::Type::ANIMATION); animations_.clear(); @@ -407,7 +407,7 @@ namespace Resource { } // Carga las habitaciones desde archivos YAML - void Cache::loadRooms() { // NOLINT(readability-convert-member-functions-to-static) + void Cache::loadRooms() { std::cout << "\n>> ROOMS" << '\n'; auto list = List::get()->getListByType(List::Type::ROOM); rooms_.clear(); @@ -424,7 +424,7 @@ namespace Resource { } } - void Cache::createText() { // NOLINT(readability-convert-member-functions-to-static) + void Cache::createText() { struct ResourceInfo { std::string key; // Identificador del recurso std::string texture_file; // Nombre del archivo de textura diff --git a/source/core/resources/resource_list.cpp b/source/core/resources/resource_list.cpp index d06e703..084bfed 100644 --- a/source/core/resources/resource_list.cpp +++ b/source/core/resources/resource_list.cpp @@ -19,11 +19,11 @@ namespace Resource { // Singleton List* List::instance = nullptr; - void List::init(const std::string& executable_path) { // NOLINT(readability-convert-member-functions-to-static) + void List::init(const std::string& executable_path) { List::instance = new List(executable_path); } - void List::destroy() { // NOLINT(readability-convert-member-functions-to-static) + void List::destroy() { delete List::instance; } @@ -32,7 +32,7 @@ namespace Resource { } // Añade un elemento al mapa (función auxiliar) - void List::addToMap(const std::string& file_path, Type type, bool required, bool absolute) { // NOLINT(readability-convert-member-functions-to-static) + void List::addToMap(const std::string& file_path, Type type, bool required, bool absolute) { std::string full_path = absolute ? file_path : executable_path_ + file_path; std::string filename = getFileName(full_path); @@ -138,7 +138,7 @@ namespace Resource { } // Carga recursos desde un archivo de configuración con soporte para variables - void List::loadFromFile(const std::string& config_file_path, const std::string& prefix, const std::string& system_folder) { // NOLINT(readability-convert-member-functions-to-static) + void List::loadFromFile(const std::string& config_file_path, const std::string& prefix, const std::string& system_folder) { config_file_path_ = config_file_path; prefix_ = prefix; @@ -282,7 +282,7 @@ namespace Resource { } // Devuelve la ruta completa a un fichero (búsqueda O(1)) - auto List::get(const std::string& filename) const -> std::string { // NOLINT(readability-convert-member-functions-to-static) + auto List::get(const std::string& filename) const -> std::string { auto it = file_list_.find(filename); if (it != file_list_.end()) { return it->second.file; @@ -293,7 +293,7 @@ namespace Resource { } // Carga datos del archivo - auto List::loadData(const std::string& filename) const -> std::vector { // NOLINT(readability-convert-member-functions-to-static) + auto List::loadData(const std::string& filename) const -> std::vector { auto it = file_list_.find(filename); if (it != file_list_.end()) { std::ifstream file(it->second.file, std::ios::binary); @@ -327,7 +327,7 @@ namespace Resource { } // Parsea string a Type - auto List::parseAssetType(const std::string& type_str) -> Type { // NOLINT(readability-convert-member-functions-to-static) + auto List::parseAssetType(const std::string& type_str) -> Type { if (type_str == "DATA") { return Type::DATA; } @@ -361,7 +361,7 @@ namespace Resource { } // Devuelve el nombre del tipo de recurso - auto List::getTypeName(Type type) -> std::string { // NOLINT(readability-convert-member-functions-to-static) + auto List::getTypeName(Type type) -> std::string { switch (type) { case Type::DATA: return "DATA"; @@ -385,7 +385,7 @@ namespace Resource { } // Devuelve la lista de recursos de un tipo - auto List::getListByType(Type type) const -> std::vector { // NOLINT(readability-convert-member-functions-to-static) + auto List::getListByType(Type type) const -> std::vector { std::vector list; for (const auto& [filename, item] : file_list_) { @@ -401,7 +401,7 @@ namespace Resource { } // Reemplaza variables en las rutas - auto List::replaceVariables(const std::string& path, const std::string& prefix, const std::string& system_folder) -> std::string { // NOLINT(readability-convert-member-functions-to-static) + auto List::replaceVariables(const std::string& path, const std::string& prefix, const std::string& system_folder) -> std::string { std::string result = path; // Reemplazar ${PREFIX} @@ -422,7 +422,7 @@ namespace Resource { } // Parsea las opciones de una línea de configuración - auto List::parseOptions(const std::string& options, bool& required, bool& absolute) -> void { // NOLINT(readability-convert-member-functions-to-static) + auto List::parseOptions(const std::string& options, bool& required, bool& absolute) -> void { if (options.empty()) { return; } diff --git a/source/core/resources/resource_loader.cpp b/source/core/resources/resource_loader.cpp index da9d88b..f56a4e6 100644 --- a/source/core/resources/resource_loader.cpp +++ b/source/core/resources/resource_loader.cpp @@ -107,7 +107,7 @@ namespace Resource { } // Get pack statistics - auto Loader::getPackResourceCount() const -> size_t { // NOLINT(readability-convert-member-functions-to-static) + auto Loader::getPackResourceCount() const -> size_t { if (resource_pack_ && resource_pack_->isLoaded()) { return resource_pack_->getResourceCount(); } @@ -122,7 +122,7 @@ namespace Resource { } // Load from filesystem - auto Loader::loadFromFilesystem(const std::string& filepath) // NOLINT(readability-convert-member-functions-to-static) + auto Loader::loadFromFilesystem(const std::string& filepath) -> std::vector { std::ifstream file(filepath, std::ios::binary | std::ios::ate); if (!file) { @@ -147,7 +147,7 @@ namespace Resource { } // Validate pack integrity - auto Loader::validatePack() const -> bool { // NOLINT(readability-convert-member-functions-to-static) + auto Loader::validatePack() const -> bool { if (!initialized_ || !resource_pack_ || !resource_pack_->isLoaded()) { std::cerr << "Loader: Cannot validate - pack not loaded\n"; return false; @@ -168,7 +168,7 @@ namespace Resource { } // Load assets.yaml from pack - auto Loader::loadAssetsConfig() const -> std::string { // NOLINT(readability-convert-member-functions-to-static) + auto Loader::loadAssetsConfig() const -> std::string { if (!initialized_ || !resource_pack_ || !resource_pack_->isLoaded()) { std::cerr << "Loader: Cannot load assets config - pack not loaded\n"; return ""; diff --git a/source/core/resources/resource_pack.cpp b/source/core/resources/resource_pack.cpp index 339e7d6..aa510e6 100644 --- a/source/core/resources/resource_pack.cpp +++ b/source/core/resources/resource_pack.cpp @@ -13,7 +13,7 @@ namespace Resource { // Calculate CRC32 checksum for data verification - auto Pack::calculateChecksum(const std::vector& data) -> uint32_t { // NOLINT(readability-convert-member-functions-to-static) + auto Pack::calculateChecksum(const std::vector& data) -> uint32_t { uint32_t checksum = 0x12345678; for (unsigned char byte : data) { checksum = ((checksum << 5) + checksum) + byte; @@ -37,7 +37,7 @@ namespace Resource { } // Read entire file into memory - auto Pack::readFile(const std::string& filepath) -> std::vector { // NOLINT(readability-convert-member-functions-to-static) + auto Pack::readFile(const std::string& filepath) -> std::vector { std::ifstream file(filepath, std::ios::binary | std::ios::ate); if (!file) { std::cerr << "ResourcePack: Failed to open file: " << filepath << '\n'; @@ -57,7 +57,7 @@ namespace Resource { } // Add a single file to the pack - auto Pack::addFile(const std::string& filepath, const std::string& pack_name) // NOLINT(readability-convert-member-functions-to-static) + auto Pack::addFile(const std::string& filepath, const std::string& pack_name) -> bool { auto file_data = readFile(filepath); if (file_data.empty()) { @@ -80,7 +80,7 @@ namespace Resource { } // Add all files from a directory recursively - auto Pack::addDirectory(const std::string& dir_path, // NOLINT(readability-convert-member-functions-to-static) + auto Pack::addDirectory(const std::string& dir_path, const std::string& base_path) -> bool { namespace fs = std::filesystem; // NOLINT(readability-identifier-naming) @@ -117,7 +117,7 @@ namespace Resource { } // Save the pack to a file - auto Pack::savePack(const std::string& pack_file) -> bool { // NOLINT(readability-convert-member-functions-to-static) + auto Pack::savePack(const std::string& pack_file) -> bool { std::ofstream file(pack_file, std::ios::binary); if (!file) { std::cerr << "ResourcePack: Failed to create pack file: " << pack_file << '\n'; @@ -229,7 +229,7 @@ namespace Resource { } // Get a resource by name - auto Pack::getResource(const std::string& filename) -> std::vector { // NOLINT(readability-convert-member-functions-to-static) + auto Pack::getResource(const std::string& filename) -> std::vector { auto it = resources_.find(filename); if (it == resources_.end()) { return {}; @@ -263,7 +263,7 @@ namespace Resource { } // Get list of all resources - auto Pack::getResourceList() const -> std::vector { // NOLINT(readability-convert-member-functions-to-static) + auto Pack::getResourceList() const -> std::vector { std::vector list; list.reserve(resources_.size()); for (const auto& [name, entry] : resources_) { @@ -274,7 +274,7 @@ namespace Resource { } // Calculate overall pack checksum for validation - auto Pack::calculatePackChecksum() const -> uint32_t { // NOLINT(readability-convert-member-functions-to-static) + auto Pack::calculatePackChecksum() const -> uint32_t { if (!loaded_ || data_.empty()) { return 0; } diff --git a/source/core/system/director.cpp b/source/core/system/director.cpp index adf9c78..d99ca24 100644 --- a/source/core/system/director.cpp +++ b/source/core/system/director.cpp @@ -135,15 +135,15 @@ Director::Director() { #endif // Configura la ruta y carga las opciones desde un fichero - Options::setConfigFile(Resource::List::get()->get("config.yaml")); // NOLINT(readability-static-accessed-through-instance) + Options::setConfigFile(Resource::List::get()->get("config.yaml")); Options::loadFromFile(); // Configura la ruta y carga los presets de PostFX - Options::setPostFXFile(Resource::List::get()->get("postfx.yaml")); // NOLINT(readability-static-accessed-through-instance) + Options::setPostFXFile(Resource::List::get()->get("postfx.yaml")); Options::loadPostFXFromFile(); // Configura la ruta y carga los presets del shader CrtPi - Options::setCrtPiFile(Resource::List::get()->get("crtpi.yaml")); // NOLINT(readability-static-accessed-through-instance) + Options::setCrtPiFile(Resource::List::get()->get("crtpi.yaml")); Options::loadCrtPiFromFile(); // En mode quiosc, forçar pantalla completa independentment de la configuració @@ -193,7 +193,7 @@ Director::Director() { Input::init(gamecontroller_db); #else // In development, use Asset as normal - Input::init(Resource::List::get()->get("gamecontrollerdb.txt")); // NOLINT(readability-static-accessed-through-instance) Carga configuración de controles + Input::init(Resource::List::get()->get("gamecontrollerdb.txt")); // Carga configuración de controles #endif // Aplica las teclas y botones del gamepad configurados desde Options @@ -211,13 +211,13 @@ Director::Director() { #ifdef RELEASE_BUILD { // En release el locale está en el pack, no en el filesystem - std::string locale_key = Resource::List::get()->get(Options::language + ".yaml"); // NOLINT(readability-static-accessed-through-instance) + std::string locale_key = Resource::List::get()->get(Options::language + ".yaml"); auto locale_bytes = Resource::Helper::loadFile(locale_key); std::string locale_content(locale_bytes.begin(), locale_bytes.end()); Locale::initFromContent(locale_content); } #else - Locale::init(Resource::List::get()->get(Options::language + ".yaml")); // NOLINT(readability-static-accessed-through-instance) + Locale::init(Resource::List::get()->get(Options::language + ".yaml")); #endif // Special handling for cheevos.bin - also needs filesystem path @@ -257,7 +257,7 @@ Director::~Director() { } // Crea la carpeta del sistema donde guardar datos -void Director::createSystemFolder(const std::string& folder) { // NOLINT(readability-convert-member-functions-to-static) +void Director::createSystemFolder(const std::string& folder) { #ifdef _WIN32 system_folder_ = std::string(getenv("APPDATA")) + "/" + folder; #elif __APPLE__ @@ -312,7 +312,7 @@ void Director::createSystemFolder(const std::string& folder) { // NOLINT(readab } // Carga la configuración de assets desde assets.yaml -void Director::setFileList() { // NOLINT(readability-convert-member-functions-to-static) +void Director::setFileList() { // Determinar el prefijo de ruta según la plataforma #ifdef MACOS_BUNDLE const std::string PREFIX = "/../Resources"; diff --git a/source/game/entities/item.cpp b/source/game/entities/item.cpp index dee3159..0dd3ab2 100644 --- a/source/game/entities/item.cpp +++ b/source/game/entities/item.cpp @@ -29,14 +29,14 @@ void Item::update(float delta_time) { } // Pinta el objeto en pantalla -void Item::render() const { // NOLINT(readability-convert-member-functions-to-static) +void Item::render() const { // Calcula el índice de color basado en el tiempo acumulado const int INDEX = static_cast(time_accumulator_ / COLOR_CHANGE_INTERVAL) % static_cast(color_.size()); sprite_->render(1, color_.at(INDEX)); } // Obtiene su ubicación -auto Item::getPos() -> SDL_FPoint { // NOLINT(readability-convert-member-functions-to-static) +auto Item::getPos() -> SDL_FPoint { const SDL_FPoint P = {.x = sprite_->getX(), .y = sprite_->getY()}; return P; } diff --git a/source/game/entities/player.cpp b/source/game/entities/player.cpp index 9cdce47..b17b582 100644 --- a/source/game/entities/player.cpp +++ b/source/game/entities/player.cpp @@ -637,7 +637,7 @@ auto Player::skinToAnimationPath(const std::string& skin_name) -> std::string { // Inicialización // ============================================================================ -void Player::initSprite(const std::string& animations_path) { // NOLINT(readability-convert-member-functions-to-static) +void Player::initSprite(const std::string& animations_path) { const auto& animation_data = Resource::Cache::get()->getAnimationData(animations_path); sprite_ = std::make_unique(animation_data); sprite_->setWidth(WIDTH); @@ -645,7 +645,7 @@ void Player::initSprite(const std::string& animations_path) { // NOLINT(readabi sprite_->setCurrentAnimation("walk"); } -void Player::initSounds() { // NOLINT(readability-convert-member-functions-to-static) +void Player::initSounds() { jump_sound_ = Resource::Cache::get()->getSound(Defaults::Sound::Files::JUMP); land_sound_ = Resource::Cache::get()->getSound(Defaults::Sound::Files::LAND); } diff --git a/source/game/gameplay/cheevos.cpp b/source/game/gameplay/cheevos.cpp index 85ca9f4..5a3cb93 100644 --- a/source/game/gameplay/cheevos.cpp +++ b/source/game/gameplay/cheevos.cpp @@ -16,7 +16,7 @@ Cheevos* Cheevos::cheevos = nullptr; // [SINGLETON] Crearemos el objeto con esta función estática -void Cheevos::init(const std::string& file) { // NOLINT(readability-convert-member-functions-to-static) +void Cheevos::init(const std::string& file) { Cheevos::cheevos = new Cheevos(file); } @@ -43,12 +43,12 @@ Cheevos::~Cheevos() { } // Inicializa los logros -void Cheevos::init() { // NOLINT(readability-convert-member-functions-to-static) +void Cheevos::init() { cheevos_list_.clear(); } // Busca un logro por id y devuelve el indice -auto Cheevos::find(int id) -> int { // NOLINT(readability-convert-member-functions-to-static) +auto Cheevos::find(int id) -> int { for (int i = 0; i < (int)cheevos_list_.size(); ++i) { if (cheevos_list_[i].id == id) { return i; @@ -88,7 +88,7 @@ void Cheevos::setUnobtainable(int id) { } // Carga el estado de los logros desde un fichero -void Cheevos::loadFromFile() { // NOLINT(readability-convert-member-functions-to-static) +void Cheevos::loadFromFile() { std::ifstream file(file_, std::ios::binary); // El fichero no existe diff --git a/source/game/gameplay/enemy_manager.cpp b/source/game/gameplay/enemy_manager.cpp index a5c1dbe..70d63fd 100644 --- a/source/game/gameplay/enemy_manager.cpp +++ b/source/game/gameplay/enemy_manager.cpp @@ -16,7 +16,7 @@ void EnemyManager::clear() { } // Elimina el último enemigo de la colección -void EnemyManager::removeLastEnemy() { // NOLINT(readability-convert-member-functions-to-static) +void EnemyManager::removeLastEnemy() { if (!enemies_.empty()) { enemies_.pop_back(); } diff --git a/source/game/gameplay/item_manager.cpp b/source/game/gameplay/item_manager.cpp index 79e94ce..480b41c 100644 --- a/source/game/gameplay/item_manager.cpp +++ b/source/game/gameplay/item_manager.cpp @@ -46,7 +46,7 @@ void ItemManager::setPaused(bool paused) { } // Comprueba si hay colisión con algún item -auto ItemManager::checkCollision(SDL_FRect& rect) -> bool { // NOLINT(readability-convert-member-functions-to-static) +auto ItemManager::checkCollision(SDL_FRect& rect) -> bool { for (int i = 0; i < static_cast(items_.size()); ++i) { if (::checkCollision(rect, items_.at(i)->getCollider())) { // Registra el item como recogido diff --git a/source/game/gameplay/item_tracker.cpp b/source/game/gameplay/item_tracker.cpp index ef209c8..37a8177 100644 --- a/source/game/gameplay/item_tracker.cpp +++ b/source/game/gameplay/item_tracker.cpp @@ -32,7 +32,7 @@ auto ItemTracker::hasBeenPicked(const std::string& name, SDL_FPoint pos) -> bool } // Añade el objeto a la lista de objetos cogidos -void ItemTracker::addItem(const std::string& name, SDL_FPoint pos) { // NOLINT(readability-convert-member-functions-to-static) +void ItemTracker::addItem(const std::string& name, SDL_FPoint pos) { // Comprueba si el objeto no ha sido recogido con anterioridad if (!hasBeenPicked(name, pos)) { // Primero busca si ya hay una entrada con ese nombre @@ -47,7 +47,7 @@ void ItemTracker::addItem(const std::string& name, SDL_FPoint pos) { // NOLINT( } // Busca una entrada en la lista por nombre -auto ItemTracker::findByName(const std::string& name) -> int { // NOLINT(readability-convert-member-functions-to-static) +auto ItemTracker::findByName(const std::string& name) -> int { int i = 0; for (const auto& item : items_) { @@ -61,7 +61,7 @@ auto ItemTracker::findByName(const std::string& name) -> int { // NOLINT(readab } // Busca una entrada en la lista por posición -auto ItemTracker::findByPos(int index, SDL_FPoint pos) -> int { // NOLINT(readability-convert-member-functions-to-static) +auto ItemTracker::findByPos(int index, SDL_FPoint pos) -> int { int i = 0; for (const auto& item : items_[index].pos) { diff --git a/source/game/gameplay/room.cpp b/source/game/gameplay/room.cpp index 4e6ac71..c915a01 100644 --- a/source/game/gameplay/room.cpp +++ b/source/game/gameplay/room.cpp @@ -278,7 +278,7 @@ void Room::updateSolidActorBorders(const SolidActorManager::AdjacentActors& adja } // Devuelve la cadena del fichero de la habitación contigua segun el borde -auto Room::getRoom(Border border) -> std::string { // NOLINT(readability-convert-member-functions-to-static) +auto Room::getRoom(Border border) -> std::string { switch (border) { case Border::TOP: return upper_room_; @@ -310,6 +310,6 @@ void Room::tryUnlockDoors(const SDL_FRect& player_rect) { } // Carga una habitación desde un archivo YAML (delegado a RoomFormat) -auto Room::loadYAML(const std::string& file_path, bool verbose) -> Data { // NOLINT(readability-convert-member-functions-to-static) +auto Room::loadYAML(const std::string& file_path, bool verbose) -> Data { return RoomFormat::loadYAML(file_path, verbose); } diff --git a/source/game/gameplay/room_tracker.cpp b/source/game/gameplay/room_tracker.cpp index c68dc8e..199b150 100644 --- a/source/game/gameplay/room_tracker.cpp +++ b/source/game/gameplay/room_tracker.cpp @@ -3,12 +3,12 @@ #include // Para std::ranges::any_of // Comprueba si la habitación ya ha sido visitada -auto RoomTracker::hasBeenVisited(const std::string& name) -> bool { // NOLINT(readability-convert-member-functions-to-static) +auto RoomTracker::hasBeenVisited(const std::string& name) -> bool { return std::ranges::any_of(rooms_, [&name](const auto& l) -> bool { return l == name; }); } // Añade la habitación a la lista -auto RoomTracker::addRoom(const std::string& name) -> bool { // NOLINT(readability-convert-member-functions-to-static) +auto RoomTracker::addRoom(const std::string& name) -> bool { // Comprueba si la habitación ya ha sido visitada if (!hasBeenVisited(name)) { // En caso contrario añádela a la lista diff --git a/source/game/scenes/game.cpp b/source/game/scenes/game.cpp index 9d1605f..9b7be7f 100644 --- a/source/game/scenes/game.cpp +++ b/source/game/scenes/game.cpp @@ -210,10 +210,10 @@ void Game::handleEvents() { if (event.type == SDL_EVENT_KEY_DOWN && event.key.key == SDLK_9 && static_cast(event.key.repeat) == 0) { if (MapEditor::get()->isActive()) { GameControl::exit_editor(); - Notifier::get()->show({Locale::get()->get("game.editor_disabled")}); // NOLINT(readability-static-accessed-through-instance) + Notifier::get()->show({Locale::get()->get("game.editor_disabled")}); } else { GameControl::enter_editor(); - Notifier::get()->show({Locale::get()->get("game.editor_enabled")}); // NOLINT(readability-static-accessed-through-instance) + Notifier::get()->show({Locale::get()->get("game.editor_enabled")}); } } else if (event.type == SDL_EVENT_KEY_DOWN && event.key.key == SDLK_G && static_cast(event.key.repeat) == 0 && MapEditor::get()->isActive()) { MapEditor::get()->showGrid(!MapEditor::get()->isGridEnabled()); @@ -259,9 +259,9 @@ void Game::handleInput() { } // Input de pausa solo en estado PLAYING - if (Input::get()->checkAction(InputAction::PAUSE, Input::DO_NOT_ALLOW_REPEAT)) { // NOLINT(readability-static-accessed-through-instance) + if (Input::get()->checkAction(InputAction::PAUSE, Input::DO_NOT_ALLOW_REPEAT)) { togglePause(); - Notifier::get()->show({paused_ ? Locale::get()->get("game.paused") : Locale::get()->get("game.running")}); // NOLINT(readability-static-accessed-through-instance) + Notifier::get()->show({paused_ ? Locale::get()->get("game.paused") : Locale::get()->get("game.running")}); } GlobalInputs::handle(); @@ -611,7 +611,7 @@ void Game::renderPostFadeEnding() { static void toggleCheat(Options::Cheat::State& cheat, const std::string& label) { cheat = (cheat == Options::Cheat::State::ENABLED) ? Options::Cheat::State::DISABLED : Options::Cheat::State::ENABLED; const bool ENABLED = (cheat == Options::Cheat::State::ENABLED); - Notifier::get()->show({label + (ENABLED ? Locale::get()->get("game.enabled") : Locale::get()->get("game.disabled"))}, Notifier::Style::DEFAULT, -1, true); // NOLINT(readability-static-accessed-through-instance) + Notifier::get()->show({label + (ENABLED ? Locale::get()->get("game.enabled") : Locale::get()->get("game.disabled"))}, Notifier::Style::DEFAULT, -1, true); } // Pone la información de debug en pantalla @@ -638,7 +638,7 @@ void Game::renderDebugInfo() { } // Comprueba los eventos -void Game::handleDebugEvents(const SDL_Event& event) { // NOLINT(readability-convert-member-functions-to-static) +void Game::handleDebugEvents(const SDL_Event& event) { if (event.type == SDL_EVENT_KEY_DOWN && static_cast(event.key.repeat) == 0) { switch (event.key.key) { case SDLK_R: @@ -662,15 +662,15 @@ void Game::handleDebugEvents(const SDL_Event& event) { // NOLINT(readability-co break; case SDLK_1: - toggleCheat(Options::cheats.infinite_lives, Locale::get()->get("game.cheat_infinite_lives")); // NOLINT(readability-static-accessed-through-instance) + toggleCheat(Options::cheats.infinite_lives, Locale::get()->get("game.cheat_infinite_lives")); break; case SDLK_2: - toggleCheat(Options::cheats.invincible, Locale::get()->get("game.cheat_invincible")); // NOLINT(readability-static-accessed-through-instance) + toggleCheat(Options::cheats.invincible, Locale::get()->get("game.cheat_invincible")); break; case SDLK_7: - Notifier::get()->show({Locale::get()->get("achievements.header"), Locale::get()->get("achievements.c11")}, Notifier::Style::CHEEVO, -1, false, "F7"); // NOLINT(readability-static-accessed-through-instance) + Notifier::get()->show({Locale::get()->get("achievements.header"), Locale::get()->get("achievements.c11")}, Notifier::Style::CHEEVO, -1, false, "F7"); break; case SDLK_0: { @@ -679,7 +679,7 @@ void Game::handleDebugEvents(const SDL_Event& event) { // NOLINT(readability-co invincible_before_debug_ = (Options::cheats.invincible == Options::Cheat::State::ENABLED); } Debug::get()->toggleEnabled(); - Notifier::get()->show({Debug::get()->isEnabled() ? Locale::get()->get("game.debug_enabled") : Locale::get()->get("game.debug_disabled")}); // NOLINT(readability-static-accessed-through-instance) + Notifier::get()->show({Debug::get()->isEnabled() ? Locale::get()->get("game.debug_enabled") : Locale::get()->get("game.debug_disabled")}); room_->redrawMap(); if (Debug::get()->isEnabled()) { Options::cheats.invincible = Options::Cheat::State::ENABLED; @@ -779,7 +779,7 @@ auto Game::changeRoom(const std::string& room_path) -> bool { } // Verifica que exista el fichero que se va a cargar - if (!Resource::List::get()->get(room_path).empty()) { // NOLINT(readability-static-accessed-through-instance) + if (!Resource::List::get()->get(room_path).empty()) { // Obtiene la habitación del caché o la crea room_ = getOrCreateRoom(room_path); @@ -1013,7 +1013,7 @@ void Game::togglePause() { } // Inicializa al jugador -void Game::initPlayer(const Player::SpawnData& spawn_point, std::shared_ptr room) { // NOLINT(readability-convert-member-functions-to-static) +void Game::initPlayer(const Player::SpawnData& spawn_point, std::shared_ptr room) { const bool IGNORE_INPUT = player_ != nullptr && player_->getIgnoreInput(); std::string player_animations = Player::skinToAnimationPath(Defaults::Game::Player::SKIN); const Player::Data PLAYER{.spawn_data = spawn_point, .animations_path = player_animations, .room = std::move(room)}; diff --git a/source/game/scenes/logo.cpp b/source/game/scenes/logo.cpp index bf46fc6..f22362f 100644 --- a/source/game/scenes/logo.cpp +++ b/source/game/scenes/logo.cpp @@ -94,7 +94,7 @@ void Logo::updateJAILGAMES(float delta_time) { } // Calcula el índice de color según el progreso (0.0-1.0) -auto Logo::getColorIndex(float progress) const -> int { // NOLINT(readability-convert-member-functions-to-static) +auto Logo::getColorIndex(float progress) const -> int { // Asegurar que progress esté en el rango [0.0, 1.0] progress = std::clamp(progress, 0.0F, 1.0F); @@ -213,7 +213,7 @@ void Logo::update() { } // Dibuja en pantalla -void Logo::render() { // NOLINT(readability-convert-member-functions-to-static) +void Logo::render() { // Prepara para empezar a dibujar en la textura de juego Screen::get()->start(); Screen::get()->clearSurface(0); @@ -234,7 +234,7 @@ void Logo::endSection() { } // Inicializa el vector de colores -void Logo::initColors() { // NOLINT(readability-convert-member-functions-to-static) +void Logo::initColors() { // Inicializa el vector de colores const std::vector COLORS = { 0, @@ -251,7 +251,7 @@ void Logo::initColors() { // NOLINT(readability-convert-member-functions-to-sta } // Crea los sprites de cada linea -void Logo::initSprites() { // NOLINT(readability-convert-member-functions-to-static) +void Logo::initSprites() { const float WIDTH = jailgames_surface_->getWidth(); jailgames_initial_x_.reserve(jailgames_surface_->getHeight()); diff --git a/source/game/scenes/title.cpp b/source/game/scenes/title.cpp index 8c9336f..f9b6c6d 100644 --- a/source/game/scenes/title.cpp +++ b/source/game/scenes/title.cpp @@ -351,7 +351,7 @@ auto Title::isKeyValid(SDL_Scancode scancode) -> bool { } // Verifica si una tecla ya fue usada en pasos anteriores -auto Title::isKeyDuplicate(SDL_Scancode scancode, int current_step) -> bool { // NOLINT(readability-convert-member-functions-to-static) +auto Title::isKeyDuplicate(SDL_Scancode scancode, int current_step) -> bool { for (int i = 0; i < current_step; i++) { if (temp_keys_[i] == scancode) { return true; @@ -361,7 +361,7 @@ auto Title::isKeyDuplicate(SDL_Scancode scancode, int current_step) -> bool { / } // Aplica y guarda las teclas redefinidas -void Title::applyKeyboardRemap() { // NOLINT(readability-convert-member-functions-to-static) +void Title::applyKeyboardRemap() { // Guardar las nuevas teclas en Options::controls Options::keyboard_controls.key_left = temp_keys_[0]; Options::keyboard_controls.key_right = temp_keys_[1]; @@ -399,17 +399,17 @@ void Title::renderKeyboardRemap() const { const int KEYS_START_Y = START_Y + (2 * LINE_SPACING); if (remap_step_ > 0) { const std::string LEFT_KEY = SDL_GetScancodeName(temp_keys_[0]); - const std::string LEFT_MSG = loc->get("title.keys.label0") + LEFT_KEY; // NOLINT(readability-static-accessed-through-instance) + const std::string LEFT_MSG = loc->get("title.keys.label0") + LEFT_KEY; menu_text_->writeDX(Text::CENTER_FLAG | Text::COLOR_FLAG, PlayArea::CENTER_X, KEYS_START_Y, LEFT_MSG, 1, COLOR); } if (remap_step_ > 1) { const std::string RIGHT_KEY = SDL_GetScancodeName(temp_keys_[1]); - const std::string RIGHT_MSG = loc->get("title.keys.label1") + RIGHT_KEY; // NOLINT(readability-static-accessed-through-instance) + const std::string RIGHT_MSG = loc->get("title.keys.label1") + RIGHT_KEY; menu_text_->writeDX(Text::CENTER_FLAG | Text::COLOR_FLAG, PlayArea::CENTER_X, KEYS_START_Y + LINE_SPACING, RIGHT_MSG, 1, COLOR); } if (remap_step_ >= 3) { const std::string JUMP_KEY = SDL_GetScancodeName(temp_keys_[2]); - const std::string JUMP_MSG = loc->get("title.keys.label2") + JUMP_KEY; // NOLINT(readability-static-accessed-through-instance) + const std::string JUMP_MSG = loc->get("title.keys.label2") + JUMP_KEY; menu_text_->writeDX(Text::CENTER_FLAG | Text::COLOR_FLAG, PlayArea::CENTER_X, KEYS_START_Y + (2 * LINE_SPACING), JUMP_MSG, 1, COLOR); } @@ -443,17 +443,17 @@ void Title::renderJoystickRemap() const { const int BUTTONS_START_Y = START_Y + (2 * LINE_SPACING); if (remap_step_ > 0) { const std::string LEFT_BTN = getButtonName(temp_buttons_[0]); - const std::string LEFT_MSG = loc->get("title.keys.label0") + LEFT_BTN; // NOLINT(readability-static-accessed-through-instance) + const std::string LEFT_MSG = loc->get("title.keys.label0") + LEFT_BTN; menu_text_->writeDX(Text::CENTER_FLAG | Text::COLOR_FLAG, PlayArea::CENTER_X, BUTTONS_START_Y, LEFT_MSG, 1, COLOR); } if (remap_step_ > 1) { const std::string RIGHT_BTN = getButtonName(temp_buttons_[1]); - const std::string RIGHT_MSG = loc->get("title.keys.label1") + RIGHT_BTN; // NOLINT(readability-static-accessed-through-instance) + const std::string RIGHT_MSG = loc->get("title.keys.label1") + RIGHT_BTN; menu_text_->writeDX(Text::CENTER_FLAG | Text::COLOR_FLAG, PlayArea::CENTER_X, BUTTONS_START_Y + LINE_SPACING, RIGHT_MSG, 1, COLOR); } if (remap_step_ >= 3) { const std::string JUMP_BTN = getButtonName(temp_buttons_[2]); - const std::string JUMP_MSG = loc->get("title.keys.label2") + JUMP_BTN; // NOLINT(readability-static-accessed-through-instance) + const std::string JUMP_MSG = loc->get("title.keys.label2") + JUMP_BTN; menu_text_->writeDX(Text::CENTER_FLAG | Text::COLOR_FLAG, PlayArea::CENTER_X, BUTTONS_START_Y + (2 * LINE_SPACING), JUMP_MSG, 1, COLOR); } @@ -522,7 +522,7 @@ void Title::handleJoystickRemap(const SDL_Event& event) { } // Valida si un botón está duplicado -auto Title::isButtonDuplicate(int button, int current_step) -> bool { // NOLINT(readability-convert-member-functions-to-static) +auto Title::isButtonDuplicate(int button, int current_step) -> bool { for (int i = 0; i < current_step; ++i) { if (temp_buttons_[i] == button) { return true; @@ -532,7 +532,7 @@ auto Title::isButtonDuplicate(int button, int current_step) -> bool { // NOLINT } // Aplica y guarda los botones del gamepad redefinidos -void Title::applyJoystickRemap() { // NOLINT(readability-convert-member-functions-to-static) +void Title::applyJoystickRemap() { // Guardar los nuevos botones en Options::gamepad_controls Options::gamepad_controls.button_left = temp_buttons_[0]; Options::gamepad_controls.button_right = temp_buttons_[1]; @@ -546,7 +546,7 @@ void Title::applyJoystickRemap() { // NOLINT(readability-convert-member-functio } // Retorna el nombre amigable del botón del gamepad -auto Title::getButtonName(int button) -> std::string { // NOLINT(readability-convert-member-functions-to-static) +auto Title::getButtonName(int button) -> std::string { // Triggers especiales if (button == Input::TRIGGER_L2_AS_BUTTON) { return "L2"; diff --git a/source/game/ui/notifier.cpp b/source/game/ui/notifier.cpp index 077eee4..80eb29c 100644 --- a/source/game/ui/notifier.cpp +++ b/source/game/ui/notifier.cpp @@ -44,7 +44,7 @@ const Notifier::Style Notifier::Style::CHEEVO = { .play_sound = true}; // [SINGLETON] Crearemos el objeto con esta función estática -void Notifier::init(const std::string& icon_file, const std::string& text) { // NOLINT(readability-convert-member-functions-to-static) +void Notifier::init(const std::string& icon_file, const std::string& text) { Notifier::notifier = new Notifier(icon_file, text); } @@ -127,7 +127,7 @@ void Notifier::update(float delta_time) { } // Elimina las notificaciones finalizadas -void Notifier::clearFinishedNotifications() { // NOLINT(readability-convert-member-functions-to-static) +void Notifier::clearFinishedNotifications() { auto result = std::ranges::remove_if(notifications_, [](const Notification& notification) -> bool { return notification.state == Status::FINISHED; });