mil merdertes

This commit is contained in:
2025-07-21 13:18:43 +02:00
parent 296ef1e709
commit ea5cedfd26
36 changed files with 94 additions and 76 deletions

View File

@@ -10,10 +10,3 @@ AlignOperands: false
AlignAfterOpenBracket: DontAlign
BinPackArguments: false
BinPackParameters: false
SortIncludes: CaseSensitive
IncludeBlocks: Merge
IncludeCategories:
- Regex: '.*'
Priority: 1
SortPriority: -1

View File

@@ -20,7 +20,6 @@ set(APP_SOURCES
# --- Archivos Principales del Sistema ---
source/main.cpp
source/director.cpp
source/section.cpp
source/screen.cpp
source/resource.cpp
source/asset.cpp
@@ -36,6 +35,7 @@ set(APP_SOURCES
# --- UI (User Interface) ---
source/ui/service_menu.cpp
source/ui/menu_renderer.cpp
source/ui/notifier.cpp
source/ui/ui_message.cpp
# --- Lógica del Juego ---
@@ -74,7 +74,6 @@ set(APP_SOURCES
# --- Otros ---
source/define_buttons.cpp
source/mouse.cpp
source/notifier.cpp
source/stage.cpp
source/tabe.cpp
source/text.cpp

View File

@@ -4,7 +4,7 @@ SOURCEPATH=../source/
for i in "$SOURCEPATH"/*.cpp
do
include-what-you-use -D DEBUG -D VERBOSE -std=c++20 -Wall "$i"
include-what-you-use -D DEBUG -std=c++20 -Wall "$i"
read -r -p "Presiona cualquier tecla para continuar..."
clear
done

View File

@@ -0,0 +1,16 @@
#!/bin/bash
# Verifica que se haya proporcionado un archivo como argumento
if [ $# -eq 0 ]; then
echo "Uso: $0 <archivo.cpp>"
exit 1
fi
FILE="$1"
include-what-you-use -D DEBUG -D VERBOSE -std=c++20 -Wall "$FILE" \
-Xiwyu --mapping_file=sdl3_mapping.imp \
-Xiwyu --update_comments \
-Xiwyu --verbose=3 \
| \
python3 /usr/bin/fix_includes.py --update_comments

View File

@@ -1,2 +1,6 @@
Desde l'arrel del projecte executar:
# Per a un fitxer, desde l'arrel del projecte executar:
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

View File

@@ -2,9 +2,10 @@
#include <SDL3/SDL.h> // Para SDL_FRect
#include <algorithm> // Para max
#include <cstddef> // Para size_t
#include <memory> // Para shared_ptr
#include <string> // Para basic_string, string, hash
#include <memory> // Para allocator, shared_ptr
#include <string> // Para string, hash
#include <unordered_map> // Para unordered_map
#include <vector> // Para vector

View File

@@ -1,8 +1,8 @@
#pragma once
#include <string> // Para string, basic_string
#include <utility>
#include <vector> // Para vector
#include <string> // Para string
#include <utility> // Para move
#include <vector> // Para vector
// Tipos de recursos gestionados por Asset
enum class AssetType : int {

View File

@@ -1,7 +1,7 @@
#pragma once
#include <string>
#include <utility>
#include <string> // Para string
#include <utility> // Para move
// Clase Audio: gestor de audio (singleton)
class Audio {

View File

@@ -1,13 +1,20 @@
#include "asset.h"
#include "balloon.h" // Para BalloonType, BalloonSize, BALLOON_SIZE, BALLOON_VELX_NEGATIVE, BALLOON_VELX_POSITIVE
#include "balloon_formations.h"
#include "param.h" // Para Param, ParamGame, param
#include "utils.h" // Para Zone, BLOCK
#include <array> // Para array
#include <fstream>
#include <map>
#include <sstream>
#include <string>
#include <stddef.h> // Para size_t
#include <algorithm> // Para max
#include <array> // Para array
#include <cctype> // Para isdigit
#include <exception> // Para exception
#include <fstream> // Para basic_istream, basic_ifstream, ifstream, istringstream
#include <map> // Para map, operator==
#include <sstream> // Para basic_istringstream
#include <string> // Para allocator, char_traits, operator==, string, operator<=>, basic_string, stoi, getline
#include "asset.h" // Para Asset
#include "balloon.h" // Para BALLOON_SIZE, BalloonSize, BalloonType, BALLOON_VELX_NEGATIVE, BALLOON_VELX_POSITIVE
#include "param.h" // Para Param, ParamGame, param
#include "utils.h" // Para Zone, BLOCK
void BalloonFormations::initFormations() {
// Calcular posiciones base

View File

@@ -1,12 +1,12 @@
#pragma once
#include "balloon.h" // Para BALLOON_VELX_NEGATIVE, BALLOON_VELX_POSITIVE
#include <fstream>
#include <map>
#include <optional>
#include <sstream>
#include <string>
#include <vector>
#include <algorithm> // Para copy
#include <map> // Para map
#include <optional> // Para optional
#include <string> // Para string
#include <vector> // Para vector
#include "balloon.h" // Para BalloonSize, BalloonType
// --- Constantes de configuración ---

View File

@@ -2,10 +2,11 @@
#include <SDL3/SDL.h> // Para SDL_FRect
#include <array> // Para array
#include <memory> // Para shared_ptr, unique_ptr
#include <string> // Para string
#include <vector> // Para vector
#include <algorithm> // Para max
#include <array> // Para array
#include <memory> // Para shared_ptr, unique_ptr
#include <string> // Para string
#include <vector> // Para vector
#include "balloon.h" // Para BALLOON_SPEED, Balloon, BalloonSize (ptr only), BalloonType (ptr only)
#include "balloon_formations.h" // Para BalloonFormations

View File

@@ -21,12 +21,11 @@
#include "input.h" // Para Input, InputAction
#include "lang.h" // Para setLanguage
#include "manage_hiscore_table.h" // Para ManageHiScoreTable
#include "notifier.h" // Para Notifier
#include "options.h" // Para GamepadOptions, controllers, loa...
#include "param.h" // Para loadParamsFromFile
#include "resource.h" // Para Resource
#include "screen.h" // Para Screen
#include "section.h" // Para Name, Options, name, options
#include "section.hpp" // Para Name, Options, name, options
#include "sections/credits.h" // Para Credits
#include "sections/game.h" // Para Game, GAME_MODE_DEMO_OFF, GAME_M...
#include "sections/hiscore_table.h" // Para HiScoreTable
@@ -34,6 +33,7 @@
#include "sections/intro.h" // Para Intro
#include "sections/logo.h" // Para Logo
#include "sections/title.h" // Para Title
#include "ui/notifier.h" // Para Notifier
#include "ui/service_menu.h" // Para ServiceMenu
#include "utils.h" // Para Overrides, overrides, getPath

View File

@@ -1,5 +1,7 @@
#include "explosions.h"
#include <algorithm> // Para max
#include "animated_sprite.h" // Para AnimatedSprite
class Texture; // lines 4-4

View File

@@ -4,7 +4,7 @@
#include "mouse.h" // Para handleEvent
#include "screen.h"
#include "section.h" // Para Name, Options, name, options
#include "section.hpp" // Para Name, Options, name, options
namespace GlobalEvents {
// Comprueba los eventos que se pueden producir en cualquier sección del juego

View File

@@ -7,10 +7,10 @@
#include "audio.h" // Para Audio
#include "input.h" // Para Input, INPUT_DO_NOT_ALLOW_REPEAT, Input...
#include "lang.h" // Para getText, Code, getNextLangCode, loadFro...
#include "notifier.h" // Para Notifier
#include "options.h" // Para SettingsOptions, settings, VideoOptions
#include "screen.h" // Para Screen
#include "section.h" // Para Name, name, Options, options, AttractMode
#include "section.hpp" // Para Name, name, Options, options, AttractMode
#include "ui/notifier.h" // Para Notifier
#include "ui/service_menu.h" // Para ServiceMenu
#include "utils.h" // Para boolToOnOff

View File

@@ -2,9 +2,10 @@
#include <SDL3/SDL.h> // Para SDL_GamepadButton, SDL_ScaleMode
#include <string> // Para string, basic_string
#include <utility>
#include <vector> // Para vector
#include <algorithm> // Para copy
#include <string> // Para allocator, string
#include <utility> // Para move
#include <vector> // Para vector
#include "input.h" // Para InputAction, InputDevice
#include "lang.h" // Para Code

View File

@@ -11,11 +11,11 @@
#include "asset.h" // Para Asset
#include "external/jail_shader.h" // Para init, render
#include "mouse.h" // Para updateCursorVisibility
#include "notifier.h" // Para Notifier
#include "options.h" // Para VideoOptions, video, WindowOptions
#include "param.h" // Para Param, param, ParamGame, ParamDebug
#include "text.h" // Para Text, TEXT_COLOR, TEXT_STROKE
#include "texture.h" // Para Texture
#include "ui/notifier.h" // Para Notifier
#include "ui/service_menu.h" // Para ServiceMenu
// Singleton

View File

@@ -1,7 +0,0 @@
#include "section.h"
namespace Section {
Name name;
Options options;
AttractMode attract_mode;
} // namespace Section

View File

@@ -42,7 +42,7 @@ enum class AttractMode {
};
// --- Variables globales de estado ---
extern Name name; // Sección actual
extern Options options; // Opción seleccionada en la sección
extern AttractMode attract_mode; // Estado del Attract Mode
inline Name name = Name::RESET;
inline Options options = Options::NONE;
inline AttractMode attract_mode = AttractMode::TITLE_TO_DEMO;
} // namespace Section

View File

@@ -21,7 +21,7 @@
#include "player.h" // Para Player, PlayerState
#include "resource.h" // Para Resource
#include "screen.h" // Para Screen
#include "section.h" // Para Name, name
#include "section.hpp" // Para Name, name
#include "sprite.h" // Para Sprite
#include "text.h" // Para Text, TEXT_CENTER, TEXT_SHADOW
#include "texture.h" // Para Texture

View File

@@ -21,19 +21,19 @@
#include "item.h" // Para Item, ItemType
#include "lang.h" // Para getText
#include "manage_hiscore_table.h" // Para HiScoreEntry, ManageHiScoreTable
#include "notifier.h" // Para Notifier
#include "param.h" // Para Param, param, ParamGame, ParamScor...
#include "path_sprite.h" // Para Path, PathSprite, createPath, Path...
#include "player.h" // Para Player, PlayerState
#include "resource.h" // Para Resource
#include "scoreboard.h" // Para Scoreboard, ScoreboardMode, SCOREB...
#include "screen.h" // Para Screen
#include "section.h" // Para Name, name, AttractMode, Options
#include "section.hpp" // Para Name, name, AttractMode, Options
#include "smart_sprite.h" // Para SmartSprite
#include "stage.h" // Para number, get, Stage, total_power
#include "tabe.h" // Para Tabe, TabeState
#include "text.h" // Para Text
#include "texture.h" // Para Texture
#include "ui/notifier.h" // Para Notifier
#include "ui/service_menu.h" // Para ServiceMenu
// Constructor

View File

@@ -20,7 +20,7 @@
#include "path_sprite.h" // Para PathSprite, Path, PathType
#include "resource.h" // Para Resource
#include "screen.h" // Para Screen
#include "section.h" // Para Name, name, Options, options
#include "section.hpp" // Para Name, name, Options, options
#include "sprite.h" // Para Sprite
#include "text.h" // Para Text, TEXT_SHADOW, TEXT_COLOR
#include "texture.h" // Para Texture

View File

@@ -17,7 +17,7 @@
#include "param.h" // Para Param, param, ParamGame, ParamFade, Param...
#include "resource.h" // Para Resource
#include "screen.h" // Para Screen
#include "section.h" // Para Name, name, Options, options
#include "section.hpp" // Para Name, name, Options, options
#include "sprite.h" // Para Sprite
#include "text.h" // Para Text, TEXT_CENTER, TEXT_COLOR, TEXT_SHADOW
#include "tiled_bg.h" // Para TiledBG, TiledBGMode

View File

@@ -18,7 +18,7 @@
#include "path_sprite.h" // Para PathSprite, PathType
#include "resource.h" // Para Resource
#include "screen.h" // Para Screen
#include "section.h" // Para Name, name, Options, options
#include "section.hpp" // Para Name, name, Options, options
#include "text.h" // Para Text
#include "texture.h" // Para Texture
#include "tiled_bg.h" // Para TiledBG, TiledBGMode

View File

@@ -12,7 +12,7 @@
#include "param.h" // Para Param, ParamGame, param
#include "resource.h" // Para Resource
#include "screen.h" // Para Screen
#include "section.h" // Para Name, name
#include "section.hpp" // Para Name, name
#include "sprite.h" // Para Sprite
#include "texture.h" // Para Texture
#include "utils.h" // Para Color, Zone

View File

@@ -16,16 +16,16 @@
#include "global_inputs.h" // Para check
#include "input.h" // Para Input, INPUT_DO_NOT_ALLOW_REPEAT, Input...
#include "lang.h" // Para getText
#include "notifier.h" // Para Notifier
#include "options.h" // Para GamepadOptions, controllers, getPlayerW...
#include "param.h" // Para Param, param, ParamGame, ParamTitle
#include "player.h" // Para Player, PlayerState
#include "resource.h" // Para Resource
#include "screen.h" // Para Screen
#include "section.h" // Para Name, name, Options, options, AttractMode
#include "section.hpp" // Para Name, name, Options, options, AttractMode
#include "sprite.h" // Para Sprite
#include "text.h" // Para TEXT_CENTER, TEXT_SHADOW, Text
#include "tiled_bg.h" // Para TiledBG, TiledBGMode
#include "ui/notifier.h" // Para Notifier
#include "ui/service_menu.h" // Para ServiceMenu
#include "utils.h" // Para Color, Zone, NO_TEXT_COLOR, TITLE_SHADO...

View File

@@ -6,7 +6,7 @@
#include <string_view>
#include <vector>
#include "section.h" // Para Options
#include "section.hpp" // Para Options
class DefineButtons;
class Fade;

View File

@@ -1,6 +1,6 @@
#include "sprite.h"
#include <utility>
#include <utility> // Para move
#include "texture.h" // Para Texture

View File

@@ -1,6 +1,6 @@
#pragma once
#include <vector>
#include <vector> // Para vector
/*
Namespace Stage: gestiona los datos y operaciones de las fases del juego.

View File

@@ -8,7 +8,7 @@
#include "lang.h" // Para las traducciones
#include "options.h" // Para acceder a las variables de configuración
#include "section.h" // Para las acciones como Quit o Reset
#include "section.hpp" // Para las acciones como Quit o Reset
#include "text.h" // Para poder calcular el ancho del texto
#include "ui/service_menu.h" // Necesitamos las enums como SettingsGroup

View File

@@ -1,7 +1,7 @@
#include "menu_renderer.h"
#include <algorithm> // Para max
#include <utility> // Para pair, move
#include <algorithm> // Para max
#include <utility> // Para pair, move
#include "menu_option.h" // Para MenuOption
#include "param.h" // Para Param, param, ParamServiceMenu, ParamGame

View File

@@ -1,6 +1,7 @@
#pragma once
#include <SDL3/SDL.h> // Para SDL_FRect, Uint32
#include <array>
#include <cstddef> // Para size_t
#include <memory> // Para shared_ptr, unique_ptr

View File

@@ -1,6 +1,6 @@
#include "ui/service_menu.h"
#include <algorithm> // Para max
#include <algorithm> // Para max
#include "audio.h" // Para Audio
#include "lang.h" // Para getText, getCodeFromName, getNameFromCode
@@ -10,7 +10,7 @@
#include "param.h" // Para Param, param, ParamGame, ParamServiceMenu
#include "resource.h" // Para Resource
#include "screen.h" // Para Screen
#include "section.h" // Para Name, name, Options, options
#include "section.hpp" // Para Name, name, Options, options
#include "ui/ui_message.h" // Para UIMessage
#include "utils.h" // Para Zone

View File

@@ -1,7 +1,7 @@
// IWYU pragma: no_include <bits/std_abs.h>
#pragma once
#include <SDL3/SDL.h> // Para Uint8, SDL_FRect, SDL_FPoint, SDL_Renderer
#include <SDL3/SDL.h> // Para Uint8, SDL_FRect, SDL_FPoint, SDL_Renderer
#include <algorithm> // Para max, min
#include <array> // Para array