diff --git a/linux_utils/com_usar_clang-tidy.txt b/linux_utils/com_usar_clang-tidy.txt index 62efbac..349450f 100644 --- a/linux_utils/com_usar_clang-tidy.txt +++ b/linux_utils/com_usar_clang-tidy.txt @@ -2,5 +2,7 @@ clang-tidy source/fitxer.cpp -p build/ --fix # Per a varios fitxers, desde l'arrel: -find source/ \( -name '*.cpp' -o -name '*.h' -o -name '*.hpp' \) | xargs -P4 -I{} clang-tidy {} -p build/ --fix +find source/ \( -name '*.cpp' -o -name '*.h' -o -name '*.hpp' \) | \ +xargs -P4 -I{} bash -c 'echo "Procesando: {}"; clang-tidy {} -p build/ --fix' + diff --git a/source/animated_sprite.cpp b/source/animated_sprite.cpp index e8c54c1..e906502 100644 --- a/source/animated_sprite.cpp +++ b/source/animated_sprite.cpp @@ -1,15 +1,16 @@ #include "animated_sprite.h" #include // Para SDL_LogWarn, SDL_LogCategory, SDL_LogError, SDL_FRect -#include // Para min, max -#include // Para size_t -#include // Para basic_istream, basic_ifstream, basic_ios, ifstream, stringstream -#include // Para basic_stringstream -#include // Para runtime_error -#include // Para pair -#include "texture.h" // Para Texture -#include "utils.h" // Para printWithDots +#include // Para min, max +#include // Para size_t +#include // Para basic_istream, basic_ifstream, basic_ios, ifstream, stringstream +#include // Para basic_stringstream +#include // Para runtime_error +#include // Para pair + +#include "texture.h" // Para Texture +#include "utils.h" // Para printWithDots // Carga las animaciones en un vector(Animations) desde un fichero auto loadAnimationsFromFile(const std::string& file_path) -> AnimationsFileBuffer { diff --git a/source/animated_sprite.h b/source/animated_sprite.h index 4257c1f..1a4fa4c 100644 --- a/source/animated_sprite.h +++ b/source/animated_sprite.h @@ -1,6 +1,7 @@ #pragma once #include // Para SDL_FRect + #include // Para max #include // Para size_t #include // Para allocator, shared_ptr diff --git a/source/asset.cpp b/source/asset.cpp index 529c6b2..4cb274e 100644 --- a/source/asset.cpp +++ b/source/asset.cpp @@ -1,13 +1,14 @@ #include "asset.h" #include // Para SDL_LogInfo, SDL_LogCategory, SDL_LogError, SDL_LogWarn + #include // Para max #include // Para basic_ifstream, ifstream #include // Para identity #include // Para __find_if_fn, find_if #include // Para allocator, string, operator==, operator+, char_traits, basic_string -#include "utils.h" // Para getFileName +#include "utils.h" // Para getFileName // Singleton Asset *Asset::instance = nullptr; diff --git a/source/background.cpp b/source/background.cpp index b1b00e2..4dc0f23 100644 --- a/source/background.cpp +++ b/source/background.cpp @@ -2,6 +2,7 @@ #include "background.h" #include // Para SDL_FRect, SDL_SetRenderTarget, SDL_CreateTexture, SDL_DestroyTexture, SDL_GetRenderTarget, SDL_RenderTexture, SDL_SetTextureAlphaMod, SDL_SetTextureBlendMode, SDL_BLENDMODE_BLEND, SDL_PixelFormat, SDL_RenderClear, SDL_SetRenderDrawColor, SDL_TextureAccess, SDL_FPoint + #include // Para clamp, max #include // Para M_PI, cos, sin diff --git a/source/background.h b/source/background.h index 1d17c28..6b5d886 100644 --- a/source/background.h +++ b/source/background.h @@ -1,12 +1,13 @@ #pragma once #include // Para SDL_FRect, SDL_FPoint, SDL_Texture, SDL_Renderer -#include // Para array -#include // Para size_t -#include // Para unique_ptr, shared_ptr -#include // Para vector -#include "color.h" // Para Color +#include // Para array +#include // Para size_t +#include // Para unique_ptr, shared_ptr +#include // Para vector + +#include "color.h" // Para Color class MovingSprite; class Sprite; diff --git a/source/balloon.cpp b/source/balloon.cpp index 7cb1da7..6d13ac6 100644 --- a/source/balloon.cpp +++ b/source/balloon.cpp @@ -171,13 +171,13 @@ void Balloon::handleVerticalMovement() { handleBottomCollision(); } -bool Balloon::isOutOfHorizontalBounds(float minX, float maxX) const { - return x_ < minX || x_ > maxX; +auto Balloon::isOutOfHorizontalBounds(float min_x, float max_x) const -> bool { + return x_ < min_x || x_ > max_x; } -void Balloon::handleHorizontalBounce(float minX, float maxX) { +void Balloon::handleHorizontalBounce(float min_x, float max_x) { playBouncingSound(); - x_ = std::clamp(x_, minX, maxX); + x_ = std::clamp(x_, min_x, max_x); vx_ = -vx_; if (type_ == BalloonType::POWERBALL) { @@ -187,7 +187,7 @@ void Balloon::handleHorizontalBounce(float minX, float maxX) { } } -bool Balloon::shouldCheckTopCollision() const { +auto Balloon::shouldCheckTopCollision() const -> bool { // Colisión en la parte superior solo si el globo va de subida return vy_ < 0; } diff --git a/source/balloon.h b/source/balloon.h index 422881a..24171b0 100644 --- a/source/balloon.h +++ b/source/balloon.h @@ -184,16 +184,16 @@ class Balloon { void applyGravity(); // Aplica la gravedad al objeto // --- Rebote --- - void enableBounceEffect(); // Activa el efecto de rebote - void disableBounceEffect(); // Detiene el efecto de rebote - void updateBounceEffect(); // Actualiza el estado del rebote - void handleHorizontalBounce(float minX, float maxX); // Maneja el rebote horizontal dentro de límites + void enableBounceEffect(); // Activa el efecto de rebote + void disableBounceEffect(); // Detiene el efecto de rebote + void updateBounceEffect(); // Actualiza el estado del rebote + void handleHorizontalBounce(float min_x, float max_x); // Maneja el rebote horizontal dentro de límites // --- Colisiones --- - bool isOutOfHorizontalBounds(float minX, float maxX) const; // Verifica si está fuera de los límites horizontales - bool shouldCheckTopCollision() const; // Determina si debe comprobarse la colisión superior - void handleTopCollision(); // Maneja la colisión superior - void handleBottomCollision(); // Maneja la colisión inferior + [[nodiscard]] auto isOutOfHorizontalBounds(float min_x, float max_x) const -> bool; // Verifica si está fuera de los límites horizontales + [[nodiscard]] auto shouldCheckTopCollision() const -> bool; // Determina si debe comprobarse la colisión superior + void handleTopCollision(); // Maneja la colisión superior + void handleBottomCollision(); // Maneja la colisión inferior // --- Lógica de estado --- void updateState(); // Actualiza los estados del globo diff --git a/source/balloon_manager.h b/source/balloon_manager.h index 7fe1454..5022b3e 100644 --- a/source/balloon_manager.h +++ b/source/balloon_manager.h @@ -1,11 +1,12 @@ #pragma once -#include // Para SDL_FRect -#include // Para max -#include // Para array -#include // Para shared_ptr, unique_ptr -#include // Para string -#include // Para vector +#include // Para SDL_FRect + +#include // Para max +#include // Para array +#include // Para shared_ptr, unique_ptr +#include // Para string +#include // Para vector #include "balloon.h" // Para BALLOON_SPEED, Balloon, BalloonSize (ptr only), BalloonType (ptr only) #include "balloon_formations.h" // Para BalloonFormations diff --git a/source/bullet.h b/source/bullet.h index 92e7ec2..988ab84 100644 --- a/source/bullet.h +++ b/source/bullet.h @@ -1,8 +1,9 @@ #pragma once -#include // Para Uint8 -#include // Para unique_ptr -#include // Para string +#include // Para Uint8 + +#include // Para unique_ptr +#include // Para string #include "animated_sprite.h" // Para AnimatedSprite #include "utils.h" // Para Circle diff --git a/source/color.cpp b/source/color.cpp index d1b0b77..0752932 100644 --- a/source/color.cpp +++ b/source/color.cpp @@ -1,10 +1,12 @@ #define _USE_MATH_DEFINES #include "color.h" -#include // Para min, clamp -#include // Para fmaxf, fminf, M_PI, fmodf, roundf, sin, abs -#include // Para invalid_argument -#include // Para basic_string, string +#include // Para uint8_t + +#include // Para isxdigit +#include // Para sinf, fmaxf, fminf, M_PI, fmodf, roundf, fmod +#include // Para invalid_argument +#include // Para basic_string, stoi, string // Método estático para crear Color desde string hexadecimal auto Color::fromHex(const std::string &hex_str) -> Color { diff --git a/source/color.h b/source/color.h index bde200f..0411c0f 100644 --- a/source/color.h +++ b/source/color.h @@ -1,13 +1,12 @@ #pragma once -#include // Para Uint8 +#include // Para Uint8 +#include // Para abs #include // Para max, min #include // Para array -#include // Para isxdigit -#include // Para abs -#include // Para invalid_argument -#include // Para string, basic_string, stoi +#include // Para size_t, abs +#include // Para string #include // Para vector // --- Constantes --- diff --git a/source/define_buttons.h b/source/define_buttons.h index 1ac0d6e..e876238 100644 --- a/source/define_buttons.h +++ b/source/define_buttons.h @@ -1,6 +1,7 @@ #pragma once #include // Para SDL_GamepadButton, SDL_Event, SDL_GamepadButtonEvent + #include // Para size_t #include // Para shared_ptr #include // Para basic_string, string diff --git a/source/difficulty.cpp b/source/difficulty.cpp index 83f0e39..4bb72f0 100644 --- a/source/difficulty.cpp +++ b/source/difficulty.cpp @@ -1,6 +1,6 @@ #include "difficulty.h" -#include // Para vector +#include // Para vector namespace Difficulty { @@ -10,11 +10,10 @@ void init() { difficulties_list = { {Code::EASY, "Easy"}, {Code::NORMAL, "Normal"}, - {Code::HARD, "Hard"} - }; + {Code::HARD, "Hard"}}; } -auto getDifficulties() -> std::vector& { +auto getDifficulties() -> std::vector& { return difficulties_list; } @@ -36,4 +35,4 @@ auto getCodeFromName(const std::string& name) -> Code { return !difficulties_list.empty() ? difficulties_list.front().code : Code::NORMAL; } -} // namespace Difficulty \ No newline at end of file +} // namespace Difficulty \ No newline at end of file diff --git a/source/difficulty.h b/source/difficulty.h index 8b82a60..e76e1c9 100644 --- a/source/difficulty.h +++ b/source/difficulty.h @@ -18,8 +18,8 @@ enum class Code { * @brief Estructura que asocia un código de dificultad con su nombre traducible. */ struct Info { - Code code; - std::string name; + Code code; + std::string name; }; // --- Interfaz Pública --- @@ -49,4 +49,4 @@ auto getNameFromCode(Code code) -> std::string; */ auto getCodeFromName(const std::string& name) -> Code; -} // namespace Difficulty \ No newline at end of file +} // namespace Difficulty \ No newline at end of file diff --git a/source/enter_name.cpp b/source/enter_name.cpp index dc53c8e..8206643 100644 --- a/source/enter_name.cpp +++ b/source/enter_name.cpp @@ -4,7 +4,7 @@ #include // Para rand #include // Para basic_string_view, string_view -#include "utils.h" // Para trim +#include "utils.h" // Para trim // Constructor EnterName::EnterName() diff --git a/source/game_logo.cpp b/source/game_logo.cpp index a8e3c7a..3af25ec 100644 --- a/source/game_logo.cpp +++ b/source/game_logo.cpp @@ -1,7 +1,8 @@ #include "game_logo.h" -#include // Para SDL_SetTextureScaleMode, SDL_FlipMode, SDL_ScaleMode -#include // Para max +#include // Para SDL_SetTextureScaleMode, SDL_FlipMode, SDL_ScaleMode + +#include // Para max #include "animated_sprite.h" // Para AnimatedSprite #include "audio.h" // Para Audio @@ -161,7 +162,7 @@ void GameLogo::handleCoffeeCrisisShaking() { } else { finishCoffeeCrisisShaking(); } - + updateDustSprites(); } @@ -172,7 +173,7 @@ void GameLogo::handleCoffeeCrisisFinished() { void GameLogo::handleArcadeEditionMoving() { zoom_ -= 0.1F * ZOOM_FACTOR; arcade_edition_sprite_->setZoom(zoom_); - + if (zoom_ <= 1.0F) { finishArcadeEditionMoving(); } @@ -192,10 +193,10 @@ void GameLogo::processShakeEffect(SmartSprite* primary_sprite, SmartSprite* seco shake_.counter--; } else { shake_.counter = shake_.delay; - const auto displacement = calculateShakeDisplacement(); - primary_sprite->setPosX(shake_.origin + displacement); - if (secondary_sprite) { - secondary_sprite->setPosX(shake_.origin + displacement + 15); + const auto DISPLACEMENT = calculateShakeDisplacement(); + primary_sprite->setPosX(shake_.origin + DISPLACEMENT); + if (secondary_sprite != nullptr) { + secondary_sprite->setPosX(shake_.origin + DISPLACEMENT + 15); } shake_.remaining--; } @@ -206,13 +207,13 @@ void GameLogo::processArcadeEditionShake() { shake_.counter--; } else { shake_.counter = shake_.delay; - const auto displacement = calculateShakeDisplacement(); - arcade_edition_sprite_->setX(shake_.origin + displacement); + const auto DISPLACEMENT = calculateShakeDisplacement(); + arcade_edition_sprite_->setX(shake_.origin + DISPLACEMENT); shake_.remaining--; } } -int GameLogo::calculateShakeDisplacement() const { +auto GameLogo::calculateShakeDisplacement() const -> int { return shake_.remaining % 2 == 0 ? shake_.desp * (-1) : shake_.desp; } diff --git a/source/game_logo.h b/source/game_logo.h index b09e7b0..444f6d2 100644 --- a/source/game_logo.h +++ b/source/game_logo.h @@ -86,13 +86,13 @@ class GameLogo { void updatePostFinishedCounter(); // Actualiza el contador tras finalizar una animación // --- Efectos visuales: movimiento y sacudidas --- - void handleCoffeeCrisisMoving(); // Maneja el movimiento de "Coffee Crisis" - void handleCoffeeCrisisShaking(); // Maneja la sacudida de "Coffee Crisis" - void handleArcadeEditionMoving(); // Maneja el movimiento de "Arcade Edition" - void handleArcadeEditionShaking(); // Maneja la sacudida de "Arcade Edition" + void handleCoffeeCrisisMoving(); // Maneja el movimiento de "Coffee Crisis" + void handleCoffeeCrisisShaking(); // Maneja la sacudida de "Coffee Crisis" + void handleArcadeEditionMoving(); // Maneja el movimiento de "Arcade Edition" + void handleArcadeEditionShaking(); // Maneja la sacudida de "Arcade Edition" void processShakeEffect(SmartSprite* primary_sprite, SmartSprite* secondary_sprite = nullptr); // Procesa el efecto de sacudida en sprites - void processArcadeEditionShake(); // Procesa la sacudida específica de "Arcade Edition" - int calculateShakeDisplacement() const; // Calcula el desplazamiento de la sacudida + void processArcadeEditionShake(); // Procesa la sacudida específica de "Arcade Edition" + [[nodiscard]] auto calculateShakeDisplacement() const -> int; // Calcula el desplazamiento de la sacudida // --- Gestión de finalización de efectos --- void handleCoffeeCrisisFinished(); // Maneja el final de la animación "Coffee Crisis" @@ -100,6 +100,6 @@ class GameLogo { void finishArcadeEditionMoving(); // Finaliza el movimiento de "Arcade Edition" // --- Utilidades --- - void playTitleEffects(); // Reproduce efectos visuales/sonoros del título - void updateDustSprites(); // Actualiza los sprites de polvo + static void playTitleEffects(); // Reproduce efectos visuales/sonoros del título + void updateDustSprites(); // Actualiza los sprites de polvo }; \ No newline at end of file diff --git a/source/input.cpp b/source/input.cpp index 29209a5..7f56436 100644 --- a/source/input.cpp +++ b/source/input.cpp @@ -1,6 +1,7 @@ #include "input.h" #include // Para SDL_LogInfo, SDL_LogCategory, SDL_GetGamepa... + #include // Para find #include // Para size_t #include // Para distance diff --git a/source/input.h b/source/input.h index 21ac2a5..417a87e 100644 --- a/source/input.h +++ b/source/input.h @@ -1,6 +1,7 @@ #pragma once #include // Para SDL_GamepadButton, Uint8, SDL_Gamepad, SDL_Joystick, SDL_JoystickID, SDL_Scancode, Sint16 + #include // Para basic_string, string #include // Para vector diff --git a/source/item.h b/source/item.h index 0df7a30..d9ff5f6 100644 --- a/source/item.h +++ b/source/item.h @@ -1,9 +1,10 @@ #pragma once -#include // Para SDL_FRect, Uint16 -#include // Para shared_ptr, unique_ptr -#include // Para string -#include // Para vector +#include // Para SDL_FRect, Uint16 + +#include // Para shared_ptr, unique_ptr +#include // Para string +#include // Para vector #include "animated_sprite.h" // Para AnimatedSprite #include "utils.h" // Para Circle diff --git a/source/manage_hiscore_table.cpp b/source/manage_hiscore_table.cpp index c0de93a..121c164 100644 --- a/source/manage_hiscore_table.cpp +++ b/source/manage_hiscore_table.cpp @@ -1,10 +1,11 @@ #include "manage_hiscore_table.h" #include // Para SDL_ReadIO, SDL_WriteIO, SDL_CloseIO, SDL_GetError, SDL_IOFromFile, SDL_LogCategory, SDL_LogError, SDL_LogInfo -#include // Para find_if, sort -#include // Para distance -#include "utils.h" // Para getFileName +#include // Para find_if, sort +#include // Para distance + +#include "utils.h" // Para getFileName // Resetea la tabla a los valores por defecto void ManageHiScoreTable::clear() { diff --git a/source/options.cpp b/source/options.cpp index 67d7562..2953ffb 100644 --- a/source/options.cpp +++ b/source/options.cpp @@ -1,20 +1,21 @@ #include "options.h" -#include // Para SDL_GamepadButton, SDL_ScaleMode, SDL_LogCategory, SDL_LogInfo, SDL_LogError, SDL_LogWarn +#include // Para SDL_ScaleMode, SDL_GamepadButton, SDL_LogCategory, SDL_LogInfo, SDL_LogError, SDL_LogWarn +#include // Para size_t -#include // Para clamp, max -#include // Para basic_ostream, operator<<, basic_ostream::operator<<, basic_ofstream, basic_istream, basic_ifstream, ifstream, ofstream -#include -#include -#include // Para excepciones de std::stoi -#include -#include // Para swap -#include // Para vector +#include // Para clamp, max +#include // Para basic_ostream, operator<<, basic_ostream::operator<<, basic_ofstream, basic_istream, basic_ifstream, ifstream, ofstream +#include // Para function +#include // Para map, operator==, _Rb_tree_const_iterator +#include // Para invalid_argument, out_of_range +#include // Para char_traits, stoi, operator==, operator<<, allocator, string, basic_string, operator<=>, getline +#include // Para swap, pair +#include // Para vector -#include "difficulty.h" // Para Difficulty -#include "input.h" // Para InputDevice -#include "lang.h" // Para Code -#include "utils.h" // Para boolToString, stringToBool, getFileName +#include "difficulty.h" // Para Code, init +#include "input.h" // Para InputDevice +#include "lang.h" // Para Code +#include "utils.h" // Para boolToString, stringToBool, getFileName namespace Options { // --- Variables globales --- @@ -209,7 +210,7 @@ auto set(const std::string& var, const std::string& value) -> bool { } // Un mapa estático asegura que se inicializa solo una vez - static const std::map> settings_map = { + static const std::map> SETTINGS_MAP = { // Ventana {"window.zoom", [](const auto& val) { window.zoom = std::stoi(val); }}, // Vídeo @@ -252,7 +253,7 @@ auto set(const std::string& var, const std::string& value) -> bool { } // Busca el nombre de la variable en el mapa - if (auto it = settings_map.find(var); it != settings_map.end()) { + if (auto it = SETTINGS_MAP.find(var); it != SETTINGS_MAP.end()) { try { // Ejecuta la función lambda asociada it->second(value); diff --git a/source/options.h b/source/options.h index 9c8c93c..6d87683 100644 --- a/source/options.h +++ b/source/options.h @@ -4,10 +4,9 @@ #include // Para copy #include // Para allocator, string -#include // Para move #include // Para vector -#include "difficulty.h" //Para Difficulty +#include "difficulty.h" // Para Code #include "input.h" // Para InputAction, InputDevice #include "lang.h" // Para Code #include "manage_hiscore_table.h" // Para HiScoreEntry @@ -71,12 +70,12 @@ struct AudioOptions { // --- Opciones de configuración --- struct SettingsOptions { Difficulty::Code difficulty{Difficulty::Code::NORMAL}; // Dificultad del juego - Lang::Code language{Lang::Code::VALENCIAN}; // Idioma usado en el juego - bool autofire{true}; // Indicador de autofire - bool shutdown_enabled{false}; // Especifica si se puede apagar el sistema - std::vector hi_score_table; // Tabla de mejores puntuaciones - std::vector last_hi_score_entry; // Últimas posiciones de entrada en la tabla - std::string config_file; // Ruta al fichero donde guardar la configuración y las opciones del juego + Lang::Code language{Lang::Code::VALENCIAN}; // Idioma usado en el juego + bool autofire{true}; // Indicador de autofire + bool shutdown_enabled{false}; // Especifica si se puede apagar el sistema + std::vector hi_score_table; // Tabla de mejores puntuaciones + std::vector last_hi_score_entry; // Últimas posiciones de entrada en la tabla + std::string config_file; // Ruta al fichero donde guardar la configuración y las opciones del juego // Constructor por defecto con valores iniciales SettingsOptions() @@ -119,9 +118,9 @@ struct GamepadOptions { // --- Opciones pendientes de aplicar --- struct PendingChanges { - Lang::Code new_language{Lang::Code::VALENCIAN}; // Idioma en espera de aplicar + Lang::Code new_language{Lang::Code::VALENCIAN}; // Idioma en espera de aplicar Difficulty::Code new_difficulty{Difficulty::Code::NORMAL}; // Dificultad en espera de aplicar - bool has_pending_changes{false}; // Indica si hay cambios pendientes + bool has_pending_changes{false}; // Indica si hay cambios pendientes // Constructor por defecto con valores iniciales PendingChanges() = default; diff --git a/source/param.cpp b/source/param.cpp index 0012459..04f55e1 100644 --- a/source/param.cpp +++ b/source/param.cpp @@ -1,6 +1,7 @@ #include "param.h" #include // Para SDL_LogCategory, SDL_LogError, SDL_LogInfo + #include // Para basic_istream, basic_ifstream, ifstream #include #include // Para basic_istringstream diff --git a/source/param.h b/source/param.h index 09ca5a9..58c0c8e 100644 --- a/source/param.h +++ b/source/param.h @@ -1,6 +1,7 @@ #pragma once #include // Para Uint32, SDL_FRect + #include // Para array #include // Para basic_string, string diff --git a/source/path_sprite.h b/source/path_sprite.h index 5e6f9a1..76d2e67 100644 --- a/source/path_sprite.h +++ b/source/path_sprite.h @@ -1,6 +1,7 @@ #pragma once #include // Para SDL_FPoint + #include // Para std::function #include // Para shared_ptr #include // Para vector diff --git a/source/player.cpp b/source/player.cpp index 341b395..d1fc46b 100644 --- a/source/player.cpp +++ b/source/player.cpp @@ -1,6 +1,7 @@ #include "player.h" #include // Para SDL_GetTicks, SDL_FlipMode, SDL_FRect + #include // Para clamp, max, min #include // Para rand diff --git a/source/player.h b/source/player.h index 3c690d8..0a60a8d 100644 --- a/source/player.h +++ b/source/player.h @@ -1,9 +1,10 @@ #pragma once -#include // Para Uint32, SDL_FRect -#include // Para allocator, unique_ptr, shared_ptr -#include // Para string -#include // Para vector +#include // Para Uint32, SDL_FRect + +#include // Para allocator, unique_ptr, shared_ptr +#include // Para string +#include // Para vector #include "animated_sprite.h" // Para AnimatedSprite #include "enter_name.h" // Para EnterName diff --git a/source/resource.h b/source/resource.h index 0e7b2ee..7454cd7 100644 --- a/source/resource.h +++ b/source/resource.h @@ -1,11 +1,12 @@ #pragma once -#include // Para SDL_FRect -#include // Para size_t -#include // Para shared_ptr -#include // Para string -#include // Para move -#include // Para vector +#include // Para SDL_FRect + +#include // Para size_t +#include // Para shared_ptr +#include // Para string +#include // Para move +#include // Para vector #include "animated_sprite.h" // Para AnimationsFileBuffer #include "text.h" // Para Text, TextFile diff --git a/source/scoreboard.cpp b/source/scoreboard.cpp index 6367f1b..a16e928 100644 --- a/source/scoreboard.cpp +++ b/source/scoreboard.cpp @@ -1,6 +1,7 @@ #include "scoreboard.h" #include // Para SDL_DestroyTexture, SDL_SetRenderDrawColor, SDL_SetRenderTarget, SDL_CreateTexture, SDL_GetRenderTarget, SDL_GetTicks, SDL_RenderClear, SDL_RenderLine, SDL_RenderTexture, SDL_SetTextureBlendMode, SDL_FRect, SDL_BLENDMODE_BLEND, SDL_PixelFormat, SDL_Texture, SDL_TextureAccess + #include // Para max #include // Para roundf #include // Para operator<<, setfill, setw diff --git a/source/scoreboard.h b/source/scoreboard.h index bdd5d32..8778393 100644 --- a/source/scoreboard.h +++ b/source/scoreboard.h @@ -1,13 +1,14 @@ #pragma once #include // Para SDL_FPoint, SDL_GetTicks, SDL_FRect, SDL_Texture, SDL_Renderer, Uint64 -#include // Para array -#include // Para size_t -#include // Para shared_ptr, unique_ptr -#include // Para string, basic_string -#include // Para vector -#include "color.h" // Para Color +#include // Para array +#include // Para size_t +#include // Para shared_ptr, unique_ptr +#include // Para string, basic_string +#include // Para vector + +#include "color.h" // Para Color class Sprite; class Text; diff --git a/source/sections/credits.cpp b/source/sections/credits.cpp index 0483b5f..05eec2c 100644 --- a/source/sections/credits.cpp +++ b/source/sections/credits.cpp @@ -2,6 +2,7 @@ #include "credits.h" #include // Para SDL_RenderFillRect, SDL_RenderTexture, SDL_SetRenderTarget, SDL_SetRenderDrawColor, SDL_CreateTexture, SDL_DestroyTexture, SDL_GetTicks, SDL_GetRenderTarget, SDL_PixelFormat, SDL_PollEvent, SDL_RenderClear, SDL_RenderRect, SDL_SetTextureBlendMode, SDL_TextureAccess, SDL_BLENDMODE_BLEND, SDL_Event + #include // Para max, min, clamp #include // Para array #include // Para runtime_error diff --git a/source/sections/credits.h b/source/sections/credits.h index 6cdafb1..87ea31e 100644 --- a/source/sections/credits.h +++ b/source/sections/credits.h @@ -1,6 +1,7 @@ #pragma once #include // Para SDL_FRect, Uint32, SDL_Texture, Uint64 + #include // Para unique_ptr, shared_ptr #include // Para vector @@ -17,7 +18,7 @@ class TiledBG; class Credits { public: - // --- Constructores y destructor --- + // --- Constructor y destructor --- Credits(); ~Credits(); diff --git a/source/sections/game.cpp b/source/sections/game.cpp index 307f723..15e0b2a 100644 --- a/source/sections/game.cpp +++ b/source/sections/game.cpp @@ -15,6 +15,7 @@ #include "balloon_manager.h" // Para BalloonManager #include "bullet.h" // Para Bullet, BulletType, BulletMoveStatus #include "color.h" // Para Color, FLASH_COLOR +#include "difficulty.h" // Para Code #include "fade.h" // Para Fade, FadeType, FadeMode #include "global_events.h" // Para check #include "global_inputs.h" // Para check diff --git a/source/sections/game.h b/source/sections/game.h index e81a99d..a712f0e 100644 --- a/source/sections/game.h +++ b/source/sections/game.h @@ -1,15 +1,14 @@ #pragma once -#include // Para SDL_Event, SDL_Renderer, SDL_Texture, Uint64 +#include // Para SDL_Event, SDL_Renderer, SDL_Texture, Uint64, Uint8 #include // Para shared_ptr, unique_ptr #include // Para string #include // Para vector -#include "difficulty.h" // Para Difficulty #include "item.h" // Para Item, ItemType #include "manage_hiscore_table.h" // Para HiScoreEntry -#include "options.h" // Para SettingsOptions, settings, DifficultyCode (ptr only) +#include "options.h" // Para SettingsOptions, settings #include "path_sprite.h" // Para PathSprite, Path #include "player.h" // Para Player #include "smart_sprite.h" // Para SmartSprite @@ -26,6 +25,9 @@ class Screen; class Tabe; class Texture; enum class BulletType : Uint8; +namespace Difficulty { +enum class Code; +} // namespace Difficulty // Modo demo constexpr bool GAME_MODE_DEMO_OFF = false; @@ -37,13 +39,11 @@ constexpr int TOTAL_SCORE_DATA = 3; // Clase Game class Game { public: - // Constructor + // --- Constructor y destructor --- Game(int player_id, int current_stage, bool demo); - - // Destructor ~Game(); - // Bucle principal del juego + // --- Bucle principal --- void run(); private: @@ -129,13 +129,13 @@ class Game { Options::settings.hi_score_table[0].name, Options::settings.hi_score_table[0].score); // Máxima puntuación y nombre de quien la ostenta - Demo demo_; // Variable con todas las variables relacionadas con el modo demo + Demo demo_; // Variable con todas las variables relacionadas con el modo demo Difficulty::Code difficulty_ = Options::settings.difficulty; // Dificultad del juego - Helper helper_; // Variable para gestionar las ayudas - Uint64 ticks_ = 0; // Contador de ticks para ajustar la velocidad del programa - bool coffee_machine_enabled_ = false; // Indica si hay una máquina de café en el terreno de juego - bool hi_score_achieved_ = false; // Indica si se ha superado la puntuación máxima - bool paused_ = false; // Indica si el juego está pausado (no se deberia de poder utilizar en el modo arcade) + Helper helper_; // Variable para gestionar las ayudas + Uint64 ticks_ = 0; // Contador de ticks para ajustar la velocidad del programa + bool coffee_machine_enabled_ = false; // Indica si hay una máquina de café en el terreno de juego + bool hi_score_achieved_ = false; // Indica si se ha superado la puntuación máxima + bool paused_ = false; // Indica si el juego está pausado (no se deberia de poder utilizar en el modo arcade) // bool paused_by_service_menu_ = false; float difficulty_score_multiplier_; // Multiplicador de puntos en función de la dificultad int counter_ = 0; // Contador para el juego diff --git a/source/sections/hiscore_table.cpp b/source/sections/hiscore_table.cpp index b38cb13..db376be 100644 --- a/source/sections/hiscore_table.cpp +++ b/source/sections/hiscore_table.cpp @@ -1,6 +1,7 @@ #include "hiscore_table.h" #include // Para SDL_GetTicks, SDL_SetRenderTarget + #include // Para max #include // Para rand, size_t #include // Para function diff --git a/source/sections/hiscore_table.h b/source/sections/hiscore_table.h index d247652..063aa7c 100644 --- a/source/sections/hiscore_table.h +++ b/source/sections/hiscore_table.h @@ -1,9 +1,10 @@ #pragma once -#include // Para Uint16, SDL_FRect, SDL_Renderer, SDL_Texture, Uint64, Uint8 -#include // Para unique_ptr, shared_ptr -#include // Para string -#include // Para vector +#include // Para Uint16, SDL_FRect, SDL_Renderer, SDL_Texture, Uint64, Uint8 + +#include // Para unique_ptr, shared_ptr +#include // Para string +#include // Para vector #include "color.h" // Para Color #include "path_sprite.h" // Para Path, PathSprite (ptr only) @@ -26,13 +27,11 @@ enum class FadeMode : Uint8; // Clase HiScoreTable class HiScoreTable { public: - // Constructor + // --- Constructor y destructor --- HiScoreTable(); - - // Destructor ~HiScoreTable(); - // Bucle principal + // --- Bucle principal --- void run(); private: diff --git a/source/sections/instructions.h b/source/sections/instructions.h index 89ad64c..9c996fc 100644 --- a/source/sections/instructions.h +++ b/source/sections/instructions.h @@ -1,6 +1,7 @@ #pragma once #include // Para SDL_Texture, Uint32, SDL_Renderer, SDL_FPoint, SDL_FRect, Uint64 + #include // Para unique_ptr, shared_ptr #include // Para vector @@ -39,13 +40,11 @@ struct Line { // Clase Instructions class Instructions { public: - // Constructor + // --- Constructor y destructor --- Instructions(); - - // Destructor ~Instructions(); - // Bucle principal + // --- Bucle principal --- void run(); private: diff --git a/source/sections/intro.h b/source/sections/intro.h index 38cd7da..7b3f52b 100644 --- a/source/sections/intro.h +++ b/source/sections/intro.h @@ -20,13 +20,11 @@ // Clase Intro class Intro { public: - // Constructor + // --- Constructor y destructor --- Intro(); - - // Destructor ~Intro() = default; - // Bucle principal + // --- Bucle principal --- void run(); private: @@ -72,8 +70,8 @@ class Intro { void updatePostState(); // Actualiza el estado POST #ifdef _DEBUG static void adjustColorComponent(uint8_t& component, bool increase); - void adjustAllColorComponents(Color& color, bool increase); - void handleDebugColorKeys(SDL_Keycode key, Color& color); + static void adjustAllColorComponents(Color& color, bool increase); + static void handleDebugColorKeys(SDL_Keycode key, Color& color); static void printColorDebugInfo(const Color& color); #endif diff --git a/source/sections/logo.cpp b/source/sections/logo.cpp index 9c3ba41..601c2cc 100644 --- a/source/sections/logo.cpp +++ b/source/sections/logo.cpp @@ -1,6 +1,7 @@ #include "logo.h" #include // Para SDL_GetTicks, SDL_PollEvent, SDL_Event, SDL_FRect + #include // Para max #include // Para move diff --git a/source/sections/logo.h b/source/sections/logo.h index 1d49832..86efb50 100644 --- a/source/sections/logo.h +++ b/source/sections/logo.h @@ -1,11 +1,12 @@ #pragma once #include // Para SDL_FPoint, Uint64 -#include // Para unique_ptr, shared_ptr -#include // Para vector -#include "color.h" // Para Color -#include "sprite.h" // Para Sprite +#include // Para unique_ptr, shared_ptr +#include // Para vector + +#include "color.h" // Para Color +#include "sprite.h" // Para Sprite class Texture; @@ -20,13 +21,11 @@ class Texture; // --- Clase Logo --- class Logo { public: - // Constructor + // --- Constructor y destructor --- Logo(); - - // Destructor ~Logo(); - // Bucle principal + // --- Bucle principal --- void run(); private: diff --git a/source/sections/title.cpp b/source/sections/title.cpp index c8b1327..5b9189f 100644 --- a/source/sections/title.cpp +++ b/source/sections/title.cpp @@ -111,31 +111,31 @@ void Title::checkEvents() { if (event.type == SDL_EVENT_KEY_DOWN) { handleKeyDownEvent(event); } - + GlobalEvents::check(event); define_buttons_->checkEvents(event); } } void Title::handleKeyDownEvent(const SDL_Event& event) { - bool isFirstPress = static_cast(event.key.repeat) == 0; - if (isFirstPress) { + bool is_first_press = static_cast(event.key.repeat) == 0; + if (is_first_press) { handleControlKeys(event.key.key); } -#ifdef _DEBUG - bool isRepeat = static_cast(event.key.repeat) == 1; - if (isRepeat) { +#ifdef _DEBUG + bool is_repeat = static_cast(event.key.repeat) == 1; + if (is_repeat) { handleDebugColorKeys(event.key.key); } -#endif +#endif } #ifdef _DEBUG void Title::handleDebugColorKeys(SDL_Keycode key) { static Color color_ = param.title.bg_color; - + adjustColorComponent(key, color_); - + counter_ = 0; tiled_bg_->setColor(color_); printColorValue(color_); @@ -143,15 +143,32 @@ void Title::handleDebugColorKeys(SDL_Keycode key) { void Title::adjustColorComponent(SDL_Keycode key, Color& color) { switch (key) { - case SDLK_A: incrementColorComponent(color.r); break; - case SDLK_Z: decrementColorComponent(color.r); break; - case SDLK_S: incrementColorComponent(color.g); break; - case SDLK_X: decrementColorComponent(color.g); break; - case SDLK_D: incrementColorComponent(color.b); break; - case SDLK_C: decrementColorComponent(color.b); break; - case SDLK_F: incrementAllComponents(color); break; - case SDLK_V: decrementAllComponents(color); break; - default: break; + case SDLK_A: + incrementColorComponent(color.r); + break; + case SDLK_Z: + decrementColorComponent(color.r); + break; + case SDLK_S: + incrementColorComponent(color.g); + break; + case SDLK_X: + decrementColorComponent(color.g); + break; + case SDLK_D: + incrementColorComponent(color.b); + break; + case SDLK_C: + decrementColorComponent(color.b); + break; + case SDLK_F: + incrementAllComponents(color); + break; + case SDLK_V: + decrementAllComponents(color); + break; + default: + break; } } @@ -194,27 +211,27 @@ void Title::handleControlKeys(SDL_Keycode key) { define_buttons_->enable(0); resetCounter(); break; - + case SDLK_2: define_buttons_->enable(1); resetCounter(); break; - + case SDLK_3: swapControllers(); resetCounter(); break; - + case SDLK_4: swapKeyboard(); resetCounter(); break; - + case SDLK_5: showControllers(); resetCounter(); break; - + default: break; } @@ -235,28 +252,27 @@ void Title::checkInput() { GlobalInputs::check(); } -bool Title::shouldSkipInputCheck() const { +auto Title::shouldSkipInputCheck() const -> bool { return define_buttons_->isEnabled(); } void Title::processControllerInputs() { - for (const auto &controller : Options::controllers) { + for (const auto& controller : Options::controllers) { if (isStartButtonPressed(controller)) { handleStartButtonPress(controller); } } } -bool Title::isStartButtonPressed(const Options::GamepadOptions &controller) const { +auto Title::isStartButtonPressed(const Options::GamepadOptions& controller) -> bool { return Input::get()->checkInput( - InputAction::START, - INPUT_DO_NOT_ALLOW_REPEAT, - controller.type, - controller.index - ); + InputAction::START, + INPUT_DO_NOT_ALLOW_REPEAT, + controller.type, + controller.index); } -void Title::handleStartButtonPress(const Options::GamepadOptions &controller) { +void Title::handleStartButtonPress(const Options::GamepadOptions& controller) { if (!canProcessStartButton()) { return; } @@ -268,7 +284,7 @@ void Title::handleStartButtonPress(const Options::GamepadOptions &controller) { } } -bool Title::canProcessStartButton() const { +auto Title::canProcessStartButton() const -> bool { return (state_ != TitleState::LOGO_ANIMATING || ALLOW_TITLE_ANIMATION_SKIP); } @@ -546,21 +562,21 @@ void Title::initPlayers() { // Actualza los jugadores void Title::updatePlayers() { - for (auto &player : players_) { + for (auto& player : players_) { player->update(); } } // Renderiza los jugadores void Title::renderPlayers() { - for (auto const &player : players_) { + for (auto const& player : players_) { player->render(); } } // Obtiene un jugador a partir de su "id" auto Title::getPlayer(int id) -> std::shared_ptr { - auto it = std::find_if(players_.begin(), players_.end(), [id](const auto &player) { return player->getId() == id; }); + auto it = std::find_if(players_.begin(), players_.end(), [id](const auto& player) { return player->getId() == id; }); if (it != players_.end()) { return *it; diff --git a/source/sections/title.h b/source/sections/title.h index 95753a6..1c4017e 100644 --- a/source/sections/title.h +++ b/source/sections/title.h @@ -1,14 +1,13 @@ #pragma once -#include // Para Uint32 +#include // Para SDL_Keycode, SDL_Event, Uint64 +#include // Para uint8_t -#include // Para unique_ptr, shared_ptr -#include -#include +#include // Para unique_ptr, shared_ptr +#include // Para string_view +#include // Para vector -#include "color.h" // Para Color -#include "options.h" // Para Options -#include "section.hpp" // Para Options +#include "section.hpp" // Para Options, Name (ptr only) class DefineButtons; class Fade; @@ -17,6 +16,10 @@ class Player; class Sprite; class Text; class TiledBG; +namespace Options { +struct GamepadOptions; +} // namespace Options +struct Color; // Textos constexpr std::string_view TEXT_COPYRIGHT = "@2020,2025 JailDesigner"; @@ -33,12 +36,12 @@ constexpr bool ALLOW_TITLE_ANIMATION_SKIP = false; // Clase Title class Title { public: - // --- Constructores y destructor --- + // --- Constructor y destructor --- Title(); ~Title(); - // --- Método principal --- - void run(); // Bucle para el título del juego + // --- Bucle principal --- + void run(); private: // --- Enumeraciones --- @@ -84,18 +87,18 @@ class Title { void resetCounter(); // Reinicia el contador interno // --- Entrada de usuario --- - void checkEvents(); // Comprueba los eventos - void checkInput(); // Comprueba las entradas - void handleKeyDownEvent(const SDL_Event& event); // Maneja el evento de tecla presionada - void handleControlKeys(SDL_Keycode key); // Maneja las teclas de control específicas - bool shouldSkipInputCheck() const; // Determina si se debe omitir la comprobación de entrada - void processControllerInputs(); // Procesa las entradas de los mandos - bool isStartButtonPressed(const Options::GamepadOptions& controller) const; // Comprueba si se ha pulsado el botón Start - void handleStartButtonPress(const Options::GamepadOptions& controller); // Maneja la pulsación del botón Start - bool canProcessStartButton() const; // Verifica si se puede procesar la pulsación del botón Start - void processPlayer1Start(); // Procesa el inicio del jugador 1 - void processPlayer2Start(); // Procesa el inicio del jugador 2 - void activatePlayerAndSetState(int player_id); // Activa al jugador y cambia el estado del título + void checkEvents(); // Comprueba los eventos + void checkInput(); // Comprueba las entradas + void handleKeyDownEvent(const SDL_Event& event); // Maneja el evento de tecla presionada + void handleControlKeys(SDL_Keycode key); // Maneja las teclas de control específicas + [[nodiscard]] auto shouldSkipInputCheck() const -> bool; // Determina si se debe omitir la comprobación de entrada + void processControllerInputs(); // Procesa las entradas de los mandos + [[nodiscard]] static auto isStartButtonPressed(const Options::GamepadOptions& controller) -> bool; // Comprueba si se ha pulsado el botón Start + void handleStartButtonPress(const Options::GamepadOptions& controller); // Maneja la pulsación del botón Start + [[nodiscard]] auto canProcessStartButton() const -> bool; // Verifica si se puede procesar la pulsación del botón Start + void processPlayer1Start(); // Procesa el inicio del jugador 1 + void processPlayer2Start(); // Procesa el inicio del jugador 2 + void activatePlayerAndSetState(int player_id); // Activa al jugador y cambia el estado del título // --- Gestión de jugadores --- void initPlayers(); // Inicializa los jugadores @@ -117,12 +120,12 @@ class Title { // --- Depuración (solo en modo DEBUG) --- #ifdef _DEBUG - void handleDebugColorKeys(SDL_Keycode key); // Maneja las teclas de depuración para colores - void adjustColorComponent(SDL_Keycode key, Color& color); // Ajusta un componente del color según la tecla - void incrementColorComponent(uint8_t& component); // Incrementa un componente de color - void decrementColorComponent(uint8_t& component); // Decrementa un componente de color - void incrementAllComponents(Color& color); // Incrementa todos los componentes del color - void decrementAllComponents(Color& color); // Decrementa todos los componentes del color - void printColorValue(const Color& color); // Imprime el valor actual del color en consola + void handleDebugColorKeys(SDL_Keycode key); // Maneja las teclas de depuración para colores + static void adjustColorComponent(SDL_Keycode key, Color& color); // Ajusta un componente del color según la tecla + static void incrementColorComponent(uint8_t& component); // Incrementa un componente de color + static void decrementColorComponent(uint8_t& component); // Decrementa un componente de color + static void incrementAllComponents(Color& color); // Incrementa todos los componentes del color + static void decrementAllComponents(Color& color); // Decrementa todos los componentes del color + static void printColorValue(const Color& color); // Imprime el valor actual del color en consola #endif }; \ No newline at end of file diff --git a/source/sprite.h b/source/sprite.h index f312dea..34c0b25 100644 --- a/source/sprite.h +++ b/source/sprite.h @@ -1,6 +1,7 @@ #pragma once #include // Para SDL_FRect, SDL_FPoint + #include // Para shared_ptr class Texture; diff --git a/source/tabe.cpp b/source/tabe.cpp index bce069e..f8a35c6 100644 --- a/source/tabe.cpp +++ b/source/tabe.cpp @@ -2,9 +2,10 @@ #include "tabe.h" #include // Para SDL_FlipMode, SDL_GetTicks -#include // Para max -#include // Para array -#include // Para rand, abs + +#include // Para max +#include // Para array +#include // Para rand, abs #include "audio.h" // Para Audio #include "param.h" // Para Param, ParamGame, param diff --git a/source/tabe.h b/source/tabe.h index 5c54737..269d8b6 100644 --- a/source/tabe.h +++ b/source/tabe.h @@ -1,6 +1,7 @@ #pragma once #include // Para Uint32, SDL_GetTicks, SDL_FRect + #include // Para rand #include // Para unique_ptr diff --git a/source/text.cpp b/source/text.cpp index 67a4b27..9104c50 100644 --- a/source/text.cpp +++ b/source/text.cpp @@ -1,6 +1,7 @@ #include "text.h" #include // Para SDL_SetRenderTarget, SDL_GetRenderTarget, Uint8 + #include // Para size_t #include // Para basic_ifstream, basic_istream, basic_ostream #include // Para cerr @@ -232,11 +233,10 @@ void Text::writeDX(Uint8 flags, int x, int y, const std::string &text, int kerni } // Escribe texto a partir de un TextStyle -void Text::writeDX(Uint8 flags, int x, int y, const std::string& text, const TextStyle& style, int length) { +void Text::writeDX(Uint8 flags, int x, int y, const std::string &text, const TextStyle &style, int length) { writeDX(flags, x, y, text, style.kerning, style.text_color, style.shadow_distance, style.shadow_color); } - // Obtiene la longitud en pixels de una cadena auto Text::lenght(const std::string &text, int kerning) const -> int { int shift = 0; diff --git a/source/text.h b/source/text.h index 259055b..578b265 100644 --- a/source/text.h +++ b/source/text.h @@ -1,12 +1,13 @@ #pragma once #include // Para Uint8 -#include // Para array -#include // Para shared_ptr, unique_ptr -#include // Para string -#include "color.h" // Para Color -#include "sprite.h" // Para Sprite +#include // Para array +#include // Para shared_ptr, unique_ptr +#include // Para string + +#include "color.h" // Para Color +#include "sprite.h" // Para Sprite class Texture; diff --git a/source/texture.cpp b/source/texture.cpp index fde4c87..48aa57a 100644 --- a/source/texture.cpp +++ b/source/texture.cpp @@ -2,6 +2,7 @@ #include "texture.h" #include // Para SDL_LogError, SDL_LogCategory, Uint8, SDL_... + #include // Para uint32_t #include // Para memcpy #include // Para basic_ifstream, basic_istream, basic_ios diff --git a/source/texture.h b/source/texture.h index 4b34b38..5adee93 100644 --- a/source/texture.h +++ b/source/texture.h @@ -1,6 +1,7 @@ #pragma once #include // Para Uint8, SDL_Renderer, Uint16, SDL_FlipMode, SDL_PixelFormat, SDL_TextureAccess, SDL_Texture, Uint32, SDL_BlendMode, SDL_FPoint, SDL_FRect + #include // Para array #include // Para size_t #include // Para shared_ptr diff --git a/source/tiled_bg.cpp b/source/tiled_bg.cpp index 3a41b7e..b904b56 100644 --- a/source/tiled_bg.cpp +++ b/source/tiled_bg.cpp @@ -1,6 +1,7 @@ #include "tiled_bg.h" #include // Para SDL_SetRenderTarget, SDL_CreateTexture, SDL_DestroyTexture, SDL_FRect, SDL_GetRenderTarget, SDL_RenderTexture, SDL_PixelFormat, SDL_TextureAccess + #include // Para sin #include // Para rand #include // Para allocator, unique_ptr, make_unique diff --git a/source/tiled_bg.h b/source/tiled_bg.h index 52d93ad..bc000d4 100644 --- a/source/tiled_bg.h +++ b/source/tiled_bg.h @@ -1,9 +1,10 @@ #pragma once #include // Para SDL_FRect, SDL_SetTextureColorMod, SDL_Renderer, SDL_Texture -#include // Para array -#include "color.h" // Para Color +#include // Para array + +#include "color.h" // Para Color // Modos de funcionamiento para el tileado de fondo enum class TiledBGMode : int { diff --git a/source/ui/menu_renderer.cpp b/source/ui/menu_renderer.cpp index 17fc880..72c5e9b 100644 --- a/source/ui/menu_renderer.cpp +++ b/source/ui/menu_renderer.cpp @@ -1,7 +1,7 @@ #include "menu_renderer.h" -#include // Para max -#include // Para pair, move +#include // Para max +#include // Para pair, move #include "color.h" // Para Color, generateMirroredCycle, ColorCycleStyle #include "menu_option.h" // Para MenuOption diff --git a/source/ui/menu_renderer.h b/source/ui/menu_renderer.h index 84d7631..461104c 100644 --- a/source/ui/menu_renderer.h +++ b/source/ui/menu_renderer.h @@ -1,10 +1,11 @@ #pragma once -#include // Para SDL_FRect, Uint32 -#include // Para array -#include // Para size_t -#include // Para shared_ptr, unique_ptr -#include // Para vector +#include // Para SDL_FRect, Uint32 + +#include // Para array +#include // Para size_t +#include // Para shared_ptr, unique_ptr +#include // Para vector #include "color.h" // Para Color #include "ui/service_menu.h" // Para ServiceMenu diff --git a/source/ui/notifier.cpp b/source/ui/notifier.cpp index be37842..bcf6e95 100644 --- a/source/ui/notifier.cpp +++ b/source/ui/notifier.cpp @@ -1,6 +1,7 @@ #include "notifier.h" #include // Para SDL_RenderFillRect, SDL_FRect, SDL_RenderClear + #include // Para remove_if #include // Para basic_string, string #include diff --git a/source/ui/notifier.h b/source/ui/notifier.h index 3e1c711..eb5179e 100644 --- a/source/ui/notifier.h +++ b/source/ui/notifier.h @@ -1,6 +1,7 @@ #pragma once #include // Para SDL_FRect, SDL_Renderer + #include // Para shared_ptr #include // Para basic_string, string #include // Para vector diff --git a/source/ui/service_menu.cpp b/source/ui/service_menu.cpp index d925dbb..786911c 100644 --- a/source/ui/service_menu.cpp +++ b/source/ui/service_menu.cpp @@ -3,7 +3,7 @@ #include // Para max #include "audio.h" // Para Audio -#include "difficulty.h" // Para Difficulty +#include "difficulty.h" // Para Difficulty #include "lang.h" // Para getText, getCodeFromName, getNameFromCode #include "menu_option.h" // Para MenuOption, BoolOption, ActionOption, IntOption, FolderOption, ListOption #include "menu_renderer.h" // Para MenuRenderer diff --git a/source/ui/ui_message.h b/source/ui/ui_message.h index c1fadfc..f692419 100644 --- a/source/ui/ui_message.h +++ b/source/ui/ui_message.h @@ -1,7 +1,7 @@ #pragma once -#include // Para shared_ptr -#include // Para string +#include // Para shared_ptr +#include // Para string #include "color.h" // Para Color diff --git a/source/utils.cpp b/source/utils.cpp index 57983c5..05dc291 100644 --- a/source/utils.cpp +++ b/source/utils.cpp @@ -2,6 +2,7 @@ #include "utils.h" #include // Para SDL_RenderPoint, SDL_FRect, SDL_CloseIO, SDL_IOFromFile, SDL_LogCategory, SDL_LogError, SDL_LogInfo, SDL_ReadIO, SDL_FPoint, SDL_Renderer + #include // Para clamp, find_if_not, find, transform #include // Para tolower, isspace #include // Para pow, sin, M_PI, cos @@ -11,7 +12,7 @@ #include // Para runtime_error #include // Para basic_string, allocator, string, operator==, operator+, char_traits -#include "lang.h" // Para getText +#include "lang.h" // Para getText // Variables Overrides overrides = Overrides(); diff --git a/source/utils.h b/source/utils.h index 1dcc1d0..9d85813 100644 --- a/source/utils.h +++ b/source/utils.h @@ -2,9 +2,10 @@ #pragma once #include // Para Uint8, SDL_FRect, SDL_FPoint, SDL_Renderer -#include // Para int32_t -#include // Para string -#include // Para vector + +#include // Para int32_t +#include // Para string +#include // Para vector // --- Constantes --- constexpr int BLOCK = 8;