From f80d0a656e4504c7b1765b7fdd97053659c56c1b Mon Sep 17 00:00:00 2001 From: Sergio Date: Tue, 14 Apr 2026 13:26:30 +0200 Subject: [PATCH] idem --- CLAUDE.md | 38 +- CMakeLists.txt | 187 ++++---- source/core/audio/audio.cpp | 8 +- source/core/input/define_buttons.cpp | 18 +- source/core/input/define_buttons.hpp | 4 +- source/core/input/gamepad_config_manager.hpp | 2 +- source/core/input/global_inputs.cpp | 22 +- source/core/input/input.cpp | 2 +- source/core/input/input.hpp | 4 +- source/core/input/input_types.cpp | 2 +- source/core/input/mouse.cpp | 2 +- source/core/locale/lang.cpp | 12 +- source/core/rendering/background.cpp | 18 +- source/core/rendering/background.hpp | 2 +- source/core/rendering/fade.cpp | 8 +- source/core/rendering/gif.cpp | 425 +++++++++--------- source/core/rendering/gif.hpp | 134 +++--- source/core/rendering/screen.cpp | 26 +- source/core/rendering/screen.hpp | 6 +- .../core/rendering/sdl3gpu/sdl3gpu_shader.cpp | 12 +- .../core/rendering/sdl3gpu/sdl3gpu_shader.hpp | 2 +- .../core/rendering/sprite/animated_sprite.cpp | 6 +- .../core/rendering/sprite/animated_sprite.hpp | 2 +- source/core/rendering/sprite/card_sprite.cpp | 6 +- source/core/rendering/sprite/card_sprite.hpp | 2 +- .../core/rendering/sprite/moving_sprite.cpp | 4 +- .../core/rendering/sprite/moving_sprite.hpp | 2 +- source/core/rendering/sprite/path_sprite.cpp | 2 +- source/core/rendering/sprite/path_sprite.hpp | 2 +- source/core/rendering/sprite/smart_sprite.cpp | 4 +- source/core/rendering/sprite/smart_sprite.hpp | 2 +- source/core/rendering/sprite/sprite.cpp | 4 +- source/core/rendering/text.cpp | 14 +- source/core/rendering/text.hpp | 4 +- source/core/rendering/texture.cpp | 12 +- source/core/rendering/tiled_bg.cpp | 8 +- source/core/rendering/tiled_bg.hpp | 2 +- source/core/rendering/writer.cpp | 4 +- source/core/resources/asset.cpp | 6 +- source/core/resources/asset_integrated.cpp | 2 +- source/core/resources/asset_integrated.hpp | 4 +- source/core/resources/resource.cpp | 22 +- source/core/resources/resource.hpp | 8 +- source/core/resources/resource_helper.cpp | 4 +- source/core/resources/resource_loader.cpp | 4 +- source/core/resources/resource_pack.cpp | 2 +- source/core/system/defaults.hpp | 2 +- source/core/system/demo.cpp | 6 +- source/core/system/director.cpp | 52 +-- source/core/system/director.hpp | 2 +- source/core/system/global_events.cpp | 18 +- source/core/system/shutdown.cpp | 2 +- source/core/system/system_utils.cpp | 2 +- source/game/entities/balloon.cpp | 12 +- source/game/entities/balloon.hpp | 4 +- source/game/entities/bullet.cpp | 6 +- source/game/entities/bullet.hpp | 4 +- source/game/entities/explosions.cpp | 4 +- source/game/entities/explosions.hpp | 2 +- source/game/entities/item.cpp | 6 +- source/game/entities/item.hpp | 4 +- source/game/entities/player.cpp | 24 +- source/game/entities/player.hpp | 16 +- source/game/entities/tabe.cpp | 10 +- source/game/entities/tabe.hpp | 2 +- source/game/gameplay/balloon_formations.cpp | 10 +- source/game/gameplay/balloon_formations.hpp | 2 +- source/game/gameplay/balloon_manager.cpp | 20 +- source/game/gameplay/balloon_manager.hpp | 10 +- source/game/gameplay/bullet_manager.cpp | 8 +- source/game/gameplay/bullet_manager.hpp | 2 +- source/game/gameplay/difficulty.cpp | 2 +- source/game/gameplay/enter_name.cpp | 2 +- source/game/gameplay/game_logo.cpp | 20 +- source/game/gameplay/game_logo.hpp | 6 +- source/game/gameplay/manage_hiscore_table.cpp | 4 +- source/game/gameplay/scoreboard.cpp | 22 +- source/game/gameplay/scoreboard.hpp | 2 +- source/game/gameplay/stage.cpp | 2 +- source/game/gameplay/stage.hpp | 2 +- source/game/options.cpp | 12 +- source/game/options.hpp | 14 +- source/game/scenes/credits.cpp | 40 +- source/game/scenes/credits.hpp | 8 +- source/game/scenes/game.cpp | 68 +-- source/game/scenes/game.hpp | 12 +- source/game/scenes/hiscore_table.cpp | 40 +- source/game/scenes/hiscore_table.hpp | 4 +- source/game/scenes/instructions.cpp | 34 +- source/game/scenes/intro.cpp | 34 +- source/game/scenes/intro.hpp | 10 +- source/game/scenes/logo.cpp | 26 +- source/game/scenes/logo.hpp | 2 +- source/game/scenes/title.cpp | 44 +- source/game/scenes/title.hpp | 4 +- source/game/ui/menu_option.cpp | 4 +- source/game/ui/menu_option.hpp | 6 +- source/game/ui/menu_renderer.cpp | 14 +- source/game/ui/menu_renderer.hpp | 4 +- source/game/ui/notifier.cpp | 14 +- source/game/ui/notifier.hpp | 4 +- source/game/ui/service_menu.cpp | 34 +- source/game/ui/service_menu.hpp | 4 +- source/game/ui/ui_message.cpp | 4 +- source/game/ui/ui_message.hpp | 2 +- source/game/ui/window_message.cpp | 8 +- source/game/ui/window_message.hpp | 6 +- source/main.cpp | 2 +- source/utils/color.cpp | 2 +- source/utils/param.cpp | 8 +- source/utils/param.hpp | 8 +- source/utils/utils.cpp | 4 +- tools/pack_resources/Makefile | 4 +- tools/pack_resources/README.md | 4 +- tools/pack_resources/pack_resources.cpp | 2 +- tools/shaders/compile_spirv.sh | 2 +- 116 files changed, 933 insertions(+), 917 deletions(-) diff --git a/CLAUDE.md b/CLAUDE.md index 0e54d9b..31e2ef4 100644 --- a/CLAUDE.md +++ b/CLAUDE.md @@ -44,24 +44,38 @@ make tidy-fix # run clang-tidy with auto-fix ## Architecture -### Singletons (core systems) -- **Director** (`source/director.hpp`) — Application state machine, orchestrates scene transitions (Logo → Intro → Title → Game → Credits/HiScore → Title) -- **Screen** (`source/screen.hpp`) — Window management, SDL3 GPU rendering pipeline, post-processing effects -- **Resource** (`source/resource.hpp`) — Asset loading/caching with PRELOAD and LAZY_LOAD modes, reads from `resources.pack` -- **Audio** (`source/audio.hpp`) — Music and SFX management -- **Input** (`source/input.hpp`) — Keyboard and gamepad input handling +### Source layout +The `source/` tree is organised in the same style as the sibling projects `projecte_2026` and `jaildoctors_dilemma`: -### Scenes (source/sections/) +``` +source/ +├── core/ # engine: audio, input, locale, rendering (+ sdl3gpu, sprite), resources, system +├── game/ # gameplay: entities, gameplay, scenes, ui, options +├── utils/ # color, param, utils +├── external/ # vendored third-party headers (json, fkyaml, stb_*) +└── main.cpp +``` + +`#include` paths are absolute relative to `source/` (e.g. `#include "core/audio/audio.hpp"`, `#include "game/scenes/logo.hpp"`). The CMake build adds a single `-I${CMAKE_SOURCE_DIR}/source`. + +### Singletons (core systems) +- **Director** (`source/core/system/director.hpp`) — Application state machine, orchestrates scene transitions (Logo → Intro → Title → Game → Credits/HiScore → Title) +- **Screen** (`source/core/rendering/screen.hpp`) — Window management, SDL3 GPU rendering pipeline, post-processing effects +- **Resource** (`source/core/resources/resource.hpp`) — Asset loading/caching with PRELOAD and LAZY_LOAD modes, reads from `resources.pack` +- **Audio** (`source/core/audio/audio.hpp`) — Music and SFX management +- **Input** (`source/core/input/input.hpp`) — Keyboard and gamepad input handling + +### Scenes (source/game/scenes/) Each scene is a self-contained class with update/render lifecycle. Scene flow is managed by Director. ### Entity Managers -- `BalloonManager` / `BulletManager` — Object pool-based entity management -- `Player` — Two-player support (player 1: keyboard, player 2: gamepad) +- `BalloonManager` / `BulletManager` — Object pool-based entity management (`source/game/gameplay/`) +- `Player` — Two-player support (player 1: keyboard, player 2: gamepad) (`source/game/entities/`) ### Rendering Pipeline - SDL3 GPU API (Vulkan/Metal/D3D12 backends) - SPIR-V shaders compiled offline from GLSL (`data/shaders/`) via `glslc` -- Compiled shader headers embedded in `source/rendering/sdl3gpu/postfx_*_spv.h` +- Compiled shader headers embedded in `source/core/rendering/sdl3gpu/postfx_*_spv.h` - macOS uses Metal (no SPIR-V compilation needed) ### Configuration @@ -72,7 +86,9 @@ Each scene is a self-contained class with update/render lifecycle. Scene flow is - Gamepad mappings: `config/gamecontrollerdb.txt` ### External Libraries (header-only/vendored in source/external/) -- nlohmann/json, fkyaml (YAML), stb_image, stb_vorbis, jail_audio +- nlohmann/json, fkyaml (YAML), stb_image, stb_vorbis + +`jail_audio` lives in `source/core/audio/` and `gif.{hpp,cpp}` in `source/core/rendering/` — these are first-party, not third-party. ## Code Style diff --git a/CMakeLists.txt b/CMakeLists.txt index 9230352..eca6bfe 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -28,91 +28,96 @@ configure_file(${CMAKE_SOURCE_DIR}/source/version.h.in ${CMAKE_BINARY_DIR}/versi # --- 1. LISTA EXPLÍCITA DE FUENTES --- set(APP_SOURCES - # --- Archivos Principales del Sistema --- - source/asset.cpp - source/audio.cpp - source/director.cpp - source/global_events.cpp - source/global_inputs.cpp - source/input.cpp - source/lang.cpp source/main.cpp - source/param.cpp - source/resource.cpp - source/resource_helper.cpp - source/resource_loader.cpp - source/resource_pack.cpp - source/screen.cpp - source/text.cpp - source/writer.cpp - - # --- UI (User Interface) --- - source/ui/menu_option.cpp - source/ui/menu_renderer.cpp - source/ui/notifier.cpp - source/ui/service_menu.cpp - source/ui/ui_message.cpp - source/ui/window_message.cpp - - # --- Lógica del Juego --- - source/balloon_formations.cpp - source/balloon_manager.cpp - source/balloon.cpp - source/bullet.cpp - source/bullet_manager.cpp - source/enter_name.cpp - source/explosions.cpp - source/game_logo.cpp - source/item.cpp - source/manage_hiscore_table.cpp - source/player.cpp - source/scoreboard.cpp - source/tabe.cpp - - # --- Escenas --- - source/sections/credits.cpp - source/sections/game.cpp - source/sections/hiscore_table.cpp - source/sections/instructions.cpp - source/sections/intro.cpp - source/sections/logo.cpp - source/sections/title.cpp - - # --- Sprites y Gráficos --- - source/animated_sprite.cpp - source/background.cpp - source/card_sprite.cpp - source/fade.cpp - source/moving_sprite.cpp - source/path_sprite.cpp - source/smart_sprite.cpp - source/sprite.cpp - source/texture.cpp - source/tiled_bg.cpp - - # --- Otros --- - source/color.cpp - source/demo.cpp - source/define_buttons.cpp - source/difficulty.cpp - source/input_types.cpp - source/mouse.cpp - source/options.cpp - source/shutdown.cpp - source/stage.cpp - source/system_utils.cpp - source/utils.cpp -) -# Fuentes de librerías de terceros -set(EXTERNAL_SOURCES - source/external/json.hpp - source/external/gif.cpp -) + # --- core/audio --- + source/core/audio/audio.cpp -# Fuentes del sistema de renderizado -set(RENDERING_SOURCES - source/rendering/sdl3gpu/sdl3gpu_shader.cpp + # --- core/input --- + source/core/input/define_buttons.cpp + source/core/input/global_inputs.cpp + source/core/input/input.cpp + source/core/input/input_types.cpp + source/core/input/mouse.cpp + + # --- core/locale --- + source/core/locale/lang.cpp + + # --- core/rendering --- + source/core/rendering/background.cpp + source/core/rendering/fade.cpp + source/core/rendering/gif.cpp + source/core/rendering/screen.cpp + source/core/rendering/text.cpp + source/core/rendering/texture.cpp + source/core/rendering/tiled_bg.cpp + source/core/rendering/writer.cpp + source/core/rendering/sdl3gpu/sdl3gpu_shader.cpp + source/core/rendering/sprite/animated_sprite.cpp + source/core/rendering/sprite/card_sprite.cpp + source/core/rendering/sprite/moving_sprite.cpp + source/core/rendering/sprite/path_sprite.cpp + source/core/rendering/sprite/smart_sprite.cpp + source/core/rendering/sprite/sprite.cpp + + # --- core/resources --- + source/core/resources/asset.cpp + source/core/resources/asset_integrated.cpp + source/core/resources/resource.cpp + source/core/resources/resource_helper.cpp + source/core/resources/resource_loader.cpp + source/core/resources/resource_pack.cpp + + # --- core/system --- + source/core/system/demo.cpp + source/core/system/director.cpp + source/core/system/global_events.cpp + source/core/system/shutdown.cpp + source/core/system/system_utils.cpp + + # --- game --- + source/game/options.cpp + + # --- game/entities --- + source/game/entities/balloon.cpp + source/game/entities/bullet.cpp + source/game/entities/explosions.cpp + source/game/entities/item.cpp + source/game/entities/player.cpp + source/game/entities/tabe.cpp + + # --- game/gameplay --- + source/game/gameplay/balloon_formations.cpp + source/game/gameplay/balloon_manager.cpp + source/game/gameplay/bullet_manager.cpp + source/game/gameplay/difficulty.cpp + source/game/gameplay/enter_name.cpp + source/game/gameplay/game_logo.cpp + source/game/gameplay/manage_hiscore_table.cpp + source/game/gameplay/scoreboard.cpp + source/game/gameplay/stage.cpp + + # --- game/scenes --- + source/game/scenes/credits.cpp + source/game/scenes/game.cpp + source/game/scenes/hiscore_table.cpp + source/game/scenes/instructions.cpp + source/game/scenes/intro.cpp + source/game/scenes/logo.cpp + source/game/scenes/title.cpp + + # --- game/ui --- + source/game/ui/menu_option.cpp + source/game/ui/menu_renderer.cpp + source/game/ui/notifier.cpp + source/game/ui/service_menu.cpp + source/game/ui/ui_message.cpp + source/game/ui/window_message.cpp + + # --- utils --- + source/utils/color.cpp + source/utils/param.cpp + source/utils/utils.cpp ) # Configuración de SDL3 @@ -129,11 +134,11 @@ if(NOT APPLE) set(SHADER_UPSCALE_SRC "${CMAKE_SOURCE_DIR}/data/shaders/upscale.frag") set(SHADER_DOWNSCALE_SRC "${CMAKE_SOURCE_DIR}/data/shaders/downscale.frag") - set(SHADER_VERT_H "${CMAKE_SOURCE_DIR}/source/rendering/sdl3gpu/postfx_vert_spv.h") - set(SHADER_FRAG_H "${CMAKE_SOURCE_DIR}/source/rendering/sdl3gpu/postfx_frag_spv.h") - set(SHADER_CRTPI_H "${CMAKE_SOURCE_DIR}/source/rendering/sdl3gpu/crtpi_frag_spv.h") - set(SHADER_UPSCALE_H "${CMAKE_SOURCE_DIR}/source/rendering/sdl3gpu/upscale_frag_spv.h") - set(SHADER_DOWNSCALE_H "${CMAKE_SOURCE_DIR}/source/rendering/sdl3gpu/downscale_frag_spv.h") + set(SHADER_VERT_H "${CMAKE_SOURCE_DIR}/source/core/rendering/sdl3gpu/postfx_vert_spv.h") + set(SHADER_FRAG_H "${CMAKE_SOURCE_DIR}/source/core/rendering/sdl3gpu/postfx_frag_spv.h") + set(SHADER_CRTPI_H "${CMAKE_SOURCE_DIR}/source/core/rendering/sdl3gpu/crtpi_frag_spv.h") + set(SHADER_UPSCALE_H "${CMAKE_SOURCE_DIR}/source/core/rendering/sdl3gpu/upscale_frag_spv.h") + set(SHADER_DOWNSCALE_H "${CMAKE_SOURCE_DIR}/source/core/rendering/sdl3gpu/downscale_frag_spv.h") set(ALL_SHADER_SOURCES "${SHADER_VERT_SRC}" "${SHADER_FRAG_SRC}" "${SHADER_CRTPI_SRC}" "${SHADER_UPSCALE_SRC}" "${SHADER_DOWNSCALE_SRC}") set(ALL_SHADER_HEADERS "${SHADER_VERT_H}" "${SHADER_FRAG_H}" "${SHADER_CRTPI_H}" "${SHADER_UPSCALE_H}" "${SHADER_DOWNSCALE_H}") @@ -183,7 +188,7 @@ else() endif() # --- 2. AÑADIR EJECUTABLE --- -add_executable(${PROJECT_NAME} ${APP_SOURCES} ${EXTERNAL_SOURCES} ${RENDERING_SOURCES}) +add_executable(${PROJECT_NAME} ${APP_SOURCES}) if(NOT APPLE AND GLSLC_EXE) add_dependencies(${PROJECT_NAME} shaders) @@ -192,9 +197,6 @@ endif() # --- 3. DIRECTORIOS DE INCLUSIÓN --- target_include_directories(${PROJECT_NAME} PUBLIC "${CMAKE_SOURCE_DIR}/source" - "${CMAKE_SOURCE_DIR}/source/external" - "${CMAKE_SOURCE_DIR}/source/rendering" - "${CMAKE_SOURCE_DIR}/source/rendering/sdl3gpu" "${CMAKE_BINARY_DIR}" ) @@ -331,9 +333,6 @@ if(CPPCHECK_EXE) -DLINUX_BUILD --quiet -I ${CMAKE_SOURCE_DIR}/source - -I ${CMAKE_SOURCE_DIR}/source/external - -I ${CMAKE_SOURCE_DIR}/source/rendering - -I ${CMAKE_SOURCE_DIR}/source/rendering/sdl3gpu ${CPPCHECK_SOURCES} WORKING_DIRECTORY ${CMAKE_SOURCE_DIR} COMMENT "Running cppcheck..." diff --git a/source/core/audio/audio.cpp b/source/core/audio/audio.cpp index 2ccb4b9..7e25f8b 100644 --- a/source/core/audio/audio.cpp +++ b/source/core/audio/audio.cpp @@ -1,4 +1,4 @@ -#include "audio.hpp" +#include "core/audio/audio.hpp" #include // Para SDL_LogInfo, SDL_LogCategory, SDL_G... @@ -19,9 +19,9 @@ #undef PLAYBACK_RIGHT // clang-format on -#include "external/jail_audio.hpp" // Para JA_FadeOutMusic, JA_Init, JA_PauseM... -#include "options.hpp" // Para AudioOptions, audio, MusicOptions -#include "resource.hpp" // Para Resource +#include "core/audio/jail_audio.hpp" // Para JA_FadeOutMusic, JA_Init, JA_PauseM... +#include "core/resources/resource.hpp" // Para Resource +#include "game/options.hpp" // Para AudioOptions, audio, MusicOptions // Singleton Audio* Audio::instance = nullptr; diff --git a/source/core/input/define_buttons.cpp b/source/core/input/define_buttons.cpp index ea791db..c7438a2 100644 --- a/source/core/input/define_buttons.cpp +++ b/source/core/input/define_buttons.cpp @@ -1,16 +1,16 @@ -#include "define_buttons.hpp" +#include "core/input/define_buttons.hpp" #include // Para __all_of_fn, all_of #include // Para unique_ptr, allocator, shared_ptr, operator==, make_unique -#include "input.hpp" // Para Input -#include "input_types.hpp" // Para InputAction -#include "lang.hpp" // Para getText -#include "options.hpp" // Para Gamepad -#include "param.hpp" // Para Param, param, ParamGame, ParamServiceMenu -#include "resource.hpp" // Para Resource -#include "ui/window_message.hpp" // Para WindowMessage -#include "utils.hpp" // Para Zone +#include "core/input/input.hpp" // Para Input +#include "core/input/input_types.hpp" // Para InputAction +#include "core/locale/lang.hpp" // Para getText +#include "core/resources/resource.hpp" // Para Resource +#include "game/options.hpp" // Para Gamepad +#include "game/ui/window_message.hpp" // Para WindowMessage +#include "utils/param.hpp" // Para Param, param, ParamGame, ParamServiceMenu +#include "utils/utils.hpp" // Para Zone DefineButtons::DefineButtons() : input_(Input::get()) { diff --git a/source/core/input/define_buttons.hpp b/source/core/input/define_buttons.hpp index 4e49f0a..2775a6a 100644 --- a/source/core/input/define_buttons.hpp +++ b/source/core/input/define_buttons.hpp @@ -8,8 +8,8 @@ #include #include -#include "input.hpp" -#include "ui/window_message.hpp" +#include "core/input/input.hpp" +#include "game/ui/window_message.hpp" namespace Options { struct Gamepad; diff --git a/source/core/input/gamepad_config_manager.hpp b/source/core/input/gamepad_config_manager.hpp index 225cc96..24e7e4b 100644 --- a/source/core/input/gamepad_config_manager.hpp +++ b/source/core/input/gamepad_config_manager.hpp @@ -5,8 +5,8 @@ #include #include +#include "core/input/input_types.hpp" // Solo incluimos los tipos compartidos #include "external/json.hpp" -#include "input_types.hpp" // Solo incluimos los tipos compartidos // --- Estructuras --- struct GamepadConfig { diff --git a/source/core/input/global_inputs.cpp b/source/core/input/global_inputs.cpp index ac7f140..97857c3 100644 --- a/source/core/input/global_inputs.cpp +++ b/source/core/input/global_inputs.cpp @@ -1,4 +1,4 @@ -#include "global_inputs.hpp" +#include "core/input/global_inputs.hpp" #include // Para __any_of_fn, any_of #include // Para function @@ -7,16 +7,16 @@ #include // Para pair #include // Para vector -#include "audio.hpp" // Para Audio -#include "input.hpp" // Para Input -#include "input_types.hpp" // Para InputAction -#include "lang.hpp" // Para getText, getLangFile, getLangName, getNextLangCode, loadFromFile -#include "options.hpp" // Para Video, video, Settings, settings, Audio, audio, Window, window -#include "screen.hpp" // Para Screen -#include "section.hpp" // Para Name, name, Options, options, AttractMode, attract_mode -#include "ui/notifier.hpp" // Para Notifier -#include "ui/service_menu.hpp" // Para ServiceMenu -#include "utils.hpp" // Para boolToOnOff +#include "core/audio/audio.hpp" // Para Audio +#include "core/input/input.hpp" // Para Input +#include "core/input/input_types.hpp" // Para InputAction +#include "core/locale/lang.hpp" // Para getText, getLangFile, getLangName, getNextLangCode, loadFromFile +#include "core/rendering/screen.hpp" // Para Screen +#include "core/system/section.hpp" // Para Name, name, Options, options, AttractMode, attract_mode +#include "game/options.hpp" // Para Video, video, Settings, settings, Audio, audio, Window, window +#include "game/ui/notifier.hpp" // Para Notifier +#include "game/ui/service_menu.hpp" // Para ServiceMenu +#include "utils/utils.hpp" // Para boolToOnOff namespace GlobalInputs { // Termina diff --git a/source/core/input/input.cpp b/source/core/input/input.cpp index c116704..3e28011 100644 --- a/source/core/input/input.cpp +++ b/source/core/input/input.cpp @@ -1,4 +1,4 @@ -#include "input.hpp" +#include "core/input/input.hpp" #include // Para SDL_GetGamepadAxis, SDL_GamepadAxis, SDL_GamepadButton, SDL_GetError, SDL_JoystickID, SDL_AddGamepadMappingsFromFile, SDL_Event, SDL_EventType, SDL_GetGamepadButton, SDL_GetKeyboardState, SDL_INIT_GAMEPAD, SDL_InitSubSystem, SDL_LogError, SDL_OpenGamepad, SDL_PollEvent, SDL_WasInit, Sint16, SDL_Gamepad, SDL_LogCategory, SDL_Scancode diff --git a/source/core/input/input.hpp b/source/core/input/input.hpp index bf92961..be54356 100644 --- a/source/core/input/input.hpp +++ b/source/core/input/input.hpp @@ -9,8 +9,8 @@ #include // Para pair #include // Para vector -#include "gamepad_config_manager.hpp" // for GamepadConfig (ptr only), GamepadConfigs -#include "input_types.hpp" // for InputAction +#include "core/input/gamepad_config_manager.hpp" // for GamepadConfig (ptr only), GamepadConfigs +#include "core/input/input_types.hpp" // for InputAction // --- Clase Input: gestiona la entrada de teclado y mandos (singleton) --- class Input { diff --git a/source/core/input/input_types.cpp b/source/core/input/input_types.cpp index 7e1ef02..7c9efd7 100644 --- a/source/core/input/input_types.cpp +++ b/source/core/input/input_types.cpp @@ -1,4 +1,4 @@ -#include "input_types.hpp" +#include "core/input/input_types.hpp" #include // Para pair diff --git a/source/core/input/mouse.cpp b/source/core/input/mouse.cpp index 7e0e156..6779325 100644 --- a/source/core/input/mouse.cpp +++ b/source/core/input/mouse.cpp @@ -1,4 +1,4 @@ -#include "mouse.hpp" +#include "core/input/mouse.hpp" #include // Para SDL_GetTicks, Uint32, SDL_HideCursor, SDL_Show... diff --git a/source/core/locale/lang.cpp b/source/core/locale/lang.cpp index 3c4c636..fdbafeb 100644 --- a/source/core/locale/lang.cpp +++ b/source/core/locale/lang.cpp @@ -1,4 +1,4 @@ -#include "lang.hpp" +#include "core/locale/lang.hpp" #include // Para size_t #include // Para exception @@ -7,11 +7,11 @@ #include // Para pair #include // Para vector -#include "asset.hpp" // Para Asset -#include "difficulty.hpp" // Para Difficulty -#include "external/json.hpp" // Para basic_json, iteration_proxy_value, oper... -#include "options.hpp" // Para SettingsOpt... -#include "resource_helper.hpp" // Para ResourceHelper +#include "core/resources/asset.hpp" // Para Asset +#include "core/resources/resource_helper.hpp" // Para ResourceHelper +#include "external/json.hpp" // Para basic_json, iteration_proxy_value, oper... +#include "game/gameplay/difficulty.hpp" // Para Difficulty +#include "game/options.hpp" // Para SettingsOpt... using json = nlohmann::json; diff --git a/source/core/rendering/background.cpp b/source/core/rendering/background.cpp index 761530b..ab5c689 100644 --- a/source/core/rendering/background.cpp +++ b/source/core/rendering/background.cpp @@ -1,5 +1,5 @@ #define _USE_MATH_DEFINES -#include "background.hpp" +#include "core/rendering/background.hpp" #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 @@ -8,14 +8,14 @@ #include // Para basic_string #include // Para move -#include "animated_sprite.hpp" // Para AnimatedSprite -#include "moving_sprite.hpp" // Para MovingSprite -#include "param.hpp" // Para Param, ParamBackground, param -#include "resource.hpp" // Para Resource -#include "screen.hpp" // Para Screen -#include "sprite.hpp" // Para Sprite -#include "texture.hpp" // Para Texture -#include "utils.hpp" // Para easeOutCubic +#include "core/rendering/screen.hpp" // Para Screen +#include "core/rendering/sprite/animated_sprite.hpp" // Para AnimatedSprite +#include "core/rendering/sprite/moving_sprite.hpp" // Para MovingSprite +#include "core/rendering/sprite/sprite.hpp" // Para Sprite +#include "core/rendering/texture.hpp" // Para Texture +#include "core/resources/resource.hpp" // Para Resource +#include "utils/param.hpp" // Para Param, ParamBackground, param +#include "utils/utils.hpp" // Para easeOutCubic // Constructor Background::Background(float total_progress_to_complete) diff --git a/source/core/rendering/background.hpp b/source/core/rendering/background.hpp index 6d0c939..ef62b8e 100644 --- a/source/core/rendering/background.hpp +++ b/source/core/rendering/background.hpp @@ -8,7 +8,7 @@ #include // Para unique_ptr, shared_ptr #include // Para vector -#include "color.hpp" // Para Color +#include "utils/color.hpp" // Para Color class MovingSprite; class Sprite; diff --git a/source/core/rendering/fade.cpp b/source/core/rendering/fade.cpp index 71fcf4a..bff32f1 100644 --- a/source/core/rendering/fade.cpp +++ b/source/core/rendering/fade.cpp @@ -1,4 +1,4 @@ -#include "fade.hpp" +#include "core/rendering/fade.hpp" #include @@ -6,9 +6,9 @@ #include #include -#include "color.hpp" -#include "param.hpp" -#include "screen.hpp" +#include "core/rendering/screen.hpp" +#include "utils/color.hpp" +#include "utils/param.hpp" // Constructor Fade::Fade() diff --git a/source/core/rendering/gif.cpp b/source/core/rendering/gif.cpp index 920b0f7..5a9a37c 100644 --- a/source/core/rendering/gif.cpp +++ b/source/core/rendering/gif.cpp @@ -1,252 +1,253 @@ -#include "gif.hpp" +#include "core/rendering/gif.hpp" #include // Para SDL_LogError, SDL_LogCategory, SDL_LogInfo + #include // Para memcpy, size_t #include // Para std::cout #include // Para runtime_error #include // Para char_traits, operator==, basic_string, string namespace GIF { -inline void readBytes(const uint8_t *&buffer, void *dst, size_t size) { - std::memcpy(dst, buffer, size); - buffer += size; -} - -void Gif::decompress(int code_length, const uint8_t *input, int input_length, uint8_t *out) { - if (code_length < 2 || code_length > 12) { - std::cout << "Invalid LZW code length: " << code_length << '\n'; - throw std::runtime_error("Invalid LZW code length"); + inline void readBytes(const uint8_t *&buffer, void *dst, size_t size) { + std::memcpy(dst, buffer, size); + buffer += size; } - int i, bit; - int prev = -1; - std::vector dictionary; - int dictionary_ind; - unsigned int mask = 0x01; - int reset_code_length = code_length; - int clear_code = 1 << code_length; - int stop_code = clear_code + 1; - int match_len = 0; - - dictionary.resize(1 << (code_length + 1)); - for (dictionary_ind = 0; dictionary_ind < (1 << code_length); dictionary_ind++) { - dictionary[dictionary_ind].byte = static_cast(dictionary_ind); - dictionary[dictionary_ind].prev = -1; - dictionary[dictionary_ind].len = 1; - } - dictionary_ind += 2; - - while (input_length > 0) { - int code = 0; - for (i = 0; i < (code_length + 1); i++) { - if (input_length <= 0) { - std::cout << "Unexpected end of input in decompress" << '\n'; - throw std::runtime_error("Unexpected end of input in decompress"); - } - bit = ((*input & mask) != 0) ? 1 : 0; - mask <<= 1; - if (mask == 0x100) { - mask = 0x01; - input++; - input_length--; - } - code |= (bit << i); + void Gif::decompress(int code_length, const uint8_t *input, int input_length, uint8_t *out) { + if (code_length < 2 || code_length > 12) { + std::cout << "Invalid LZW code length: " << code_length << '\n'; + throw std::runtime_error("Invalid LZW code length"); } - if (code == clear_code) { - code_length = reset_code_length; - dictionary.resize(1 << (code_length + 1)); - for (dictionary_ind = 0; dictionary_ind < (1 << code_length); dictionary_ind++) { - dictionary[dictionary_ind].byte = static_cast(dictionary_ind); - dictionary[dictionary_ind].prev = -1; - dictionary[dictionary_ind].len = 1; - } - dictionary_ind += 2; - prev = -1; - continue; - } else if (code == stop_code) { - break; + int i, bit; + int prev = -1; + std::vector dictionary; + int dictionary_ind; + unsigned int mask = 0x01; + int reset_code_length = code_length; + int clear_code = 1 << code_length; + int stop_code = clear_code + 1; + int match_len = 0; + + dictionary.resize(1 << (code_length + 1)); + for (dictionary_ind = 0; dictionary_ind < (1 << code_length); dictionary_ind++) { + dictionary[dictionary_ind].byte = static_cast(dictionary_ind); + dictionary[dictionary_ind].prev = -1; + dictionary[dictionary_ind].len = 1; } + dictionary_ind += 2; - if (prev > -1 && code_length < 12) { - if (code > dictionary_ind) { - std::cout << "LZW error: code (" << code << ") exceeds dictionary_ind (" << dictionary_ind << ")" << '\n'; - throw std::runtime_error("LZW error: code exceeds dictionary_ind."); + while (input_length > 0) { + int code = 0; + for (i = 0; i < (code_length + 1); i++) { + if (input_length <= 0) { + std::cout << "Unexpected end of input in decompress" << '\n'; + throw std::runtime_error("Unexpected end of input in decompress"); + } + bit = ((*input & mask) != 0) ? 1 : 0; + mask <<= 1; + if (mask == 0x100) { + mask = 0x01; + input++; + input_length--; + } + code |= (bit << i); } - int ptr; - if (code == dictionary_ind) { - ptr = prev; - while (dictionary[ptr].prev != -1) - ptr = dictionary[ptr].prev; - dictionary[dictionary_ind].byte = dictionary[ptr].byte; - } else { - ptr = code; - while (dictionary[ptr].prev != -1) - ptr = dictionary[ptr].prev; - dictionary[dictionary_ind].byte = dictionary[ptr].byte; - } - dictionary[dictionary_ind].prev = prev; - dictionary[dictionary_ind].len = dictionary[prev].len + 1; - dictionary_ind++; - - if ((dictionary_ind == (1 << (code_length + 1))) && (code_length < 11)) { - code_length++; + if (code == clear_code) { + code_length = reset_code_length; dictionary.resize(1 << (code_length + 1)); + for (dictionary_ind = 0; dictionary_ind < (1 << code_length); dictionary_ind++) { + dictionary[dictionary_ind].byte = static_cast(dictionary_ind); + dictionary[dictionary_ind].prev = -1; + dictionary[dictionary_ind].len = 1; + } + dictionary_ind += 2; + prev = -1; + continue; + } else if (code == stop_code) { + break; } - } - prev = code; + if (prev > -1 && code_length < 12) { + if (code > dictionary_ind) { + std::cout << "LZW error: code (" << code << ") exceeds dictionary_ind (" << dictionary_ind << ")" << '\n'; + throw std::runtime_error("LZW error: code exceeds dictionary_ind."); + } - if (code < 0 || static_cast(code) >= dictionary.size()) { - std::cout << "Invalid LZW code " << code << ", dictionary size " << static_cast(dictionary.size()) << '\n'; - throw std::runtime_error("LZW error: invalid code encountered"); - } + int ptr; + if (code == dictionary_ind) { + ptr = prev; + while (dictionary[ptr].prev != -1) + ptr = dictionary[ptr].prev; + dictionary[dictionary_ind].byte = dictionary[ptr].byte; + } else { + ptr = code; + while (dictionary[ptr].prev != -1) + ptr = dictionary[ptr].prev; + dictionary[dictionary_ind].byte = dictionary[ptr].byte; + } + dictionary[dictionary_ind].prev = prev; + dictionary[dictionary_ind].len = dictionary[prev].len + 1; + dictionary_ind++; - int curCode = code; - match_len = dictionary[curCode].len; - while (curCode != -1) { - out[dictionary[curCode].len - 1] = dictionary[curCode].byte; - if (dictionary[curCode].prev == curCode) { - std::cout << "Internal error; self-reference detected." << '\n'; - throw std::runtime_error("Internal error in decompress: self-reference"); + if ((dictionary_ind == (1 << (code_length + 1))) && (code_length < 11)) { + code_length++; + dictionary.resize(1 << (code_length + 1)); + } } - curCode = dictionary[curCode].prev; + + prev = code; + + if (code < 0 || static_cast(code) >= dictionary.size()) { + std::cout << "Invalid LZW code " << code << ", dictionary size " << static_cast(dictionary.size()) << '\n'; + throw std::runtime_error("LZW error: invalid code encountered"); + } + + int curCode = code; + match_len = dictionary[curCode].len; + while (curCode != -1) { + out[dictionary[curCode].len - 1] = dictionary[curCode].byte; + if (dictionary[curCode].prev == curCode) { + std::cout << "Internal error; self-reference detected." << '\n'; + throw std::runtime_error("Internal error in decompress: self-reference"); + } + curCode = dictionary[curCode].prev; + } + out += match_len; } - out += match_len; } -} -std::vector Gif::readSubBlocks(const uint8_t *&buffer) { - std::vector data; - uint8_t block_size = *buffer; - buffer++; - while (block_size != 0) { - data.insert(data.end(), buffer, buffer + block_size); - buffer += block_size; - block_size = *buffer; + std::vector Gif::readSubBlocks(const uint8_t *&buffer) { + std::vector data; + uint8_t block_size = *buffer; buffer++; - } - return data; -} - -std::vector Gif::processImageDescriptor(const uint8_t *&buffer, const std::vector &gct, int resolution_bits) { - ImageDescriptor image_descriptor; - readBytes(buffer, &image_descriptor, sizeof(ImageDescriptor)); - - uint8_t lzw_code_size; - readBytes(buffer, &lzw_code_size, sizeof(uint8_t)); - - std::vector compressed_data = readSubBlocks(buffer); - int uncompressed_data_length = image_descriptor.image_width * image_descriptor.image_height; - std::vector uncompressed_data(uncompressed_data_length); - - decompress(lzw_code_size, compressed_data.data(), static_cast(compressed_data.size()), uncompressed_data.data()); - return uncompressed_data; -} - -std::vector Gif::loadPalette(const uint8_t *buffer) { - uint8_t header[6]; - std::memcpy(header, buffer, 6); - buffer += 6; - - ScreenDescriptor screen_descriptor; - std::memcpy(&screen_descriptor, buffer, sizeof(ScreenDescriptor)); - buffer += sizeof(ScreenDescriptor); - - std::vector global_color_table; - if (screen_descriptor.fields & 0x80) { - int global_color_table_size = 1 << (((screen_descriptor.fields & 0x07) + 1)); - global_color_table.resize(global_color_table_size); - for (int i = 0; i < global_color_table_size; ++i) { - uint8_t r = buffer[0]; - uint8_t g = buffer[1]; - uint8_t b = buffer[2]; - global_color_table[i] = (r << 16) | (g << 8) | b; - buffer += 3; + while (block_size != 0) { + data.insert(data.end(), buffer, buffer + block_size); + buffer += block_size; + block_size = *buffer; + buffer++; } - } - return global_color_table; -} - -std::vector Gif::processGifStream(const uint8_t *buffer, uint16_t &w, uint16_t &h) { - uint8_t header[6]; - std::memcpy(header, buffer, 6); - buffer += 6; - - std::string headerStr(reinterpret_cast(header), 6); - if (headerStr != "GIF87a" && headerStr != "GIF89a") { - std::cout << "Formato de archivo GIF inválido: " << headerStr << '\n'; - throw std::runtime_error("Formato de archivo GIF inválido."); + return data; } - ScreenDescriptor screen_descriptor; - readBytes(buffer, &screen_descriptor, sizeof(ScreenDescriptor)); + std::vector Gif::processImageDescriptor(const uint8_t *&buffer, const std::vector &gct, int resolution_bits) { + ImageDescriptor image_descriptor; + readBytes(buffer, &image_descriptor, sizeof(ImageDescriptor)); - w = screen_descriptor.width; - h = screen_descriptor.height; + uint8_t lzw_code_size; + readBytes(buffer, &lzw_code_size, sizeof(uint8_t)); - int color_resolution_bits = ((screen_descriptor.fields & 0x70) >> 4) + 1; - std::vector global_color_table; - if (screen_descriptor.fields & 0x80) { - int global_color_table_size = 1 << (((screen_descriptor.fields & 0x07) + 1)); - global_color_table.resize(global_color_table_size); - std::memcpy(global_color_table.data(), buffer, 3 * global_color_table_size); - buffer += 3 * global_color_table_size; + std::vector compressed_data = readSubBlocks(buffer); + int uncompressed_data_length = image_descriptor.image_width * image_descriptor.image_height; + std::vector uncompressed_data(uncompressed_data_length); + + decompress(lzw_code_size, compressed_data.data(), static_cast(compressed_data.size()), uncompressed_data.data()); + return uncompressed_data; } - uint8_t block_type = *buffer++; - while (block_type != TRAILER) { - if (block_type == EXTENSION_INTRODUCER) { - uint8_t extension_label = *buffer++; - switch (extension_label) { - case GRAPHIC_CONTROL: { - uint8_t blockSize = *buffer++; - buffer += blockSize; - uint8_t subBlockSize = *buffer++; - while (subBlockSize != 0) { - buffer += subBlockSize; - subBlockSize = *buffer++; - } - break; - } - case APPLICATION_EXTENSION: - case COMMENT_EXTENSION: - case PLAINTEXT_EXTENSION: { - uint8_t blockSize = *buffer++; - buffer += blockSize; - uint8_t subBlockSize = *buffer++; - while (subBlockSize != 0) { - buffer += subBlockSize; - subBlockSize = *buffer++; - } - break; - } - default: { - uint8_t blockSize = *buffer++; - buffer += blockSize; - uint8_t subBlockSize = *buffer++; - while (subBlockSize != 0) { - buffer += subBlockSize; - subBlockSize = *buffer++; - } - break; - } + std::vector Gif::loadPalette(const uint8_t *buffer) { + uint8_t header[6]; + std::memcpy(header, buffer, 6); + buffer += 6; + + ScreenDescriptor screen_descriptor; + std::memcpy(&screen_descriptor, buffer, sizeof(ScreenDescriptor)); + buffer += sizeof(ScreenDescriptor); + + std::vector global_color_table; + if (screen_descriptor.fields & 0x80) { + int global_color_table_size = 1 << (((screen_descriptor.fields & 0x07) + 1)); + global_color_table.resize(global_color_table_size); + for (int i = 0; i < global_color_table_size; ++i) { + uint8_t r = buffer[0]; + uint8_t g = buffer[1]; + uint8_t b = buffer[2]; + global_color_table[i] = (r << 16) | (g << 8) | b; + buffer += 3; } - } else if (block_type == IMAGE_DESCRIPTOR) { - return processImageDescriptor(buffer, global_color_table, color_resolution_bits); - } else { - std::cout << "Unrecognized block type: 0x" << std::hex << static_cast(block_type) << std::dec << '\n'; - return std::vector{}; } - block_type = *buffer++; + return global_color_table; } - return std::vector{}; -} + std::vector Gif::processGifStream(const uint8_t *buffer, uint16_t &w, uint16_t &h) { + uint8_t header[6]; + std::memcpy(header, buffer, 6); + buffer += 6; -std::vector Gif::loadGif(const uint8_t *buffer, uint16_t &w, uint16_t &h) { - return processGifStream(buffer, w, h); -} + std::string headerStr(reinterpret_cast(header), 6); + if (headerStr != "GIF87a" && headerStr != "GIF89a") { + std::cout << "Formato de archivo GIF inválido: " << headerStr << '\n'; + throw std::runtime_error("Formato de archivo GIF inválido."); + } + + ScreenDescriptor screen_descriptor; + readBytes(buffer, &screen_descriptor, sizeof(ScreenDescriptor)); + + w = screen_descriptor.width; + h = screen_descriptor.height; + + int color_resolution_bits = ((screen_descriptor.fields & 0x70) >> 4) + 1; + std::vector global_color_table; + if (screen_descriptor.fields & 0x80) { + int global_color_table_size = 1 << (((screen_descriptor.fields & 0x07) + 1)); + global_color_table.resize(global_color_table_size); + std::memcpy(global_color_table.data(), buffer, 3 * global_color_table_size); + buffer += 3 * global_color_table_size; + } + + uint8_t block_type = *buffer++; + while (block_type != TRAILER) { + if (block_type == EXTENSION_INTRODUCER) { + uint8_t extension_label = *buffer++; + switch (extension_label) { + case GRAPHIC_CONTROL: { + uint8_t blockSize = *buffer++; + buffer += blockSize; + uint8_t subBlockSize = *buffer++; + while (subBlockSize != 0) { + buffer += subBlockSize; + subBlockSize = *buffer++; + } + break; + } + case APPLICATION_EXTENSION: + case COMMENT_EXTENSION: + case PLAINTEXT_EXTENSION: { + uint8_t blockSize = *buffer++; + buffer += blockSize; + uint8_t subBlockSize = *buffer++; + while (subBlockSize != 0) { + buffer += subBlockSize; + subBlockSize = *buffer++; + } + break; + } + default: { + uint8_t blockSize = *buffer++; + buffer += blockSize; + uint8_t subBlockSize = *buffer++; + while (subBlockSize != 0) { + buffer += subBlockSize; + subBlockSize = *buffer++; + } + break; + } + } + } else if (block_type == IMAGE_DESCRIPTOR) { + return processImageDescriptor(buffer, global_color_table, color_resolution_bits); + } else { + std::cout << "Unrecognized block type: 0x" << std::hex << static_cast(block_type) << std::dec << '\n'; + return std::vector{}; + } + block_type = *buffer++; + } + + return std::vector{}; + } + + std::vector Gif::loadGif(const uint8_t *buffer, uint16_t &w, uint16_t &h) { + return processGifStream(buffer, w, h); + } } // namespace GIF diff --git a/source/core/rendering/gif.hpp b/source/core/rendering/gif.hpp index b9e0dee..8bb26c1 100644 --- a/source/core/rendering/gif.hpp +++ b/source/core/rendering/gif.hpp @@ -5,88 +5,88 @@ namespace GIF { -// Constantes definidas con constexpr, en lugar de macros -constexpr uint8_t EXTENSION_INTRODUCER = 0x21; -constexpr uint8_t IMAGE_DESCRIPTOR = 0x2C; -constexpr uint8_t TRAILER = 0x3B; -constexpr uint8_t GRAPHIC_CONTROL = 0xF9; -constexpr uint8_t APPLICATION_EXTENSION = 0xFF; -constexpr uint8_t COMMENT_EXTENSION = 0xFE; -constexpr uint8_t PLAINTEXT_EXTENSION = 0x01; + // Constantes definidas con constexpr, en lugar de macros + constexpr uint8_t EXTENSION_INTRODUCER = 0x21; + constexpr uint8_t IMAGE_DESCRIPTOR = 0x2C; + constexpr uint8_t TRAILER = 0x3B; + constexpr uint8_t GRAPHIC_CONTROL = 0xF9; + constexpr uint8_t APPLICATION_EXTENSION = 0xFF; + constexpr uint8_t COMMENT_EXTENSION = 0xFE; + constexpr uint8_t PLAINTEXT_EXTENSION = 0x01; #pragma pack(push, 1) -struct ScreenDescriptor { - uint16_t width; - uint16_t height; - uint8_t fields; - uint8_t background_color_index; - uint8_t pixel_aspect_ratio; -}; + struct ScreenDescriptor { + uint16_t width; + uint16_t height; + uint8_t fields; + uint8_t background_color_index; + uint8_t pixel_aspect_ratio; + }; -struct RGB { - uint8_t r, g, b; -}; + struct RGB { + uint8_t r, g, b; + }; -struct ImageDescriptor { - uint16_t image_left_position; - uint16_t image_top_position; - uint16_t image_width; - uint16_t image_height; - uint8_t fields; -}; + struct ImageDescriptor { + uint16_t image_left_position; + uint16_t image_top_position; + uint16_t image_width; + uint16_t image_height; + uint8_t fields; + }; #pragma pack(pop) -struct DictionaryEntry { - uint8_t byte; - int prev; - int len; -}; + struct DictionaryEntry { + uint8_t byte; + int prev; + int len; + }; -struct Extension { - uint8_t extension_code; - uint8_t block_size; -}; + struct Extension { + uint8_t extension_code; + uint8_t block_size; + }; -struct GraphicControlExtension { - uint8_t fields; - uint16_t delay_time; - uint8_t transparent_color_index; -}; + struct GraphicControlExtension { + uint8_t fields; + uint16_t delay_time; + uint8_t transparent_color_index; + }; -struct ApplicationExtension { - uint8_t application_id[8]; - uint8_t version[3]; -}; + struct ApplicationExtension { + uint8_t application_id[8]; + uint8_t version[3]; + }; -struct PlaintextExtension { - uint16_t left, top, width, height; - uint8_t cell_width, cell_height; - uint8_t foreground_color, background_color; -}; + struct PlaintextExtension { + uint16_t left, top, width, height; + uint8_t cell_width, cell_height; + uint8_t foreground_color, background_color; + }; -class Gif { - public: - // Descompone (uncompress) el bloque comprimido usando LZW. - // Este método puede lanzar std::runtime_error en caso de error. - void decompress(int code_length, const uint8_t *input, int input_length, uint8_t *out); + class Gif { + public: + // Descompone (uncompress) el bloque comprimido usando LZW. + // Este método puede lanzar std::runtime_error en caso de error. + void decompress(int code_length, const uint8_t *input, int input_length, uint8_t *out); - // Carga la paleta (global color table) a partir de un buffer, - // retornándola en un vector de uint32_t (cada color se compone de R, G, B). - std::vector loadPalette(const uint8_t *buffer); + // Carga la paleta (global color table) a partir de un buffer, + // retornándola en un vector de uint32_t (cada color se compone de R, G, B). + std::vector loadPalette(const uint8_t *buffer); - // Carga el stream GIF; devuelve un vector con los datos de imagen sin comprimir y - // asigna el ancho y alto mediante referencias. - std::vector loadGif(const uint8_t *buffer, uint16_t &w, uint16_t &h); + // Carga el stream GIF; devuelve un vector con los datos de imagen sin comprimir y + // asigna el ancho y alto mediante referencias. + std::vector loadGif(const uint8_t *buffer, uint16_t &w, uint16_t &h); - private: - // Lee los sub-bloques de datos y los acumula en un std::vector. - std::vector readSubBlocks(const uint8_t *&buffer); + private: + // Lee los sub-bloques de datos y los acumula en un std::vector. + std::vector readSubBlocks(const uint8_t *&buffer); - // Procesa el Image Descriptor y retorna el vector de datos sin comprimir. - std::vector processImageDescriptor(const uint8_t *&buffer, const std::vector &gct, int resolution_bits); + // Procesa el Image Descriptor y retorna el vector de datos sin comprimir. + std::vector processImageDescriptor(const uint8_t *&buffer, const std::vector &gct, int resolution_bits); - // Procesa el stream completo del GIF y devuelve los datos sin comprimir. - std::vector processGifStream(const uint8_t *buffer, uint16_t &w, uint16_t &h); -}; + // Procesa el stream completo del GIF y devuelve los datos sin comprimir. + std::vector processGifStream(const uint8_t *buffer, uint16_t &w, uint16_t &h); + }; } // namespace GIF diff --git a/source/core/rendering/screen.cpp b/source/core/rendering/screen.cpp index c3f9f29..b8f5b90 100644 --- a/source/core/rendering/screen.cpp +++ b/source/core/rendering/screen.cpp @@ -1,4 +1,4 @@ -#include "screen.hpp" +#include "core/rendering/screen.hpp" #include // Para SDL_SetRenderTarget, SDL_RenderTexture, SDL_SetRenderDrawColor, SDL_SetRenderVSync, SDL_LogCategory, SDL_GetError, SDL_LogError, SDL_LogInfo, SDL_RendererLogicalPresentation, SDL_SetRenderLogicalPresentation, SDL_CreateTexture, SDL_DestroyTexture, SDL_DestroyWindow, SDL_GetDisplayName, SDL_GetTicks, SDL_Quit, SDL_RENDERER_VSYNC_DISABLED, SDL_RenderClear, SDL_CreateRenderer, SDL_CreateWindow, SDL_DestroyRenderer, SDL_DisplayID, SDL_FRect, SDL_GetCurrentDisplayMode, SDL_GetDisplays, SDL_GetRenderTarget, SDL_GetWindowPosition, SDL_GetWindowSize, SDL_Init, SDL_LogWarn, SDL_PixelFormat, SDL_RenderFillRect, SDL_RenderPresent, SDL_SetHint, SDL_SetRenderDrawBlendMode, SDL_SetTextureScaleMode, SDL_SetWindowFullscreen, SDL_SetWindowPosition, SDL_SetWindowSize, SDL_TextureAccess, SDL_free, SDL_BLENDMODE_BLEND, SDL_HINT_RENDER_DRIVER, SDL_INIT_VIDEO, SDL_ScaleMode, SDL_WINDOW_FULLSCREEN, SDL_WindowFlags @@ -9,18 +9,18 @@ #include // Para basic_string, operator+, char_traits, to_string, string #include // Para vector -#include "asset.hpp" // Para Asset -#include "director.hpp" // Para Director::debug_config -#include "mouse.hpp" // Para updateCursorVisibility -#include "options.hpp" // Para Video, video, Window, window -#include "param.hpp" // Para Param, param, ParamGame, ParamDebug -#include "rendering/sdl3gpu/sdl3gpu_shader.hpp" // Para SDL3GPUShader -#include "resource.hpp" // Para Resource -#include "text.hpp" // Para Text -#include "texture.hpp" // Para Texture -#include "ui/notifier.hpp" // Para Notifier -#include "ui/service_menu.hpp" // Para ServiceMenu -#include "utils.hpp" // Para toLower +#include "core/input/mouse.hpp" // Para updateCursorVisibility +#include "core/rendering/sdl3gpu/sdl3gpu_shader.hpp" // Para SDL3GPUShader +#include "core/rendering/text.hpp" // Para Text +#include "core/rendering/texture.hpp" // Para Texture +#include "core/resources/asset.hpp" // Para Asset +#include "core/resources/resource.hpp" // Para Resource +#include "core/system/director.hpp" // Para Director::debug_config +#include "game/options.hpp" // Para Video, video, Window, window +#include "game/ui/notifier.hpp" // Para Notifier +#include "game/ui/service_menu.hpp" // Para ServiceMenu +#include "utils/param.hpp" // Para Param, param, ParamGame, ParamDebug +#include "utils/utils.hpp" // Para toLower // Singleton Screen* Screen::instance = nullptr; diff --git a/source/core/rendering/screen.hpp b/source/core/rendering/screen.hpp index 87154f8..20ffad3 100644 --- a/source/core/rendering/screen.hpp +++ b/source/core/rendering/screen.hpp @@ -6,9 +6,9 @@ #include // Para string #include // Para vector -#include "color.hpp" // Para Color -#include "options.hpp" // Para VideoOptions, video -#include "rendering/shader_backend.hpp" // Para Rendering::ShaderType +#include "core/rendering/shader_backend.hpp" // Para Rendering::ShaderType +#include "game/options.hpp" // Para VideoOptions, video +#include "utils/color.hpp" // Para Color // Forward declarations class Notifier; diff --git a/source/core/rendering/sdl3gpu/sdl3gpu_shader.cpp b/source/core/rendering/sdl3gpu/sdl3gpu_shader.cpp index 318293a..e55092a 100644 --- a/source/core/rendering/sdl3gpu/sdl3gpu_shader.cpp +++ b/source/core/rendering/sdl3gpu/sdl3gpu_shader.cpp @@ -1,4 +1,4 @@ -#include "rendering/sdl3gpu/sdl3gpu_shader.hpp" +#include "core/rendering/sdl3gpu/sdl3gpu_shader.hpp" #include @@ -8,11 +8,11 @@ #include // Para std::cout #ifndef __APPLE__ -#include "rendering/sdl3gpu/crtpi_frag_spv.h" -#include "rendering/sdl3gpu/downscale_frag_spv.h" -#include "rendering/sdl3gpu/postfx_frag_spv.h" -#include "rendering/sdl3gpu/postfx_vert_spv.h" -#include "rendering/sdl3gpu/upscale_frag_spv.h" +#include "core/rendering/sdl3gpu/crtpi_frag_spv.h" +#include "core/rendering/sdl3gpu/downscale_frag_spv.h" +#include "core/rendering/sdl3gpu/postfx_frag_spv.h" +#include "core/rendering/sdl3gpu/postfx_vert_spv.h" +#include "core/rendering/sdl3gpu/upscale_frag_spv.h" #endif #ifdef __APPLE__ diff --git a/source/core/rendering/sdl3gpu/sdl3gpu_shader.hpp b/source/core/rendering/sdl3gpu/sdl3gpu_shader.hpp index d6355bd..25626bb 100644 --- a/source/core/rendering/sdl3gpu/sdl3gpu_shader.hpp +++ b/source/core/rendering/sdl3gpu/sdl3gpu_shader.hpp @@ -6,7 +6,7 @@ #include #include -#include "rendering/shader_backend.hpp" +#include "core/rendering/shader_backend.hpp" // PostFX uniforms pushed to fragment stage each frame. // 12 floats = 48 bytes — meets Metal/Vulkan 16-byte alignment requirement. diff --git a/source/core/rendering/sprite/animated_sprite.cpp b/source/core/rendering/sprite/animated_sprite.cpp index 88fdf02..8dbbc55 100644 --- a/source/core/rendering/sprite/animated_sprite.cpp +++ b/source/core/rendering/sprite/animated_sprite.cpp @@ -1,4 +1,4 @@ -#include "animated_sprite.hpp" +#include "core/rendering/sprite/animated_sprite.hpp" #include // Para SDL_LogWarn, SDL_LogCategory, SDL_LogError, SDL_FRect @@ -10,8 +10,8 @@ #include // Para runtime_error #include // Para move, pair -#include "resource_helper.hpp" // Para loadFile -#include "texture.hpp" // Para Texture +#include "core/rendering/texture.hpp" // Para Texture +#include "core/resources/resource_helper.hpp" // Para loadFile // Carga las animaciones en un vector(Animations) desde un fichero auto loadAnimationsFromFile(const std::string& file_path) -> AnimationsFileBuffer { diff --git a/source/core/rendering/sprite/animated_sprite.hpp b/source/core/rendering/sprite/animated_sprite.hpp index 5b89748..95dba47 100644 --- a/source/core/rendering/sprite/animated_sprite.hpp +++ b/source/core/rendering/sprite/animated_sprite.hpp @@ -9,7 +9,7 @@ #include // Para move #include // Para vector -#include "moving_sprite.hpp" // for MovingSprite +#include "core/rendering/sprite/moving_sprite.hpp" // for MovingSprite // Declaración adelantada class Texture; diff --git a/source/core/rendering/sprite/card_sprite.cpp b/source/core/rendering/sprite/card_sprite.cpp index edd4d28..41d8e99 100644 --- a/source/core/rendering/sprite/card_sprite.cpp +++ b/source/core/rendering/sprite/card_sprite.cpp @@ -1,11 +1,11 @@ -#include "card_sprite.hpp" +#include "core/rendering/sprite/card_sprite.hpp" #include // Para std::clamp #include // Para function #include // Para move -#include "texture.hpp" // Para Texture -#include "utils.hpp" // Para easeOutBounce, easeOutCubic +#include "core/rendering/texture.hpp" // Para Texture +#include "utils/utils.hpp" // Para easeOutBounce, easeOutCubic // Constructor CardSprite::CardSprite(std::shared_ptr texture) diff --git a/source/core/rendering/sprite/card_sprite.hpp b/source/core/rendering/sprite/card_sprite.hpp index ee714e4..5c74eb6 100644 --- a/source/core/rendering/sprite/card_sprite.hpp +++ b/source/core/rendering/sprite/card_sprite.hpp @@ -5,7 +5,7 @@ #include // Para function #include // Para shared_ptr -#include "moving_sprite.hpp" // Para MovingSprite +#include "core/rendering/sprite/moving_sprite.hpp" // Para MovingSprite class Texture; diff --git a/source/core/rendering/sprite/moving_sprite.cpp b/source/core/rendering/sprite/moving_sprite.cpp index 7373539..eab4ede 100644 --- a/source/core/rendering/sprite/moving_sprite.cpp +++ b/source/core/rendering/sprite/moving_sprite.cpp @@ -1,9 +1,9 @@ -#include "moving_sprite.hpp" +#include "core/rendering/sprite/moving_sprite.hpp" #include // Para std::abs #include -#include "texture.hpp" // Para Texture +#include "core/rendering/texture.hpp" // Para Texture // Constructor MovingSprite::MovingSprite(std::shared_ptr texture, SDL_FRect pos, Rotate rotate, float horizontal_zoom, float vertical_zoom, SDL_FlipMode flip) diff --git a/source/core/rendering/sprite/moving_sprite.hpp b/source/core/rendering/sprite/moving_sprite.hpp index 4a0ce78..31a0fd8 100644 --- a/source/core/rendering/sprite/moving_sprite.hpp +++ b/source/core/rendering/sprite/moving_sprite.hpp @@ -4,7 +4,7 @@ #include // Para shared_ptr -#include "sprite.hpp" // for Sprite +#include "core/rendering/sprite/sprite.hpp" // for Sprite class Texture; diff --git a/source/core/rendering/sprite/path_sprite.cpp b/source/core/rendering/sprite/path_sprite.cpp index b61234e..33d7942 100644 --- a/source/core/rendering/sprite/path_sprite.cpp +++ b/source/core/rendering/sprite/path_sprite.cpp @@ -1,5 +1,5 @@ // IWYU pragma: no_include -#include "path_sprite.hpp" +#include "core/rendering/sprite/path_sprite.hpp" #include // Para abs #include // Para function diff --git a/source/core/rendering/sprite/path_sprite.hpp b/source/core/rendering/sprite/path_sprite.hpp index 0d747cd..03d9cc3 100644 --- a/source/core/rendering/sprite/path_sprite.hpp +++ b/source/core/rendering/sprite/path_sprite.hpp @@ -7,7 +7,7 @@ #include #include // Para vector -#include "sprite.hpp" // Para Sprite +#include "core/rendering/sprite/sprite.hpp" // Para Sprite class Texture; diff --git a/source/core/rendering/sprite/smart_sprite.cpp b/source/core/rendering/sprite/smart_sprite.cpp index 4819a63..0e1dd84 100644 --- a/source/core/rendering/sprite/smart_sprite.cpp +++ b/source/core/rendering/sprite/smart_sprite.cpp @@ -1,6 +1,6 @@ -#include "smart_sprite.hpp" +#include "core/rendering/sprite/smart_sprite.hpp" -#include "moving_sprite.hpp" // Para MovingSprite +#include "core/rendering/sprite/moving_sprite.hpp" // Para MovingSprite // Actualiza la posición y comprueba si ha llegado a su destino (time-based) void SmartSprite::update(float delta_time) { diff --git a/source/core/rendering/sprite/smart_sprite.hpp b/source/core/rendering/sprite/smart_sprite.hpp index c628ca9..3b60e4b 100644 --- a/source/core/rendering/sprite/smart_sprite.hpp +++ b/source/core/rendering/sprite/smart_sprite.hpp @@ -3,7 +3,7 @@ #include // Para shared_ptr #include -#include "animated_sprite.hpp" // Para AnimatedSprite +#include "core/rendering/sprite/animated_sprite.hpp" // Para AnimatedSprite class Texture; diff --git a/source/core/rendering/sprite/sprite.cpp b/source/core/rendering/sprite/sprite.cpp index 4f1f5e9..7a64677 100644 --- a/source/core/rendering/sprite/sprite.cpp +++ b/source/core/rendering/sprite/sprite.cpp @@ -1,9 +1,9 @@ -#include "sprite.hpp" +#include "core/rendering/sprite/sprite.hpp" #include #include // Para vector -#include "texture.hpp" // Para Texture +#include "core/rendering/texture.hpp" // Para Texture // Constructor Sprite::Sprite(std::shared_ptr texture, float pos_x, float pos_y, float width, float height) diff --git a/source/core/rendering/text.cpp b/source/core/rendering/text.cpp index 4c70be0..0b7921b 100644 --- a/source/core/rendering/text.cpp +++ b/source/core/rendering/text.cpp @@ -1,4 +1,4 @@ -#include "text.hpp" +#include "core/rendering/text.hpp" #include // Para SDL_FRect, Uint8, SDL_GetRenderTarget, SDL_RenderClear, SDL_SetRenderDrawColor, SDL_SetRenderTarget, SDL_BLENDMODE_BLEND, SDL_PixelFormat, SDL_TextureAccess, SDL_GetTextureAlphaMod @@ -10,12 +10,12 @@ #include // Para std::cmp_less_equal #include // Para vector -#include "color.hpp" // Para Color -#include "resource_helper.hpp" // Para loadFile -#include "screen.hpp" // Para Screen -#include "sprite.hpp" // Para Sprite -#include "texture.hpp" // Para Texture -#include "utils.hpp" // Para getFileName +#include "core/rendering/screen.hpp" // Para Screen +#include "core/rendering/sprite/sprite.hpp" // Para Sprite +#include "core/rendering/texture.hpp" // Para Texture +#include "core/resources/resource_helper.hpp" // Para loadFile +#include "utils/color.hpp" // Para Color +#include "utils/utils.hpp" // Para getFileName // Constructor Text::Text(const std::shared_ptr& texture, const std::string& text_file) { diff --git a/source/core/rendering/text.hpp b/source/core/rendering/text.hpp index e4687e9..f558b37 100644 --- a/source/core/rendering/text.hpp +++ b/source/core/rendering/text.hpp @@ -6,8 +6,8 @@ #include // Para shared_ptr, unique_ptr #include // Para string -#include "color.hpp" // Para Color -#include "sprite.hpp" // Para Sprite +#include "core/rendering/sprite/sprite.hpp" // Para Sprite +#include "utils/color.hpp" // Para Color class Texture; diff --git a/source/core/rendering/texture.cpp b/source/core/rendering/texture.cpp index 77777c2..118a2c6 100644 --- a/source/core/rendering/texture.cpp +++ b/source/core/rendering/texture.cpp @@ -1,5 +1,5 @@ #define STB_IMAGE_IMPLEMENTATION -#include "texture.hpp" +#include "core/rendering/texture.hpp" #include // Para SDL_LogError, SDL_LogCategory, Uint8, SDL_... @@ -13,11 +13,11 @@ #include #include // Para vector -#include "color.hpp" // Para getFileName, Color -#include "external/gif.hpp" // Para Gif -#include "resource_helper.hpp" // Para ResourceHelper -#include "stb_image.h" // Para stbi_image_free, stbi_load, STBI_rgb_alpha -#include "utils.hpp" +#include "core/rendering/gif.hpp" // Para Gif +#include "core/resources/resource_helper.hpp" // Para ResourceHelper +#include "external/stb_image.h" // Para stbi_image_free, stbi_load, STBI_rgb_alpha +#include "utils/color.hpp" // Para getFileName, Color +#include "utils/utils.hpp" // Constructor Texture::Texture(SDL_Renderer* renderer, std::string path) diff --git a/source/core/rendering/tiled_bg.cpp b/source/core/rendering/tiled_bg.cpp index 3d24ff4..635a6c9 100644 --- a/source/core/rendering/tiled_bg.cpp +++ b/source/core/rendering/tiled_bg.cpp @@ -1,4 +1,4 @@ -#include "tiled_bg.hpp" +#include "core/rendering/tiled_bg.hpp" #include // Para SDL_SetRenderTarget, SDL_CreateTexture, SDL_DestroyTexture, SDL_FRect, SDL_GetRenderTarget, SDL_RenderTexture, SDL_PixelFormat, SDL_TextureAccess @@ -9,9 +9,9 @@ #include // Para pi #include // Para basic_string -#include "resource.hpp" // Para Resource -#include "screen.hpp" // Para Screen -#include "sprite.hpp" // Para Sprite +#include "core/rendering/screen.hpp" // Para Screen +#include "core/rendering/sprite/sprite.hpp" // Para Sprite +#include "core/resources/resource.hpp" // Para Resource // Constructor TiledBG::TiledBG(SDL_FRect pos, TiledBGMode mode) diff --git a/source/core/rendering/tiled_bg.hpp b/source/core/rendering/tiled_bg.hpp index a85b34d..bf79bdb 100644 --- a/source/core/rendering/tiled_bg.hpp +++ b/source/core/rendering/tiled_bg.hpp @@ -2,7 +2,7 @@ #include // Para SDL_FRect, SDL_SetTextureColorMod, SDL_Renderer, SDL_Texture -#include "color.hpp" // Para Color +#include "utils/color.hpp" // Para Color // --- Enums --- enum class TiledBGMode : int { // Modos de funcionamiento para el tileado de fondo diff --git a/source/core/rendering/writer.cpp b/source/core/rendering/writer.cpp index ab22dd0..25eccfe 100644 --- a/source/core/rendering/writer.cpp +++ b/source/core/rendering/writer.cpp @@ -1,6 +1,6 @@ -#include "writer.hpp" +#include "core/rendering/writer.hpp" -#include "text.hpp" // Para Text +#include "core/rendering/text.hpp" // Para Text // Actualiza el objeto (delta_time en ms) void Writer::update(float delta_time) { diff --git a/source/core/resources/asset.cpp b/source/core/resources/asset.cpp index c71d8fa..8d839e1 100644 --- a/source/core/resources/asset.cpp +++ b/source/core/resources/asset.cpp @@ -1,4 +1,4 @@ -#include "asset.hpp" +#include "core/resources/asset.hpp" #include // Para SDL_LogWarn, SDL_LogCategory, SDL_LogError @@ -11,8 +11,8 @@ #include // Para basic_istringstream #include // Para runtime_error -#include "resource_helper.hpp" // Para loadFile -#include "utils.hpp" // Para getFileName +#include "core/resources/resource_helper.hpp" // Para loadFile +#include "utils/utils.hpp" // Para getFileName // Singleton Asset* Asset::instance = nullptr; diff --git a/source/core/resources/asset_integrated.cpp b/source/core/resources/asset_integrated.cpp index 885ea6e..6c7cf88 100644 --- a/source/core/resources/asset_integrated.cpp +++ b/source/core/resources/asset_integrated.cpp @@ -1,4 +1,4 @@ -#include "asset_integrated.hpp" +#include "core/resources/asset_integrated.hpp" #include #include diff --git a/source/core/resources/asset_integrated.hpp b/source/core/resources/asset_integrated.hpp index 791e341..35da80c 100644 --- a/source/core/resources/asset_integrated.hpp +++ b/source/core/resources/asset_integrated.hpp @@ -2,8 +2,8 @@ #include -#include "asset.hpp" -#include "resource_loader.hpp" +#include "core/resources/asset.hpp" +#include "core/resources/resource_loader.hpp" // Extensión de Asset que integra ResourceLoader class AssetIntegrated : public Asset { diff --git a/source/core/resources/resource.cpp b/source/core/resources/resource.cpp index 47bef2e..3301afd 100644 --- a/source/core/resources/resource.cpp +++ b/source/core/resources/resource.cpp @@ -1,4 +1,4 @@ -#include "resource.hpp" +#include "core/resources/resource.hpp" #include // Para SDL_LogInfo, SDL_LogCategory, SDL_LogError, SDL_SetRenderDrawColor, SDL_EventType, SDL_PollEvent, SDL_RenderFillRect, SDL_RenderRect, SDLK_ESCAPE, SDL_Event @@ -12,16 +12,16 @@ #include // Para runtime_error #include // Para move -#include "asset.hpp" // Para Asset -#include "color.hpp" // Para Color, NO_COLOR_MOD -#include "external/jail_audio.hpp" // Para JA_LoadMusic, JA_LoadSound, JA_DeleteMusic, JA_DeleteSound -#include "lang.hpp" // Para getText -#include "param.hpp" // Para Param, param, ParamPlayer, ParamResource, ParamGame -#include "resource_helper.hpp" // Para loadFile -#include "screen.hpp" // Para Screen -#include "text.hpp" // Para Text -#include "utils.hpp" // Para getFileName -#include "version.h" // Para APP_NAME, GIT_HASH +#include "core/audio/jail_audio.hpp" // Para JA_LoadMusic, JA_LoadSound, JA_DeleteMusic, JA_DeleteSound +#include "core/locale/lang.hpp" // Para getText +#include "core/rendering/screen.hpp" // Para Screen +#include "core/rendering/text.hpp" // Para Text +#include "core/resources/asset.hpp" // Para Asset +#include "core/resources/resource_helper.hpp" // Para loadFile +#include "utils/color.hpp" // Para Color, NO_COLOR_MOD +#include "utils/param.hpp" // Para Param, param, ParamPlayer, ParamResource, ParamGame +#include "utils/utils.hpp" // Para getFileName +#include "version.h" // Para APP_NAME, GIT_HASH struct JA_Music_t; // lines 11-11 struct JA_Sound_t; // lines 12-12 diff --git a/source/core/resources/resource.hpp b/source/core/resources/resource.hpp index dd3894e..871a28a 100644 --- a/source/core/resources/resource.hpp +++ b/source/core/resources/resource.hpp @@ -8,10 +8,10 @@ #include // Para move #include // Para vector -#include "animated_sprite.hpp" // Para AnimationsFileBuffer -#include "demo.hpp" // Para DemoData -#include "text.hpp" // Para Text, TextFile -#include "texture.hpp" // Para Texture +#include "core/rendering/sprite/animated_sprite.hpp" // Para AnimationsFileBuffer +#include "core/rendering/text.hpp" // Para Text, TextFile +#include "core/rendering/texture.hpp" // Para Texture +#include "core/system/demo.hpp" // Para DemoData struct JA_Music_t; struct JA_Sound_t; diff --git a/source/core/resources/resource_helper.cpp b/source/core/resources/resource_helper.cpp index bab0c56..95bf4f9 100644 --- a/source/core/resources/resource_helper.cpp +++ b/source/core/resources/resource_helper.cpp @@ -1,11 +1,11 @@ -#include "resource_helper.hpp" +#include "core/resources/resource_helper.hpp" #include // Para replace #include // Para size_t #include // Para basic_ifstream, basic_ostream, basic_ios, operator<<, ios, basic_istream, endl, operator|, basic_istream::read, basic_istream::seekg, basic_istream::tellg, ifstream, streamsize #include // Para cout -#include "resource_loader.hpp" // Para ResourceLoader +#include "core/resources/resource_loader.hpp" // Para ResourceLoader namespace ResourceHelper { static bool resource_system_initialized = false; diff --git a/source/core/resources/resource_loader.cpp b/source/core/resources/resource_loader.cpp index cea09c9..04c6e9b 100644 --- a/source/core/resources/resource_loader.cpp +++ b/source/core/resources/resource_loader.cpp @@ -1,11 +1,11 @@ -#include "resource_loader.hpp" +#include "core/resources/resource_loader.hpp" #include // Para replace #include // Para exists, path, recursive_directory_iterator, directory_entry, relative #include // Para basic_ostream, basic_ifstream, operator<<, basic_ios, endl, ios, basic_istream, operator|, basic_istream::read, basic_istream::seekg, basic_istream::tellg, ifstream, streamsize #include // Para cerr, cout -#include "resource_pack.hpp" // Para ResourcePack +#include "core/resources/resource_pack.hpp" // Para ResourcePack std::unique_ptr ResourceLoader::instance = nullptr; diff --git a/source/core/resources/resource_pack.cpp b/source/core/resources/resource_pack.cpp index 2c2cc1f..b788484 100644 --- a/source/core/resources/resource_pack.cpp +++ b/source/core/resources/resource_pack.cpp @@ -1,4 +1,4 @@ -#include "resource_pack.hpp" +#include "core/resources/resource_pack.hpp" #include // Para replace #include // Para array diff --git a/source/core/system/defaults.hpp b/source/core/system/defaults.hpp index 4215e3d..51edf51 100644 --- a/source/core/system/defaults.hpp +++ b/source/core/system/defaults.hpp @@ -4,7 +4,7 @@ #include -#include "ui/notifier.hpp" // Para Notifier::Position +#include "game/ui/notifier.hpp" // Para Notifier::Position namespace Defaults::Game { constexpr float WIDTH = 320.0F; diff --git a/source/core/system/demo.cpp b/source/core/system/demo.cpp index 513412b..a0cd64f 100644 --- a/source/core/system/demo.cpp +++ b/source/core/system/demo.cpp @@ -1,12 +1,12 @@ -#include "demo.hpp" +#include "core/system/demo.hpp" #include // Para SDL_IOStream, SDL_IOFromConstMem, SDL_IOFromFile, SDL_ReadIO, SDL_WriteIO, SDL_CloseIO #include // Para std::cout #include // Para runtime_error -#include "resource_helper.hpp" // Para ResourceHelper -#include "utils.hpp" // Para getFileName +#include "core/resources/resource_helper.hpp" // Para ResourceHelper +#include "utils/utils.hpp" // Para getFileName // Carga el fichero de datos para la demo auto loadDemoDataFromFile(const std::string& file_path) -> DemoData { diff --git a/source/core/system/director.cpp b/source/core/system/director.cpp index e17059e..04b9de0 100644 --- a/source/core/system/director.cpp +++ b/source/core/system/director.cpp @@ -1,5 +1,5 @@ // IWYU pragma: no_include -#include "director.hpp" +#include "core/system/director.hpp" #include // Para SDL_SetLogPriority, SDL_LogCategory, SDL_LogPriority, SDL_Quit @@ -11,31 +11,31 @@ #include // Para runtime_error #include // Para allocator, basic_string, char_traits, operator+, string, operator== -#include "asset.hpp" // Para Asset -#include "audio.hpp" // Para Audio -#include "external/fkyaml_node.hpp" // Para fkyaml::node -#include "global_events.hpp" // Para GlobalEvents::handle -#include "input.hpp" // Para Input -#include "lang.hpp" // Para setLanguage -#include "manage_hiscore_table.hpp" // Para ManageHiScoreTable -#include "options.hpp" // Para Settings, loadFromFile, saveToFile, settings, setConfigFile, setControllersFile -#include "param.hpp" // Para loadParamsFromFile -#include "player.hpp" // Para Player -#include "resource.hpp" // Para Resource -#include "resource_helper.hpp" // Para initializeResourceSystem -#include "screen.hpp" // Para Screen -#include "section.hpp" // Para Name, Options, name, options, AttractMode, attract_mode -#include "sections/credits.hpp" // Para Credits -#include "sections/game.hpp" // Para Game -#include "sections/hiscore_table.hpp" // Para HiScoreTable -#include "sections/instructions.hpp" // Para Instructions -#include "sections/intro.hpp" // Para Intro -#include "sections/logo.hpp" // Para Logo -#include "sections/title.hpp" // Para Title -#include "shutdown.hpp" // Para resultToString, shutdownSystem, ShutdownResult -#include "system_utils.hpp" // Para createApplicationFolder, resultToString, Result -#include "ui/notifier.hpp" // Para Notifier -#include "ui/service_menu.hpp" // Para ServiceMenu +#include "core/audio/audio.hpp" // Para Audio +#include "core/input/input.hpp" // Para Input +#include "core/locale/lang.hpp" // Para setLanguage +#include "core/rendering/screen.hpp" // Para Screen +#include "core/resources/asset.hpp" // Para Asset +#include "core/resources/resource.hpp" // Para Resource +#include "core/resources/resource_helper.hpp" // Para initializeResourceSystem +#include "core/system/global_events.hpp" // Para GlobalEvents::handle +#include "core/system/section.hpp" // Para Name, Options, name, options, AttractMode, attract_mode +#include "core/system/shutdown.hpp" // Para resultToString, shutdownSystem, ShutdownResult +#include "core/system/system_utils.hpp" // Para createApplicationFolder, resultToString, Result +#include "external/fkyaml_node.hpp" // Para fkyaml::node +#include "game/entities/player.hpp" // Para Player +#include "game/gameplay/manage_hiscore_table.hpp" // Para ManageHiScoreTable +#include "game/options.hpp" // Para Settings, loadFromFile, saveToFile, settings, setConfigFile, setControllersFile +#include "game/scenes/credits.hpp" // Para Credits +#include "game/scenes/game.hpp" // Para Game +#include "game/scenes/hiscore_table.hpp" // Para HiScoreTable +#include "game/scenes/instructions.hpp" // Para Instructions +#include "game/scenes/intro.hpp" // Para Intro +#include "game/scenes/logo.hpp" // Para Logo +#include "game/scenes/title.hpp" // Para Title +#include "game/ui/notifier.hpp" // Para Notifier +#include "game/ui/service_menu.hpp" // Para ServiceMenu +#include "utils/param.hpp" // Para loadParamsFromFile // Constructor Director::Director() { diff --git a/source/core/system/director.hpp b/source/core/system/director.hpp index 5ac99a4..9d5cf75 100644 --- a/source/core/system/director.hpp +++ b/source/core/system/director.hpp @@ -5,7 +5,7 @@ #include // Para unique_ptr #include // Para string -#include "section.hpp" // Para Section::Name +#include "core/system/section.hpp" // Para Section::Name namespace Lang { enum class Code : int; diff --git a/source/core/system/global_events.cpp b/source/core/system/global_events.cpp index 19e0ecb..2305196 100644 --- a/source/core/system/global_events.cpp +++ b/source/core/system/global_events.cpp @@ -1,4 +1,4 @@ -#include "global_events.hpp" +#include "core/system/global_events.hpp" #include // Para SDL_EventType, SDL_Event, SDL_LogInfo, SDL_LogCategory @@ -7,14 +7,14 @@ #include // Para allocator, operator+, string #include // Para vector -#include "input.hpp" // Para Input -#include "lang.hpp" // Para getText -#include "mouse.hpp" // Para handleEvent -#include "options.hpp" // Para GamepadManager, gamepad_manager -#include "screen.hpp" // Para Screen -#include "section.hpp" // Para Name, Options, name, options -#include "ui/notifier.hpp" // Para Notifier -#include "ui/service_menu.hpp" // Para ServiceMenu +#include "core/input/input.hpp" // Para Input +#include "core/input/mouse.hpp" // Para handleEvent +#include "core/locale/lang.hpp" // Para getText +#include "core/rendering/screen.hpp" // Para Screen +#include "core/system/section.hpp" // Para Name, Options, name, options +#include "game/options.hpp" // Para GamepadManager, gamepad_manager +#include "game/ui/notifier.hpp" // Para Notifier +#include "game/ui/service_menu.hpp" // Para ServiceMenu namespace GlobalEvents { // Comprueba los eventos de Input y muestra notificaciones diff --git a/source/core/system/shutdown.cpp b/source/core/system/shutdown.cpp index e311f88..2ec3d7c 100644 --- a/source/core/system/shutdown.cpp +++ b/source/core/system/shutdown.cpp @@ -1,4 +1,4 @@ -#include "shutdown.hpp" +#include "core/system/shutdown.hpp" #include // Para pid_t diff --git a/source/core/system/system_utils.cpp b/source/core/system/system_utils.cpp index d6dd8a5..c32a034 100644 --- a/source/core/system/system_utils.cpp +++ b/source/core/system/system_utils.cpp @@ -1,4 +1,4 @@ -#include "system_utils.hpp" +#include "core/system/system_utils.hpp" #include // Para stat, mkdir, S_ISDIR diff --git a/source/game/entities/balloon.cpp b/source/game/entities/balloon.cpp index 3cb5105..ac0b2f9 100644 --- a/source/game/entities/balloon.cpp +++ b/source/game/entities/balloon.cpp @@ -1,14 +1,14 @@ -#include "balloon.hpp" +#include "game/entities/balloon.hpp" #include // Para clamp #include // Para array #include // Para fabs -#include "animated_sprite.hpp" // Para AnimatedSprite -#include "audio.hpp" // Para Audio -#include "param.hpp" // Para Param, ParamBalloon, param -#include "sprite.hpp" // Para Sprite -#include "texture.hpp" // Para Texture +#include "core/audio/audio.hpp" // Para Audio +#include "core/rendering/sprite/animated_sprite.hpp" // Para AnimatedSprite +#include "core/rendering/sprite/sprite.hpp" // Para Sprite +#include "core/rendering/texture.hpp" // Para Texture +#include "utils/param.hpp" // Para Param, ParamBalloon, param // Constructor Balloon::Balloon(const Config& config) diff --git a/source/game/entities/balloon.hpp b/source/game/entities/balloon.hpp index 404cf40..29bf696 100644 --- a/source/game/entities/balloon.hpp +++ b/source/game/entities/balloon.hpp @@ -8,8 +8,8 @@ #include // Para string_view #include // Para vector -#include "animated_sprite.hpp" // Para AnimatedSprite -#include "utils.hpp" // Para Circle +#include "core/rendering/sprite/animated_sprite.hpp" // Para AnimatedSprite +#include "utils/utils.hpp" // Para Circle class Texture; diff --git a/source/game/entities/bullet.cpp b/source/game/entities/bullet.cpp index d267ca3..20a96b3 100644 --- a/source/game/entities/bullet.cpp +++ b/source/game/entities/bullet.cpp @@ -1,10 +1,10 @@ -#include "bullet.hpp" +#include "game/entities/bullet.hpp" #include // Para unique_ptr, make_unique #include // Para basic_string, string -#include "param.hpp" // Para Param, ParamGame, param -#include "resource.hpp" // Para Resource +#include "core/resources/resource.hpp" // Para Resource +#include "utils/param.hpp" // Para Param, ParamGame, param // Constructor Bullet::Bullet(float x, float y, Type type, Color color, int owner) diff --git a/source/game/entities/bullet.hpp b/source/game/entities/bullet.hpp index 9f49504..a5e1c31 100644 --- a/source/game/entities/bullet.hpp +++ b/source/game/entities/bullet.hpp @@ -5,8 +5,8 @@ #include // Para unique_ptr #include // Para string -#include "animated_sprite.hpp" // Para AnimatedSprite -#include "utils.hpp" // Para Circle +#include "core/rendering/sprite/animated_sprite.hpp" // Para AnimatedSprite +#include "utils/utils.hpp" // Para Circle // --- Clase Bullet: representa una bala del jugador --- class Bullet { diff --git a/source/game/entities/explosions.cpp b/source/game/entities/explosions.cpp index 45740d8..32d2c75 100644 --- a/source/game/entities/explosions.cpp +++ b/source/game/entities/explosions.cpp @@ -1,8 +1,8 @@ -#include "explosions.hpp" +#include "game/entities/explosions.hpp" #include // Para std::cmp_less -#include "animated_sprite.hpp" // Para AnimatedSprite +#include "core/rendering/sprite/animated_sprite.hpp" // Para AnimatedSprite class Texture; // lines 4-4 diff --git a/source/game/entities/explosions.hpp b/source/game/entities/explosions.hpp index 649f5bb..8a9a8a7 100644 --- a/source/game/entities/explosions.hpp +++ b/source/game/entities/explosions.hpp @@ -5,7 +5,7 @@ #include // Para move #include // Para vector -#include "animated_sprite.hpp" // Para AnimatedSprite +#include "core/rendering/sprite/animated_sprite.hpp" // Para AnimatedSprite class Texture; diff --git a/source/game/entities/item.cpp b/source/game/entities/item.cpp index ded2e76..c6bf3a0 100644 --- a/source/game/entities/item.cpp +++ b/source/game/entities/item.cpp @@ -1,11 +1,11 @@ -#include "item.hpp" +#include "game/entities/item.hpp" #include // Para clamp #include // Para fmod #include // Para rand -#include "animated_sprite.hpp" // Para AnimatedSprite -#include "param.hpp" // Para Param, ParamGame, param +#include "core/rendering/sprite/animated_sprite.hpp" // Para AnimatedSprite +#include "utils/param.hpp" // Para Param, ParamGame, param class Texture; // lines 6-6 diff --git a/source/game/entities/item.hpp b/source/game/entities/item.hpp index 422beba..a17fde3 100644 --- a/source/game/entities/item.hpp +++ b/source/game/entities/item.hpp @@ -6,8 +6,8 @@ #include // Para string #include // Para vector -#include "animated_sprite.hpp" // Para AnimatedSprite -#include "utils.hpp" // Para Circle +#include "core/rendering/sprite/animated_sprite.hpp" // Para AnimatedSprite +#include "utils/utils.hpp" // Para Circle class Texture; diff --git a/source/game/entities/player.cpp b/source/game/entities/player.cpp index 0df32ae..130b7cd 100644 --- a/source/game/entities/player.cpp +++ b/source/game/entities/player.cpp @@ -1,4 +1,4 @@ -#include "player.hpp" +#include "game/entities/player.hpp" #include // Para SDL_FlipMode @@ -6,17 +6,17 @@ #include // Para fmod #include // Para rand -#include "animated_sprite.hpp" // Para AnimatedSprite -#include "asset.hpp" // Para Asset -#include "audio.hpp" // Para Audio -#include "cooldown.hpp" // Para Cooldown -#include "input.hpp" // Para Input -#include "input_types.hpp" // Para InputAction -#include "manage_hiscore_table.hpp" // Para ManageHiScoreTable, HiScoreEntry -#include "param.hpp" // Para Param, ParamGame, param -#include "scoreboard.hpp" // Para Scoreboard -#include "stage_interface.hpp" // Para IStageInfo -#include "texture.hpp" // Para Texture +#include "core/audio/audio.hpp" // Para Audio +#include "core/input/input.hpp" // Para Input +#include "core/input/input_types.hpp" // Para InputAction +#include "core/rendering/sprite/animated_sprite.hpp" // Para AnimatedSprite +#include "core/rendering/texture.hpp" // Para Texture +#include "core/resources/asset.hpp" // Para Asset +#include "core/system/stage_interface.hpp" // Para IStageInfo +#include "game/gameplay/cooldown.hpp" // Para Cooldown +#include "game/gameplay/manage_hiscore_table.hpp" // Para ManageHiScoreTable, HiScoreEntry +#include "game/gameplay/scoreboard.hpp" // Para Scoreboard +#include "utils/param.hpp" // Para Param, ParamGame, param // Constructor Player::Player(const Config& config) diff --git a/source/game/entities/player.hpp b/source/game/entities/player.hpp index 80ab9e6..f4aca90 100644 --- a/source/game/entities/player.hpp +++ b/source/game/entities/player.hpp @@ -9,14 +9,14 @@ #include // Para move, pair #include // Para vector -#include "animated_sprite.hpp" // for AnimatedSprite -#include "bullet.hpp" // for Bullet -#include "cooldown.hpp" -#include "enter_name.hpp" // for EnterName -#include "input.hpp" // for Input -#include "manage_hiscore_table.hpp" // for Table -#include "scoreboard.hpp" // for Scoreboard -#include "utils.hpp" // for Circle +#include "core/input/input.hpp" // for Input +#include "core/rendering/sprite/animated_sprite.hpp" // for AnimatedSprite +#include "game/entities/bullet.hpp" // for Bullet +#include "game/gameplay/cooldown.hpp" +#include "game/gameplay/enter_name.hpp" // for EnterName +#include "game/gameplay/manage_hiscore_table.hpp" // for Table +#include "game/gameplay/scoreboard.hpp" // for Scoreboard +#include "utils/utils.hpp" // for Circle class IStageInfo; class Texture; diff --git a/source/game/entities/tabe.cpp b/source/game/entities/tabe.cpp index f632bd5..b00bda3 100644 --- a/source/game/entities/tabe.cpp +++ b/source/game/entities/tabe.cpp @@ -1,5 +1,5 @@ // IWYU pragma: no_include -#include "tabe.hpp" +#include "game/entities/tabe.hpp" #include // Para SDL_FlipMode, SDL_GetTicks @@ -8,10 +8,10 @@ #include // Para rand, abs #include // Para basic_string -#include "audio.hpp" // Para Audio -#include "param.hpp" // Para Param, param, ParamGame, ParamTabe -#include "resource.hpp" // Para Resource -#include "utils.hpp" // Para Zone +#include "core/audio/audio.hpp" // Para Audio +#include "core/resources/resource.hpp" // Para Resource +#include "utils/param.hpp" // Para Param, param, ParamGame, ParamTabe +#include "utils/utils.hpp" // Para Zone // Constructor Tabe::Tabe() diff --git a/source/game/entities/tabe.hpp b/source/game/entities/tabe.hpp index f2266e9..6161b81 100644 --- a/source/game/entities/tabe.hpp +++ b/source/game/entities/tabe.hpp @@ -5,7 +5,7 @@ #include // Para rand #include // Para unique_ptr -#include "animated_sprite.hpp" // Para AnimatedSprite +#include "core/rendering/sprite/animated_sprite.hpp" // Para AnimatedSprite // --- Clase Tabe --- class Tabe { diff --git a/source/game/gameplay/balloon_formations.cpp b/source/game/gameplay/balloon_formations.cpp index 3014ba2..95b30e7 100644 --- a/source/game/gameplay/balloon_formations.cpp +++ b/source/game/gameplay/balloon_formations.cpp @@ -1,4 +1,4 @@ -#include "balloon_formations.hpp" +#include "game/gameplay/balloon_formations.hpp" #include // Para max, min, copy #include // Para array @@ -12,10 +12,10 @@ #include // Para string, char_traits, allocator, operator==, stoi, getline, operator<=>, basic_string #include // Para std::cmp_less -#include "asset.hpp" // Para Asset -#include "balloon.hpp" // Para Balloon -#include "param.hpp" // Para Param, ParamGame, param -#include "utils.hpp" // Para Zone, BLOCK +#include "core/resources/asset.hpp" // Para Asset +#include "game/entities/balloon.hpp" // Para Balloon +#include "utils/param.hpp" // Para Param, ParamGame, param +#include "utils/utils.hpp" // Para Zone, BLOCK void BalloonFormations::initFormations() { // Calcular posiciones base diff --git a/source/game/gameplay/balloon_formations.hpp b/source/game/gameplay/balloon_formations.hpp index 5809b1d..2a0c6dd 100644 --- a/source/game/gameplay/balloon_formations.hpp +++ b/source/game/gameplay/balloon_formations.hpp @@ -8,7 +8,7 @@ #include // Para pair #include // Para vector -#include "balloon.hpp" // for Balloon +#include "game/entities/balloon.hpp" // for Balloon // --- Clase BalloonFormations --- class BalloonFormations { diff --git a/source/game/gameplay/balloon_manager.cpp b/source/game/gameplay/balloon_manager.cpp index 76ed8a4..cb234b4 100644 --- a/source/game/gameplay/balloon_manager.cpp +++ b/source/game/gameplay/balloon_manager.cpp @@ -1,19 +1,19 @@ -#include "balloon_manager.hpp" +#include "game/gameplay/balloon_manager.hpp" #include // Para remove_if #include #include // Para rand #include // Para accumulate -#include "balloon.hpp" // Para Balloon, Balloon::SCORE.at( )ALLOON_VELX... -#include "balloon_formations.hpp" // Para BalloonFormationParams, BalloonForma... -#include "color.hpp" // Para Zone, Color, flash_color -#include "explosions.hpp" // Para Explosions -#include "param.hpp" // Para Param, ParamGame, param -#include "resource.hpp" // Para Resource -#include "screen.hpp" // Para Screen -#include "stage_interface.hpp" // Para IStageInfo -#include "utils.hpp" +#include "core/rendering/screen.hpp" // Para Screen +#include "core/resources/resource.hpp" // Para Resource +#include "core/system/stage_interface.hpp" // Para IStageInfo +#include "game/entities/balloon.hpp" // Para Balloon, Balloon::SCORE.at( )ALLOON_VELX... +#include "game/entities/explosions.hpp" // Para Explosions +#include "game/gameplay/balloon_formations.hpp" // Para BalloonFormationParams, BalloonForma... +#include "utils/color.hpp" // Para Zone, Color, flash_color +#include "utils/param.hpp" // Para Param, ParamGame, param +#include "utils/utils.hpp" // Constructor BalloonManager::BalloonManager(IStageInfo* stage_info) diff --git a/source/game/gameplay/balloon_manager.hpp b/source/game/gameplay/balloon_manager.hpp index 5387cf5..234ac1c 100644 --- a/source/game/gameplay/balloon_manager.hpp +++ b/source/game/gameplay/balloon_manager.hpp @@ -8,11 +8,11 @@ #include // Para basic_string, string #include // Para vector -#include "balloon.hpp" // for Balloon -#include "balloon_formations.hpp" // for BalloonFormations -#include "explosions.hpp" // for Explosions -#include "param.hpp" // for Param, ParamGame, param -#include "utils.hpp" // for Zone +#include "game/entities/balloon.hpp" // for Balloon +#include "game/entities/explosions.hpp" // for Explosions +#include "game/gameplay/balloon_formations.hpp" // for BalloonFormations +#include "utils/param.hpp" // for Param, ParamGame, param +#include "utils/utils.hpp" // for Zone class IStageInfo; class Texture; diff --git a/source/game/gameplay/bullet_manager.cpp b/source/game/gameplay/bullet_manager.cpp index 51af17b..daf23c9 100644 --- a/source/game/gameplay/bullet_manager.cpp +++ b/source/game/gameplay/bullet_manager.cpp @@ -1,11 +1,11 @@ -#include "bullet_manager.hpp" +#include "game/gameplay/bullet_manager.hpp" #include // Para remove_if #include -#include "bullet.hpp" // Para Bullet -#include "param.hpp" // Para Param, ParamGame, param -#include "utils.hpp" // Para Circle, Zone +#include "game/entities/bullet.hpp" // Para Bullet +#include "utils/param.hpp" // Para Param, ParamGame, param +#include "utils/utils.hpp" // Para Circle, Zone // Constructor BulletManager::BulletManager() diff --git a/source/game/gameplay/bullet_manager.hpp b/source/game/gameplay/bullet_manager.hpp index 156ea95..c731be1 100644 --- a/source/game/gameplay/bullet_manager.hpp +++ b/source/game/gameplay/bullet_manager.hpp @@ -7,7 +7,7 @@ #include // Para shared_ptr #include // Para vector -#include "bullet.hpp" // for Bullet +#include "game/entities/bullet.hpp" // for Bullet // --- Types --- using Bullets = std::list>; diff --git a/source/game/gameplay/difficulty.cpp b/source/game/gameplay/difficulty.cpp index 4f3550c..f771702 100644 --- a/source/game/gameplay/difficulty.cpp +++ b/source/game/gameplay/difficulty.cpp @@ -1,4 +1,4 @@ -#include "difficulty.hpp" +#include "game/gameplay/difficulty.hpp" #include // Para vector diff --git a/source/game/gameplay/enter_name.cpp b/source/game/gameplay/enter_name.cpp index ef8cb71..0e83a0a 100644 --- a/source/game/gameplay/enter_name.cpp +++ b/source/game/gameplay/enter_name.cpp @@ -1,4 +1,4 @@ -#include "enter_name.hpp" +#include "game/gameplay/enter_name.hpp" #include // Para array #include // Para rand diff --git a/source/game/gameplay/game_logo.cpp b/source/game/gameplay/game_logo.cpp index 3aeb536..bba351a 100644 --- a/source/game/gameplay/game_logo.cpp +++ b/source/game/gameplay/game_logo.cpp @@ -1,19 +1,19 @@ -#include "game_logo.hpp" +#include "game/gameplay/game_logo.hpp" #include // Para SDL_SetTextureScaleMode, SDL_FlipMode, SDL_ScaleMode #include // Para max #include // Para basic_string -#include "animated_sprite.hpp" // Para AnimatedSprite -#include "audio.hpp" // Para Audio -#include "color.hpp" // Para Color -#include "param.hpp" // Para Param, param, ParamGame, ParamTitle -#include "resource.hpp" // Para Resource -#include "screen.hpp" // Para Screen -#include "smart_sprite.hpp" // Para SmartSprite -#include "sprite.hpp" // Para Sprite -#include "texture.hpp" // Para Texture +#include "core/audio/audio.hpp" // Para Audio +#include "core/rendering/screen.hpp" // Para Screen +#include "core/rendering/sprite/animated_sprite.hpp" // Para AnimatedSprite +#include "core/rendering/sprite/smart_sprite.hpp" // Para SmartSprite +#include "core/rendering/sprite/sprite.hpp" // Para Sprite +#include "core/rendering/texture.hpp" // Para Texture +#include "core/resources/resource.hpp" // Para Resource +#include "utils/color.hpp" // Para Color +#include "utils/param.hpp" // Para Param, param, ParamGame, ParamTitle constexpr int ZOOM_FACTOR = 5; constexpr float FLASH_DELAY_S = 0.05F; // 3 frames → 0.05s diff --git a/source/game/gameplay/game_logo.hpp b/source/game/gameplay/game_logo.hpp index ed3cdac..eaf2f3a 100644 --- a/source/game/gameplay/game_logo.hpp +++ b/source/game/gameplay/game_logo.hpp @@ -2,9 +2,9 @@ #include // Para unique_ptr, shared_ptr -#include "animated_sprite.hpp" // Para AnimatedSprite -#include "smart_sprite.hpp" // Para SmartSprite -#include "sprite.hpp" // Para Sprite +#include "core/rendering/sprite/animated_sprite.hpp" // Para AnimatedSprite +#include "core/rendering/sprite/smart_sprite.hpp" // Para SmartSprite +#include "core/rendering/sprite/sprite.hpp" // Para Sprite class Texture; diff --git a/source/game/gameplay/manage_hiscore_table.cpp b/source/game/gameplay/manage_hiscore_table.cpp index 54de1ba..3c852c6 100644 --- a/source/game/gameplay/manage_hiscore_table.cpp +++ b/source/game/gameplay/manage_hiscore_table.cpp @@ -1,4 +1,4 @@ -#include "manage_hiscore_table.hpp" +#include "game/gameplay/manage_hiscore_table.hpp" #include // Para SDL_ReadIO, SDL_WriteIO, SDL_CloseIO, SDL_GetError, SDL_IOFromFile, SDL_LogError, SDL_LogCategory, SDL_LogInfo @@ -11,7 +11,7 @@ #include // Para __find_if_fn, find_if #include // Para move -#include "utils.hpp" // Para getFileName +#include "utils/utils.hpp" // Para getFileName // Resetea la tabla a los valores por defecto void ManageHiScoreTable::clear() { diff --git a/source/game/gameplay/scoreboard.cpp b/source/game/gameplay/scoreboard.cpp index 7a1f77b..152cc0c 100644 --- a/source/game/gameplay/scoreboard.cpp +++ b/source/game/gameplay/scoreboard.cpp @@ -1,4 +1,4 @@ -#include "scoreboard.hpp" +#include "game/gameplay/scoreboard.hpp" #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 @@ -8,16 +8,16 @@ #include #include // Para basic_ostream, basic_ostringstream, basic_ostream::operator<<, ostringstream -#include "color.hpp" -#include "enter_name.hpp" // Para NAME_SIZE -#include "lang.hpp" // Para getText -#include "param.hpp" // Para Param, ParamScoreboard, param -#include "resource.hpp" // Para Resource -#include "screen.hpp" // Para Screen -#include "sprite.hpp" // Para Sprite -#include "text.hpp" // Para Text, Text::CENTER, Text::COLOR -#include "texture.hpp" // Para Texture -#include "utils.hpp" // Para easeOutCubic +#include "core/locale/lang.hpp" // Para getText +#include "core/rendering/screen.hpp" // Para Screen +#include "core/rendering/sprite/sprite.hpp" // Para Sprite +#include "core/rendering/text.hpp" // Para Text, Text::CENTER, Text::COLOR +#include "core/rendering/texture.hpp" // Para Texture +#include "core/resources/resource.hpp" // Para Resource +#include "game/gameplay/enter_name.hpp" // Para NAME_SIZE +#include "utils/color.hpp" +#include "utils/param.hpp" // Para Param, ParamScoreboard, param +#include "utils/utils.hpp" // Para easeOutCubic // .at(SINGLETON) Hay que definir las variables estáticas, desde el .h sólo la hemos declarado Scoreboard* Scoreboard::instance = nullptr; diff --git a/source/game/gameplay/scoreboard.hpp b/source/game/gameplay/scoreboard.hpp index e54fc13..ba49747 100644 --- a/source/game/gameplay/scoreboard.hpp +++ b/source/game/gameplay/scoreboard.hpp @@ -11,7 +11,7 @@ // Forward declarations class EnterName; -#include "color.hpp" // Para Color +#include "utils/color.hpp" // Para Color class Sprite; class Text; diff --git a/source/game/gameplay/stage.cpp b/source/game/gameplay/stage.cpp index 4e76fe4..415cefe 100644 --- a/source/game/gameplay/stage.cpp +++ b/source/game/gameplay/stage.cpp @@ -1,4 +1,4 @@ -#include "stage.hpp" +#include "game/gameplay/stage.hpp" #include // Para max, min #include // Para exception diff --git a/source/game/gameplay/stage.hpp b/source/game/gameplay/stage.hpp index 84eb7c1..c0539ee 100644 --- a/source/game/gameplay/stage.hpp +++ b/source/game/gameplay/stage.hpp @@ -6,7 +6,7 @@ #include // Para basic_string, string #include // Para vector -#include "stage_interface.hpp" // for IStageInfo +#include "core/system/stage_interface.hpp" // for IStageInfo // --- Enums --- enum class PowerCollectionState { diff --git a/source/game/options.cpp b/source/game/options.cpp index aac7dbd..bdc240c 100644 --- a/source/game/options.cpp +++ b/source/game/options.cpp @@ -1,4 +1,4 @@ -#include "options.hpp" +#include "game/options.hpp" #include // Para SDL_ScaleMode, SDL_LogCategory, SDL_LogError, SDL_LogInfo, SDL_LogWarn @@ -9,11 +9,11 @@ #include // Para string #include // Para vector -#include "difficulty.hpp" // Para Code, init -#include "external/fkyaml_node.hpp" // Para fkyaml::node -#include "input.hpp" // Para Input -#include "lang.hpp" // Para getText, Code -#include "utils.hpp" // Para boolToString, getFileName +#include "core/input/input.hpp" // Para Input +#include "core/locale/lang.hpp" // Para getText, Code +#include "external/fkyaml_node.hpp" // Para fkyaml::node +#include "game/gameplay/difficulty.hpp" // Para Code, init +#include "utils/utils.hpp" // Para boolToString, getFileName namespace Options { // --- Variables globales --- diff --git a/source/game/options.hpp b/source/game/options.hpp index 093e617..e65c115 100644 --- a/source/game/options.hpp +++ b/source/game/options.hpp @@ -13,13 +13,13 @@ #include // Para move #include // Para vector -#include "defaults.hpp" -#include "difficulty.hpp" // for Code -#include "input.hpp" // for Input -#include "lang.hpp" // for Code -#include "manage_hiscore_table.hpp" // for ManageHiScoreTable, Table -#include "player.hpp" // for Player -#include "rendering/shader_backend.hpp" // for Rendering::ShaderType +#include "core/input/input.hpp" // for Input +#include "core/locale/lang.hpp" // for Code +#include "core/rendering/shader_backend.hpp" // for Rendering::ShaderType +#include "core/system/defaults.hpp" +#include "game/entities/player.hpp" // for Player +#include "game/gameplay/difficulty.hpp" // for Code +#include "game/gameplay/manage_hiscore_table.hpp" // for ManageHiScoreTable, Table // --- Namespace Options: gestión de configuración y opciones del juego --- namespace Options { diff --git a/source/game/scenes/credits.cpp b/source/game/scenes/credits.cpp index 20363b1..842aedc 100644 --- a/source/game/scenes/credits.cpp +++ b/source/game/scenes/credits.cpp @@ -1,5 +1,5 @@ // IWYU pragma: no_include -#include "credits.hpp" +#include "game/scenes/credits.hpp" #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, Uint64 @@ -11,25 +11,25 @@ #include // Para string_view #include // Para vector -#include "audio.hpp" // Para Audio -#include "balloon_manager.hpp" // Para BalloonManager -#include "color.hpp" // Para Color, SHADOW_TEXT, NO_COLOR_MOD -#include "fade.hpp" // Para Fade -#include "global_events.hpp" // Para handle -#include "global_inputs.hpp" // Para check -#include "input.hpp" // Para Input -#include "lang.hpp" // Para getText -#include "param.hpp" // Para Param, param, ParamGame, ParamFade -#include "player.hpp" // Para Player -#include "resource.hpp" // Para Resource -#include "screen.hpp" // Para Screen -#include "section.hpp" // Para Name, name -#include "sprite.hpp" // Para Sprite -#include "text.hpp" // Para Text -#include "texture.hpp" // Para Texture -#include "tiled_bg.hpp" // Para TiledBG, TiledBGMode -#include "ui/service_menu.hpp" // Para ServiceMenu -#include "utils.hpp" // Para Zone +#include "core/audio/audio.hpp" // Para Audio +#include "core/input/global_inputs.hpp" // Para check +#include "core/input/input.hpp" // Para Input +#include "core/locale/lang.hpp" // Para getText +#include "core/rendering/fade.hpp" // Para Fade +#include "core/rendering/screen.hpp" // Para Screen +#include "core/rendering/sprite/sprite.hpp" // Para Sprite +#include "core/rendering/text.hpp" // Para Text +#include "core/rendering/texture.hpp" // Para Texture +#include "core/rendering/tiled_bg.hpp" // Para TiledBG, TiledBGMode +#include "core/resources/resource.hpp" // Para Resource +#include "core/system/global_events.hpp" // Para handle +#include "core/system/section.hpp" // Para Name, name +#include "game/entities/player.hpp" // Para Player +#include "game/gameplay/balloon_manager.hpp" // Para BalloonManager +#include "game/ui/service_menu.hpp" // Para ServiceMenu +#include "utils/color.hpp" // Para Color, SHADOW_TEXT, NO_COLOR_MOD +#include "utils/param.hpp" // Para Param, param, ParamGame, ParamFade +#include "utils/utils.hpp" // Para Zone // Textos constexpr std::string_view TEXT_COPYRIGHT = "@2020,2025 JailDesigner"; diff --git a/source/game/scenes/credits.hpp b/source/game/scenes/credits.hpp index e71c262..f0149f1 100644 --- a/source/game/scenes/credits.hpp +++ b/source/game/scenes/credits.hpp @@ -5,10 +5,10 @@ #include // Para unique_ptr, shared_ptr #include // Para vector -#include "color.hpp" // Para Zone, Color -#include "options.hpp" // Para AudioOptions, MusicOptions, audio -#include "param.hpp" // Para Param, ParamGame, param -#include "utils.hpp" +#include "game/options.hpp" // Para AudioOptions, MusicOptions, audio +#include "utils/color.hpp" // Para Zone, Color +#include "utils/param.hpp" // Para Param, ParamGame, param +#include "utils/utils.hpp" // Declaraciones adelantadas class BalloonManager; diff --git a/source/game/scenes/game.cpp b/source/game/scenes/game.cpp index 4e2e6fc..f5f5739 100644 --- a/source/game/scenes/game.cpp +++ b/source/game/scenes/game.cpp @@ -1,4 +1,4 @@ -#include "game.hpp" +#include "game/scenes/game.hpp" #include // Para SDL_GetTicks, SDL_SetRenderTarget, SDL_EventType, SDL_CreateTexture, SDL_Delay, SDL_DestroyTexture, SDL_Event, SDL_GetRenderTarget, SDL_PollEvent, SDL_RenderTexture, SDL_SetTextureBlendMode, SDLK_1, SDLK_2, SDLK_3, SDLK_4, SDLK_5, SDLK_6, SDLK_7, SDLK_8, SDLK_9, SDLK_KP_MINUS, SDLK_KP_PLUS, SDL_BLENDMODE_BLEND, SDL_PixelFormat, SDL_Point, SDL_TextureAccess, Uint64 @@ -13,42 +13,42 @@ #include // Para random_device, default_random_engine #include // Para move -#include "asset.hpp" // Para Asset -#include "audio.hpp" // Para Audio -#include "background.hpp" // Para Background -#include "balloon.hpp" // Para Balloon -#include "balloon_manager.hpp" // Para BalloonManager -#include "bullet.hpp" // Para Bullet -#include "bullet_manager.hpp" // Para BulletManager -#include "color.hpp" // Para Color, FLASH, NO_COLOR_MOD -#include "difficulty.hpp" // Para Code -#include "fade.hpp" // Para Fade -#include "global_events.hpp" // Para handle -#include "global_inputs.hpp" // Para check -#include "input.hpp" // Para Input -#include "input_types.hpp" // Para InputAction -#include "item.hpp" // Para Item, ItemType -#include "lang.hpp" // Para getText -#include "manage_hiscore_table.hpp" // Para HiScoreEntry, ManageHiScoreTable -#include "param.hpp" // Para Param, param, ParamGame, ParamScoreboard, ParamFade, ParamBalloon -#include "path_sprite.hpp" // Para Path, PathSprite, PathType -#include "pause_manager.hpp" // Para PauseManager -#include "player.hpp" // Para Player -#include "resource.hpp" // Para Resource -#include "scoreboard.hpp" // Para Scoreboard -#include "screen.hpp" // Para Screen -#include "section.hpp" // Para Name, name, AttractMode, Options, attract_mode, options -#include "smart_sprite.hpp" // Para SmartSprite -#include "stage.hpp" // Para StageManager, StageData -#include "tabe.hpp" // Para Tabe -#include "text.hpp" // Para Text -#include "texture.hpp" // Para Texture -#include "ui/service_menu.hpp" // Para ServiceMenu -#include "utils.hpp" // Para Zone, checkCollision, easeInQuint, easeOutQuint, boolToString +#include "core/audio/audio.hpp" // Para Audio +#include "core/input/global_inputs.hpp" // Para check +#include "core/input/input.hpp" // Para Input +#include "core/input/input_types.hpp" // Para InputAction +#include "core/input/pause_manager.hpp" // Para PauseManager +#include "core/locale/lang.hpp" // Para getText +#include "core/rendering/background.hpp" // Para Background +#include "core/rendering/fade.hpp" // Para Fade +#include "core/rendering/screen.hpp" // Para Screen +#include "core/rendering/sprite/path_sprite.hpp" // Para Path, PathSprite, PathType +#include "core/rendering/sprite/smart_sprite.hpp" // Para SmartSprite +#include "core/rendering/text.hpp" // Para Text +#include "core/rendering/texture.hpp" // Para Texture +#include "core/resources/asset.hpp" // Para Asset +#include "core/resources/resource.hpp" // Para Resource +#include "core/system/global_events.hpp" // Para handle +#include "core/system/section.hpp" // Para Name, name, AttractMode, Options, attract_mode, options +#include "game/entities/balloon.hpp" // Para Balloon +#include "game/entities/bullet.hpp" // Para Bullet +#include "game/entities/item.hpp" // Para Item, ItemType +#include "game/entities/player.hpp" // Para Player +#include "game/entities/tabe.hpp" // Para Tabe +#include "game/gameplay/balloon_manager.hpp" // Para BalloonManager +#include "game/gameplay/bullet_manager.hpp" // Para BulletManager +#include "game/gameplay/difficulty.hpp" // Para Code +#include "game/gameplay/manage_hiscore_table.hpp" // Para HiScoreEntry, ManageHiScoreTable +#include "game/gameplay/scoreboard.hpp" // Para Scoreboard +#include "game/gameplay/stage.hpp" // Para StageManager, StageData +#include "game/ui/service_menu.hpp" // Para ServiceMenu +#include "utils/color.hpp" // Para Color, FLASH, NO_COLOR_MOD +#include "utils/param.hpp" // Para Param, param, ParamGame, ParamScoreboard, ParamFade, ParamBalloon +#include "utils/utils.hpp" // Para Zone, checkCollision, easeInQuint, easeOutQuint, boolToString #ifdef _DEBUG #include // Para basic_ostream, basic_ostream::operator<<, operator<<, cout -#include "ui/notifier.hpp" // Para Notifier +#include "game/ui/notifier.hpp" // Para Notifier #endif // Constructor diff --git a/source/game/scenes/game.hpp b/source/game/scenes/game.hpp index d69ef83..441f9d6 100644 --- a/source/game/scenes/game.hpp +++ b/source/game/scenes/game.hpp @@ -7,12 +7,12 @@ #include // Para string #include // Para vector -#include "bullet.hpp" // for Bullet -#include "demo.hpp" // for Demo -#include "item.hpp" // for Item (ptr only), ItemType -#include "manage_hiscore_table.hpp" // for HiScoreEntry -#include "options.hpp" // for Settings, settings -#include "player.hpp" // for Player +#include "core/system/demo.hpp" // for Demo +#include "game/entities/bullet.hpp" // for Bullet +#include "game/entities/item.hpp" // for Item (ptr only), ItemType +#include "game/entities/player.hpp" // for Player +#include "game/gameplay/manage_hiscore_table.hpp" // for HiScoreEntry +#include "game/options.hpp" // for Settings, settings class Background; class Balloon; diff --git a/source/game/scenes/hiscore_table.cpp b/source/game/scenes/hiscore_table.cpp index 1b63bbe..f53ce43 100644 --- a/source/game/scenes/hiscore_table.cpp +++ b/source/game/scenes/hiscore_table.cpp @@ -1,4 +1,4 @@ -#include "hiscore_table.hpp" +#include "game/scenes/hiscore_table.hpp" #include // Para SDL_GetTicks, SDL_SetRenderTarget @@ -8,25 +8,25 @@ #include // Para std::cmp_less #include // Para vector -#include "audio.hpp" // Para Audio -#include "background.hpp" // Para Background -#include "color.hpp" // Para Color, easeOutQuint, Colors::NO_COLOR_MOD -#include "fade.hpp" // Para Fade, FadeMode, FadeType -#include "global_events.hpp" // Para check -#include "global_inputs.hpp" // Para check -#include "input.hpp" // Para Input -#include "lang.hpp" // Para getText -#include "manage_hiscore_table.hpp" // Para HiScoreEntry -#include "options.hpp" // Para SettingsOptions, settings -#include "param.hpp" // Para Param, param, ParamGame, ParamFade -#include "path_sprite.hpp" // Para PathSprite, Path, PathType -#include "resource.hpp" // Para Resource -#include "screen.hpp" // Para Screen -#include "section.hpp" // Para Name, name, Options, options -#include "sprite.hpp" // Para Sprite -#include "text.hpp" // Para Text, Text::SHADOW, Text::COLOR -#include "texture.hpp" // Para Texture -#include "utils.hpp" +#include "core/audio/audio.hpp" // Para Audio +#include "core/input/global_inputs.hpp" // Para check +#include "core/input/input.hpp" // Para Input +#include "core/locale/lang.hpp" // Para getText +#include "core/rendering/background.hpp" // Para Background +#include "core/rendering/fade.hpp" // Para Fade, FadeMode, FadeType +#include "core/rendering/screen.hpp" // Para Screen +#include "core/rendering/sprite/path_sprite.hpp" // Para PathSprite, Path, PathType +#include "core/rendering/sprite/sprite.hpp" // Para Sprite +#include "core/rendering/text.hpp" // Para Text, Text::SHADOW, Text::COLOR +#include "core/rendering/texture.hpp" // Para Texture +#include "core/resources/resource.hpp" // Para Resource +#include "core/system/global_events.hpp" // Para check +#include "core/system/section.hpp" // Para Name, name, Options, options +#include "game/gameplay/manage_hiscore_table.hpp" // Para HiScoreEntry +#include "game/options.hpp" // Para SettingsOptions, settings +#include "utils/color.hpp" // Para Color, easeOutQuint, Colors::NO_COLOR_MOD +#include "utils/param.hpp" // Para Param, param, ParamGame, ParamFade +#include "utils/utils.hpp" // Constructor HiScoreTable::HiScoreTable() diff --git a/source/game/scenes/hiscore_table.hpp b/source/game/scenes/hiscore_table.hpp index d95a90b..c7a0376 100644 --- a/source/game/scenes/hiscore_table.hpp +++ b/source/game/scenes/hiscore_table.hpp @@ -6,8 +6,8 @@ #include // Para string #include // Para vector -#include "color.hpp" // for Color -#include "fade.hpp" // for Fade +#include "core/rendering/fade.hpp" // for Fade +#include "utils/color.hpp" // for Color class Background; class PathSprite; diff --git a/source/game/scenes/instructions.cpp b/source/game/scenes/instructions.cpp index 203eb46..eccf352 100644 --- a/source/game/scenes/instructions.cpp +++ b/source/game/scenes/instructions.cpp @@ -1,4 +1,4 @@ -#include "instructions.hpp" +#include "game/scenes/instructions.hpp" #include // Para SDL_GetTicks, SDL_SetRenderTarget, SDL_Re... @@ -8,22 +8,22 @@ #include // Para move #include // Para vector -#include "audio.hpp" // Para Audio -#include "color.hpp" // Para Color, Colors::SHADOW_TEXT, Zone, NO_TEXT_C... -#include "fade.hpp" // Para Fade, FadeMode, FadeType -#include "global_events.hpp" // Para check -#include "global_inputs.hpp" // Para check -#include "input.hpp" // Para Input -#include "item.hpp" // Para Item -#include "lang.hpp" // Para getText -#include "param.hpp" // Para Param, param, ParamGame, ParamFade, Param... -#include "resource.hpp" // Para Resource -#include "screen.hpp" // Para Screen -#include "section.hpp" // Para Name, name, Options, options -#include "sprite.hpp" // Para Sprite -#include "text.hpp" // Para Text, Text::CENTER, Text::COLOR, Text::SHADOW -#include "tiled_bg.hpp" // Para TiledBG, TiledBGMode -#include "utils.hpp" +#include "core/audio/audio.hpp" // Para Audio +#include "core/input/global_inputs.hpp" // Para check +#include "core/input/input.hpp" // Para Input +#include "core/locale/lang.hpp" // Para getText +#include "core/rendering/fade.hpp" // Para Fade, FadeMode, FadeType +#include "core/rendering/screen.hpp" // Para Screen +#include "core/rendering/sprite/sprite.hpp" // Para Sprite +#include "core/rendering/text.hpp" // Para Text, Text::CENTER, Text::COLOR, Text::SHADOW +#include "core/rendering/tiled_bg.hpp" // Para TiledBG, TiledBGMode +#include "core/resources/resource.hpp" // Para Resource +#include "core/system/global_events.hpp" // Para check +#include "core/system/section.hpp" // Para Name, name, Options, options +#include "game/entities/item.hpp" // Para Item +#include "utils/color.hpp" // Para Color, Colors::SHADOW_TEXT, Zone, NO_TEXT_C... +#include "utils/param.hpp" // Para Param, param, ParamGame, ParamFade, Param... +#include "utils/utils.hpp" // Constructor Instructions::Instructions() diff --git a/source/game/scenes/intro.cpp b/source/game/scenes/intro.cpp index dad85e4..f4d3768 100644 --- a/source/game/scenes/intro.cpp +++ b/source/game/scenes/intro.cpp @@ -1,4 +1,4 @@ -#include "intro.hpp" +#include "game/scenes/intro.hpp" #include // Para SDL_GetTicks, SDL_SetRenderDrawColor, SDL_FRect, SDL_RenderFillRect, SDL_GetRenderTarget, SDL_RenderClear, SDL_RenderRect, SDL_SetRenderTarget, SDL_BLENDMODE_BLEND, SDL_PixelFormat, SDL_PollEvent, SDL_RenderTexture, SDL_TextureAccess, SDL_Event, Uint64 @@ -6,22 +6,22 @@ #include // Para basic_string, string #include // Para move -#include "audio.hpp" // Para Audio -#include "card_sprite.hpp" // Para CardSprite -#include "color.hpp" // Para Color -#include "global_events.hpp" // Para handle -#include "global_inputs.hpp" // Para check -#include "input.hpp" // Para Input -#include "lang.hpp" // Para getText -#include "param.hpp" // Para Param, param, ParamGame, ParamIntro, ParamTitle -#include "resource.hpp" // Para Resource -#include "screen.hpp" // Para Screen -#include "section.hpp" // Para Name, name, Options, options -#include "text.hpp" // Para Text -#include "texture.hpp" // Para Texture -#include "tiled_bg.hpp" // Para TiledBG, TiledBGMode -#include "utils.hpp" // Para easeOutBounce -#include "writer.hpp" // Para Writer +#include "core/audio/audio.hpp" // Para Audio +#include "core/input/global_inputs.hpp" // Para check +#include "core/input/input.hpp" // Para Input +#include "core/locale/lang.hpp" // Para getText +#include "core/rendering/screen.hpp" // Para Screen +#include "core/rendering/sprite/card_sprite.hpp" // Para CardSprite +#include "core/rendering/text.hpp" // Para Text +#include "core/rendering/texture.hpp" // Para Texture +#include "core/rendering/tiled_bg.hpp" // Para TiledBG, TiledBGMode +#include "core/rendering/writer.hpp" // Para Writer +#include "core/resources/resource.hpp" // Para Resource +#include "core/system/global_events.hpp" // Para handle +#include "core/system/section.hpp" // Para Name, name, Options, options +#include "utils/color.hpp" // Para Color +#include "utils/param.hpp" // Para Param, param, ParamGame, ParamIntro, ParamTitle +#include "utils/utils.hpp" // Para easeOutBounce // Constructor Intro::Intro() diff --git a/source/game/scenes/intro.hpp b/source/game/scenes/intro.hpp index c5a3e0d..497435d 100644 --- a/source/game/scenes/intro.hpp +++ b/source/game/scenes/intro.hpp @@ -5,11 +5,11 @@ #include // Para unique_ptr #include // Para vector -#include "card_sprite.hpp" // Para CardSprite -#include "color.hpp" // Para Color -#include "param.hpp" // Para Param, ParamIntro, param -#include "tiled_bg.hpp" // Para TiledBG -#include "writer.hpp" // Para Writer +#include "core/rendering/sprite/card_sprite.hpp" // Para CardSprite +#include "core/rendering/tiled_bg.hpp" // Para TiledBG +#include "core/rendering/writer.hpp" // Para Writer +#include "utils/color.hpp" // Para Color +#include "utils/param.hpp" // Para Param, ParamIntro, param // --- Clase Intro: secuencia cinemática de introducción del juego --- // diff --git a/source/game/scenes/logo.cpp b/source/game/scenes/logo.cpp index e1e49cb..4b68f21 100644 --- a/source/game/scenes/logo.cpp +++ b/source/game/scenes/logo.cpp @@ -1,4 +1,4 @@ -#include "logo.hpp" +#include "game/scenes/logo.hpp" #include // Para SDL_GetTicks, SDL_PollEvent, SDL_Event, SDL_FRect, Uint64 @@ -6,18 +6,18 @@ #include // Para basic_string #include // Para move -#include "audio.hpp" // Para Audio -#include "color.hpp" // Para Color -#include "global_events.hpp" // Para handle -#include "global_inputs.hpp" // Para check -#include "input.hpp" // Para Input -#include "param.hpp" // Para Param, ParamGame, param -#include "resource.hpp" // Para Resource -#include "screen.hpp" // Para Screen -#include "section.hpp" // Para Name, name -#include "sprite.hpp" // Para Sprite -#include "texture.hpp" // Para Texture -#include "utils.hpp" // Para Zone +#include "core/audio/audio.hpp" // Para Audio +#include "core/input/global_inputs.hpp" // Para check +#include "core/input/input.hpp" // Para Input +#include "core/rendering/screen.hpp" // Para Screen +#include "core/rendering/sprite/sprite.hpp" // Para Sprite +#include "core/rendering/texture.hpp" // Para Texture +#include "core/resources/resource.hpp" // Para Resource +#include "core/system/global_events.hpp" // Para handle +#include "core/system/section.hpp" // Para Name, name +#include "utils/color.hpp" // Para Color +#include "utils/param.hpp" // Para Param, ParamGame, param +#include "utils/utils.hpp" // Para Zone // Constructor Logo::Logo() diff --git a/source/game/scenes/logo.hpp b/source/game/scenes/logo.hpp index f921dc8..2d381d1 100644 --- a/source/game/scenes/logo.hpp +++ b/source/game/scenes/logo.hpp @@ -5,7 +5,7 @@ #include // Para shared_ptr, unique_ptr #include // Para vector -#include "color.hpp" // for Color +#include "utils/color.hpp" // for Color class Sprite; class Texture; diff --git a/source/game/scenes/title.cpp b/source/game/scenes/title.cpp index 7227ccb..d7b40f0 100644 --- a/source/game/scenes/title.cpp +++ b/source/game/scenes/title.cpp @@ -1,4 +1,4 @@ -#include "title.hpp" +#include "game/scenes/title.hpp" #include // Para SDL_GetTicks, SDL_Event, SDL_Keycode, SDL_PollEvent, SDLK_A, SDLK_C, SDLK_D, SDLK_F, SDLK_S, SDLK_V, SDLK_X, SDLK_Z, SDL_EventType, Uint64 @@ -6,27 +6,27 @@ #include // Para basic_string, char_traits, operator+, to_string, string #include // Para vector -#include "audio.hpp" // Para Audio -#include "color.hpp" // Para Color, NO_COLOR_MOD, TITLE_SHADOW_TEXT -#include "fade.hpp" // Para Fade -#include "game_logo.hpp" // Para GameLogo -#include "global_events.hpp" // Para handle -#include "global_inputs.hpp" // Para check -#include "input.hpp" // Para Input -#include "input_types.hpp" // Para InputAction -#include "lang.hpp" // Para getText -#include "options.hpp" // Para Gamepad, GamepadManager, gamepad_manager, Settings, settings, Keyboard, keyboard, getPlayerWhoUsesKeyboard, swapControllers, swapKeyboard -#include "param.hpp" // Para Param, param, ParamGame, ParamTitle, ParamFade -#include "player.hpp" // Para Player -#include "resource.hpp" // Para Resource -#include "screen.hpp" // Para Screen -#include "section.hpp" // Para Name, name, Options, options, AttractMode, attract_mode -#include "sprite.hpp" // Para Sprite -#include "text.hpp" // Para Text -#include "tiled_bg.hpp" // Para TiledBG, TiledBGMode -#include "ui/notifier.hpp" // Para Notifier -#include "ui/service_menu.hpp" // Para ServiceMenu -#include "utils.hpp" // Para Zone, BLOCK +#include "core/audio/audio.hpp" // Para Audio +#include "core/input/global_inputs.hpp" // Para check +#include "core/input/input.hpp" // Para Input +#include "core/input/input_types.hpp" // Para InputAction +#include "core/locale/lang.hpp" // Para getText +#include "core/rendering/fade.hpp" // Para Fade +#include "core/rendering/screen.hpp" // Para Screen +#include "core/rendering/sprite/sprite.hpp" // Para Sprite +#include "core/rendering/text.hpp" // Para Text +#include "core/rendering/tiled_bg.hpp" // Para TiledBG, TiledBGMode +#include "core/resources/resource.hpp" // Para Resource +#include "core/system/global_events.hpp" // Para handle +#include "core/system/section.hpp" // Para Name, name, Options, options, AttractMode, attract_mode +#include "game/entities/player.hpp" // Para Player +#include "game/gameplay/game_logo.hpp" // Para GameLogo +#include "game/options.hpp" // Para Gamepad, GamepadManager, gamepad_manager, Settings, settings, Keyboard, keyboard, getPlayerWhoUsesKeyboard, swapControllers, swapKeyboard +#include "game/ui/notifier.hpp" // Para Notifier +#include "game/ui/service_menu.hpp" // Para ServiceMenu +#include "utils/color.hpp" // Para Color, NO_COLOR_MOD, TITLE_SHADOW_TEXT +#include "utils/param.hpp" // Para Param, param, ParamGame, ParamTitle, ParamFade +#include "utils/utils.hpp" // Para Zone, BLOCK class Texture; diff --git a/source/game/scenes/title.hpp b/source/game/scenes/title.hpp index 03844bb..5855193 100644 --- a/source/game/scenes/title.hpp +++ b/source/game/scenes/title.hpp @@ -6,8 +6,8 @@ #include // Para string_view #include // Para vector -#include "player.hpp" // for Player -#include "section.hpp" // for Options, Name (ptr only) +#include "core/system/section.hpp" // for Options, Name (ptr only) +#include "game/entities/player.hpp" // for Player class Fade; class GameLogo; diff --git a/source/game/ui/menu_option.cpp b/source/game/ui/menu_option.cpp index f282dd5..fd13a6b 100644 --- a/source/game/ui/menu_option.cpp +++ b/source/game/ui/menu_option.cpp @@ -1,10 +1,10 @@ -#include "menu_option.hpp" +#include "game/ui/menu_option.hpp" #include // Para max #include // Para distance #include // Para __find_fn, find -#include "text.hpp" // Para Text +#include "core/rendering/text.hpp" // Para Text auto ActionListOption::getValueAsString() const -> std::string { if (value_getter_) { diff --git a/source/game/ui/menu_option.hpp b/source/game/ui/menu_option.hpp index c78a46c..4a20732 100644 --- a/source/game/ui/menu_option.hpp +++ b/source/game/ui/menu_option.hpp @@ -7,9 +7,9 @@ #include // Para move #include // Para vector -#include "lang.hpp" // Para getText -#include "text.hpp" // Para Text -#include "ui/service_menu.hpp" // Para ServiceMenu +#include "core/locale/lang.hpp" // Para getText +#include "core/rendering/text.hpp" // Para Text +#include "game/ui/service_menu.hpp" // Para ServiceMenu // --- Clase MenuOption: interfaz base para todas las opciones del menú --- class MenuOption { diff --git a/source/game/ui/menu_renderer.cpp b/source/game/ui/menu_renderer.cpp index 67fa0a7..910c482 100644 --- a/source/game/ui/menu_renderer.cpp +++ b/source/game/ui/menu_renderer.cpp @@ -1,14 +1,14 @@ -#include "menu_renderer.hpp" +#include "game/ui/menu_renderer.hpp" #include #include -#include "color.hpp" -#include "menu_option.hpp" -#include "param.hpp" -#include "screen.hpp" -#include "text.hpp" -#include "utils.hpp" +#include "core/rendering/screen.hpp" +#include "core/rendering/text.hpp" +#include "game/ui/menu_option.hpp" +#include "utils/color.hpp" +#include "utils/param.hpp" +#include "utils/utils.hpp" // --- Implementación de las estructuras de animación --- diff --git a/source/game/ui/menu_renderer.hpp b/source/game/ui/menu_renderer.hpp index faa2e8f..a5dbf67 100644 --- a/source/game/ui/menu_renderer.hpp +++ b/source/game/ui/menu_renderer.hpp @@ -8,8 +8,8 @@ #include #include -#include "color.hpp" -#include "ui/service_menu.hpp" +#include "game/ui/service_menu.hpp" +#include "utils/color.hpp" class MenuOption; class Text; diff --git a/source/game/ui/notifier.cpp b/source/game/ui/notifier.cpp index a2a2f65..2fe1f85 100644 --- a/source/game/ui/notifier.cpp +++ b/source/game/ui/notifier.cpp @@ -1,4 +1,4 @@ -#include "notifier.hpp" +#include "game/ui/notifier.hpp" #include // Para SDL_RenderFillRect, SDL_FRect, SDL_RenderClear @@ -7,12 +7,12 @@ #include #include // Para vector -#include "audio.hpp" // Para Audio -#include "param.hpp" // Para Param, param, ParamNotification, ParamGame -#include "screen.hpp" // Para Screen -#include "sprite.hpp" // Para Sprite -#include "text.hpp" // Para Text -#include "texture.hpp" // Para Texture +#include "core/audio/audio.hpp" // Para Audio +#include "core/rendering/screen.hpp" // Para Screen +#include "core/rendering/sprite/sprite.hpp" // Para Sprite +#include "core/rendering/text.hpp" // Para Text +#include "core/rendering/texture.hpp" // Para Texture +#include "utils/param.hpp" // Para Param, param, ParamNotification, ParamGame // Singleton Notifier* Notifier::instance = nullptr; diff --git a/source/game/ui/notifier.hpp b/source/game/ui/notifier.hpp index abbdb9c..489d94f 100644 --- a/source/game/ui/notifier.hpp +++ b/source/game/ui/notifier.hpp @@ -6,8 +6,8 @@ #include // Para basic_string, string #include // Para vector -#include "color.hpp" // Para stringInVector, Color -#include "utils.hpp" +#include "utils/color.hpp" // Para stringInVector, Color +#include "utils/utils.hpp" class Sprite; class Text; diff --git a/source/game/ui/service_menu.cpp b/source/game/ui/service_menu.cpp index 8657eb3..fb8d7cd 100644 --- a/source/game/ui/service_menu.cpp +++ b/source/game/ui/service_menu.cpp @@ -1,23 +1,23 @@ -#include "ui/service_menu.hpp" +#include "game/ui/service_menu.hpp" #include -#include "audio.hpp" // Para Audio -#include "define_buttons.hpp" // Para DefineButtons -#include "difficulty.hpp" // Para getCodeFromName, getNameFromCode -#include "input.hpp" // Para Input -#include "input_types.hpp" // Para InputAction -#include "lang.hpp" // Para getText, getCodeFromName, getNameFromCode -#include "menu_option.hpp" // Para MenuOption, ActionOption, BoolOption, ListOption, FolderOption, IntOption, ActionListOption -#include "menu_renderer.hpp" // Para MenuRenderer -#include "options.hpp" // Para GamepadManager, gamepad_manager, PendingChanges, Video, pending_changes, video, Audio, Gamepad, Settings, audio, checkPendingChanges, settings, Window, getPlayerWhoUsesKeyboard, playerIdToString, stringToPlayerId, window, Keyboard, Music, Sound, keyboard -#include "param.hpp" // Para Param, param, ParamGame, ParamServiceMenu -#include "player.hpp" // Para Player -#include "resource.hpp" // Para Resource -#include "screen.hpp" // Para Screen -#include "section.hpp" // Para Name, name, Options, options -#include "ui/ui_message.hpp" // Para UIMessage -#include "utils.hpp" // Para Zone +#include "core/audio/audio.hpp" // Para Audio +#include "core/input/define_buttons.hpp" // Para DefineButtons +#include "core/input/input.hpp" // Para Input +#include "core/input/input_types.hpp" // Para InputAction +#include "core/locale/lang.hpp" // Para getText, getCodeFromName, getNameFromCode +#include "core/rendering/screen.hpp" // Para Screen +#include "core/resources/resource.hpp" // Para Resource +#include "core/system/section.hpp" // Para Name, name, Options, options +#include "game/entities/player.hpp" // Para Player +#include "game/gameplay/difficulty.hpp" // Para getCodeFromName, getNameFromCode +#include "game/options.hpp" // Para GamepadManager, gamepad_manager, PendingChanges, Video, pending_changes, video, Audio, Gamepad, Settings, audio, checkPendingChanges, settings, Window, getPlayerWhoUsesKeyboard, playerIdToString, stringToPlayerId, window, Keyboard, Music, Sound, keyboard +#include "game/ui/menu_option.hpp" // Para MenuOption, ActionOption, BoolOption, ListOption, FolderOption, IntOption, ActionListOption +#include "game/ui/menu_renderer.hpp" // Para MenuRenderer +#include "game/ui/ui_message.hpp" // Para UIMessage +#include "utils/param.hpp" // Para Param, param, ParamGame, ParamServiceMenu +#include "utils/utils.hpp" // Para Zone // Singleton ServiceMenu* ServiceMenu::instance = nullptr; diff --git a/source/game/ui/service_menu.hpp b/source/game/ui/service_menu.hpp index 0ea7596..3536e06 100644 --- a/source/game/ui/service_menu.hpp +++ b/source/game/ui/service_menu.hpp @@ -11,8 +11,8 @@ #include // Para pair #include // Para vector -#include "define_buttons.hpp" // for DefineButtons -#include "ui_message.hpp" // for UIMessage +#include "core/input/define_buttons.hpp" // for DefineButtons +#include "game/ui/ui_message.hpp" // for UIMessage class MenuOption; class MenuRenderer; diff --git a/source/game/ui/ui_message.cpp b/source/game/ui/ui_message.cpp index d835763..19b1d3b 100644 --- a/source/game/ui/ui_message.cpp +++ b/source/game/ui/ui_message.cpp @@ -1,10 +1,10 @@ -#include "ui_message.hpp" +#include "game/ui/ui_message.hpp" #include #include // Para pow #include -#include "text.hpp" // Para Text::CENTER, Text::COLOR, Text +#include "core/rendering/text.hpp" // Para Text::CENTER, Text::COLOR, Text // Constructor: inicializa el renderizador, el texto y el color del mensaje UIMessage::UIMessage(std::shared_ptr text_renderer, std::string message_text, const Color& color) diff --git a/source/game/ui/ui_message.hpp b/source/game/ui/ui_message.hpp index 5cb2468..fae8f7b 100644 --- a/source/game/ui/ui_message.hpp +++ b/source/game/ui/ui_message.hpp @@ -3,7 +3,7 @@ #include // Para shared_ptr #include // Para string -#include "color.hpp" // Para Color +#include "utils/color.hpp" // Para Color class Text; diff --git a/source/game/ui/window_message.cpp b/source/game/ui/window_message.cpp index feddaf4..65143ef 100644 --- a/source/game/ui/window_message.cpp +++ b/source/game/ui/window_message.cpp @@ -1,11 +1,11 @@ -#include "window_message.hpp" +#include "game/ui/window_message.hpp" #include #include -#include "param.hpp" -#include "screen.hpp" -#include "text.hpp" +#include "core/rendering/screen.hpp" +#include "core/rendering/text.hpp" +#include "utils/param.hpp" WindowMessage::WindowMessage( std::shared_ptr text_renderer, diff --git a/source/game/ui/window_message.hpp b/source/game/ui/window_message.hpp index 879ce58..f37a558 100644 --- a/source/game/ui/window_message.hpp +++ b/source/game/ui/window_message.hpp @@ -8,9 +8,9 @@ #include // Para string #include // Para vector -#include "color.hpp" // Para Color -#include "param.hpp" // Para param -#include "text.hpp" // Para Text +#include "core/rendering/text.hpp" // Para Text +#include "utils/color.hpp" // Para Color +#include "utils/param.hpp" // Para param class WindowMessage { public: diff --git a/source/main.cpp b/source/main.cpp index f9d7fa1..7d5ff49 100644 --- a/source/main.cpp +++ b/source/main.cpp @@ -10,7 +10,7 @@ Actualizando a la versión "Arcade Edition" en 08/05/2024 #define SDL_MAIN_USE_CALLBACKS 1 #include -#include "director.hpp" // Para Director +#include "core/system/director.hpp" // Para Director SDL_AppResult SDL_AppInit(void** appstate, int /*argc*/, char** /*argv*/) { *appstate = new Director(); diff --git a/source/utils/color.cpp b/source/utils/color.cpp index 5d57583..1bcd88c 100644 --- a/source/utils/color.cpp +++ b/source/utils/color.cpp @@ -1,5 +1,5 @@ #define _USE_MATH_DEFINES -#include "color.hpp" +#include "utils/color.hpp" #include // Para isxdigit #include // Para sinf, fmaxf, fminf, M_PI, fmodf, roundf, fmod diff --git a/source/utils/param.cpp b/source/utils/param.cpp index 4694bda..3fe9889 100644 --- a/source/utils/param.cpp +++ b/source/utils/param.cpp @@ -1,4 +1,4 @@ -#include "param.hpp" +#include "utils/param.hpp" #include // Para SDL_LogWarn, SDL_LogCategory, SDL_LogError @@ -11,9 +11,9 @@ #include // Para unordered_map, operator==, _Node_iterator_base #include // Para pair -#include "color.hpp" // Para Color -#include "ui/notifier.hpp" // Para Notifier -#include "utils.hpp" // Para Zone, stringToBool, getFileName +#include "game/ui/notifier.hpp" // Para Notifier +#include "utils/color.hpp" // Para Color +#include "utils/utils.hpp" // Para Zone, stringToBool, getFileName // Variable global - ahora se inicializa automáticamente con valores por defecto Param param; diff --git a/source/utils/param.hpp b/source/utils/param.hpp index d73666b..43e23ed 100644 --- a/source/utils/param.hpp +++ b/source/utils/param.hpp @@ -5,10 +5,10 @@ #include // Para array #include // Para basic_string, string -#include "color.hpp" // Para Color, Zone -#include "defaults.hpp" // Para los valores por defecto -#include "ui/notifier.hpp" // Para Notifier::Position -#include "utils.hpp" +#include "core/system/defaults.hpp" // Para los valores por defecto +#include "game/ui/notifier.hpp" // Para Notifier::Position +#include "utils/color.hpp" // Para Color, Zone +#include "utils/utils.hpp" // --- Parámetros del juego --- struct ParamGame { diff --git a/source/utils/utils.cpp b/source/utils/utils.cpp index d63b574..67f780d 100644 --- a/source/utils/utils.cpp +++ b/source/utils/utils.cpp @@ -1,6 +1,6 @@ // NOLINTNEXTLINE(bugprone-reserved-identifier) -- requerido por para exponer M_PI en MSVC #define _USE_MATH_DEFINES -#include "utils.hpp" +#include "utils/utils.hpp" #include // Para SDL_RenderPoint, SDL_FRect, SDL_FPoint, SDL_Renderer @@ -12,7 +12,7 @@ #include // Para __find_if_not_fn, find_if_not, reverse_view, __find_fn, find, ref_view #include // Para basic_string, string, allocator, char_traits, operator==, operator+ -#include "lang.hpp" // Para getText +#include "core/locale/lang.hpp" // Para getText // Calcula el cuadrado de la distancia entre dos puntos auto distanceSquared(int x1, int y1, int x2, int y2) -> double { diff --git a/tools/pack_resources/Makefile b/tools/pack_resources/Makefile index 70ffca5..f91059b 100644 --- a/tools/pack_resources/Makefile +++ b/tools/pack_resources/Makefile @@ -3,8 +3,8 @@ # Variables CXX := g++ -CXXFLAGS := -std=c++20 -Wall -Os -SOURCES := pack_resources.cpp ../../source/resource_pack.cpp +CXXFLAGS := -std=c++20 -Wall -Os -I../../source +SOURCES := pack_resources.cpp ../../source/core/resources/resource_pack.cpp TARGET := pack_resources CLEAN_FILES := pack_resources *.pack *.o diff --git a/tools/pack_resources/README.md b/tools/pack_resources/README.md index 16f71e3..deb772a 100644 --- a/tools/pack_resources/README.md +++ b/tools/pack_resources/README.md @@ -21,7 +21,7 @@ make ```bash cd tools/ -g++ -std=c++17 -I../ pack_resources.cpp ../source/resource_pack.cpp -o pack_resources +g++ -std=c++17 -I../source pack_resources.cpp ../source/core/resources/resource_pack.cpp -o pack_resources ``` ## 📦 Uso de la herramienta @@ -90,7 +90,7 @@ El juego automáticamente detecta si existe `resources.pack`: 1. **Con pack:** Carga recursos del archivo empaquetado 2. **Sin pack:** Carga recursos desde `data/` (modo desarrollo) -Para habilitar el sistema de packs, descomenta en `source/director.cpp:82`: +Para habilitar el sistema de packs, descomenta en `source/core/system/director.cpp:82`: ```cpp ResourceHelper::initializeResourceSystem("resources.pack"); diff --git a/tools/pack_resources/pack_resources.cpp b/tools/pack_resources/pack_resources.cpp index f830def..d7969db 100644 --- a/tools/pack_resources/pack_resources.cpp +++ b/tools/pack_resources/pack_resources.cpp @@ -1,4 +1,4 @@ -#include "../../source/resource_pack.hpp" +#include "core/resources/resource_pack.hpp" #include "../../build/version.h" // Para Version::APP_NAME #include #include diff --git a/tools/shaders/compile_spirv.sh b/tools/shaders/compile_spirv.sh index d44234b..ffe3cea 100755 --- a/tools/shaders/compile_spirv.sh +++ b/tools/shaders/compile_spirv.sh @@ -7,7 +7,7 @@ set -e SHADERS_DIR="data/shaders" -HEADERS_DIR="source/rendering/sdl3gpu" +HEADERS_DIR="source/core/rendering/sdl3gpu" if ! command -v glslc &> /dev/null; then echo "ERROR: glslc not found. Install Vulkan SDK or run:"