Refactorizar estilo del proyecto: .h → .hpp, #pragma once, includes desde raíz
Modernizar convenciones de código C++ aplicando las siguientes directivas:
## Cambios principales
**1. Renombrar headers (.h → .hpp)**
- 36 archivos renombrados a extensión .hpp (estándar C++)
- Mantenidos como .h: stb_image.h, stb_image_resize2.h (librerías C externas)
**2. Modernizar include guards (#ifndef → #pragma once)**
- resource_manager.hpp: #ifndef RESOURCE_MANAGER_H → #pragma once
- resource_pack.hpp: #ifndef RESOURCE_PACK_H → #pragma once
- spatial_grid.hpp: #ifndef SPATIAL_GRID_H → #pragma once
**3. Sistema de includes desde raíz del proyecto**
- CMakeLists.txt: añadido include_directories(${CMAKE_SOURCE_DIR}/source)
- Eliminadas rutas relativas (../) en todos los includes
- Includes ahora usan rutas absolutas desde source/
**Antes:**
```cpp
#include "../defines.h"
#include "../text/textrenderer.h"
```
**Ahora:**
```cpp
#include "defines.hpp"
#include "text/textrenderer.hpp"
```
## Archivos afectados
- 1 archivo CMakeLists.txt modificado
- 36 archivos renombrados (.h → .hpp)
- 32 archivos .cpp actualizados (includes)
- 36 archivos .hpp actualizados (includes + guards)
- 1 archivo tools/ actualizado
**Total: 70 archivos modificados**
## Verificación
✅ Proyecto compila sin errores
✅ Todas las rutas de includes correctas
✅ Include guards modernizados
✅ Librerías externas C mantienen extensión .h
🤖 Generated with [Claude Code](https://claude.com/claude-code)
Co-Authored-By: Claude <noreply@anthropic.com>
This commit is contained in:
@@ -48,6 +48,9 @@ endif()
|
||||
# Incluir directorios de SDL3 y SDL3_ttf
|
||||
include_directories(${SDL3_INCLUDE_DIRS} ${SDL3_ttf_INCLUDE_DIRS})
|
||||
|
||||
# Incluir directorio source/ para poder usar includes desde la raíz del proyecto
|
||||
include_directories(${CMAKE_SOURCE_DIR}/source)
|
||||
|
||||
# Añadir el ejecutable reutilizando el nombre del proyecto
|
||||
add_executable(${PROJECT_NAME} ${SOURCE_FILES})
|
||||
|
||||
|
||||
@@ -1,12 +1,12 @@
|
||||
#include "app_logo.h"
|
||||
#include "app_logo.hpp"
|
||||
|
||||
#include <SDL3/SDL_render.h> // for SDL_DestroyTexture, SDL_RenderGeometry, SDL_SetTextureAlphaMod
|
||||
#include <cmath> // for powf, sinf, cosf
|
||||
#include <cstdlib> // for free()
|
||||
#include <iostream> // for std::cout
|
||||
|
||||
#include "logo_scaler.h" // for LogoScaler
|
||||
#include "defines.h" // for APPLOGO_HEIGHT_PERCENT, getResourcesDirectory
|
||||
#include "logo_scaler.hpp" // for LogoScaler
|
||||
#include "defines.hpp" // for APPLOGO_HEIGHT_PERCENT, getResourcesDirectory
|
||||
|
||||
// ============================================================================
|
||||
// Destructor - Liberar las 4 texturas SDL
|
||||
|
||||
@@ -4,7 +4,7 @@
|
||||
|
||||
#include <memory> // for unique_ptr, shared_ptr
|
||||
|
||||
#include "defines.h" // for AppMode
|
||||
#include "defines.hpp" // for AppMode
|
||||
|
||||
class Texture;
|
||||
class Sprite;
|
||||
@@ -1,10 +1,10 @@
|
||||
#include "ball.h"
|
||||
#include "ball.hpp"
|
||||
|
||||
#include <stdlib.h> // for rand
|
||||
|
||||
#include <cmath> // for fabs
|
||||
|
||||
#include "defines.h" // for Color, SCREEN_HEIGHT, GRAVITY_FORCE
|
||||
#include "defines.hpp" // for Color, SCREEN_HEIGHT, GRAVITY_FORCE
|
||||
class Texture;
|
||||
|
||||
// Función auxiliar para generar pérdida aleatoria en rebotes
|
||||
|
||||
@@ -4,8 +4,8 @@
|
||||
|
||||
#include <memory> // for shared_ptr, unique_ptr
|
||||
|
||||
#include "defines.h" // for Color
|
||||
#include "external/sprite.h" // for Sprite
|
||||
#include "defines.hpp" // for Color
|
||||
#include "external/sprite.hpp" // for Sprite
|
||||
class Texture;
|
||||
|
||||
class Ball {
|
||||
@@ -1,13 +1,13 @@
|
||||
#include "boid_manager.h"
|
||||
#include "boid_manager.hpp"
|
||||
|
||||
#include <algorithm> // for std::min, std::max
|
||||
#include <cmath> // for sqrt, atan2
|
||||
|
||||
#include "../ball.h" // for Ball
|
||||
#include "../engine.h" // for Engine (si se necesita)
|
||||
#include "../scene/scene_manager.h" // for SceneManager
|
||||
#include "../state/state_manager.h" // for StateManager
|
||||
#include "../ui/ui_manager.h" // for UIManager
|
||||
#include "ball.hpp" // for Ball
|
||||
#include "engine.hpp" // for Engine (si se necesita)
|
||||
#include "scene/scene_manager.hpp" // for SceneManager
|
||||
#include "state/state_manager.hpp" // for StateManager
|
||||
#include "ui/ui_manager.hpp" // for UIManager
|
||||
|
||||
BoidManager::BoidManager()
|
||||
: engine_(nullptr)
|
||||
|
||||
@@ -2,8 +2,8 @@
|
||||
|
||||
#include <cstddef> // for size_t
|
||||
|
||||
#include "../defines.h" // for SimulationMode, AppMode
|
||||
#include "../spatial_grid.h" // for SpatialGrid
|
||||
#include "defines.hpp" // for SimulationMode, AppMode
|
||||
#include "spatial_grid.hpp" // for SpatialGrid
|
||||
|
||||
// Forward declarations
|
||||
class Engine;
|
||||
@@ -1,4 +1,4 @@
|
||||
#include "engine.h"
|
||||
#include "engine.hpp"
|
||||
|
||||
#include <SDL3/SDL_error.h> // for SDL_GetError
|
||||
#include <SDL3/SDL_events.h> // for SDL_Event, SDL_PollEvent
|
||||
@@ -17,24 +17,24 @@
|
||||
#include <iostream> // for cout
|
||||
#include <string> // for string
|
||||
|
||||
#include "resource_manager.h" // for ResourceManager
|
||||
#include "resource_manager.hpp" // for ResourceManager
|
||||
|
||||
#ifdef _WIN32
|
||||
#include <windows.h> // for GetModuleFileName
|
||||
#endif
|
||||
|
||||
#include "ball.h" // for Ball
|
||||
#include "external/mouse.h" // for Mouse namespace
|
||||
#include "external/texture.h" // for Texture
|
||||
#include "shapes/atom_shape.h" // for AtomShape
|
||||
#include "shapes/cube_shape.h" // for CubeShape
|
||||
#include "shapes/cylinder_shape.h" // for CylinderShape
|
||||
#include "shapes/helix_shape.h" // for HelixShape
|
||||
#include "shapes/icosahedron_shape.h" // for IcosahedronShape
|
||||
#include "shapes/lissajous_shape.h" // for LissajousShape
|
||||
#include "shapes/png_shape.h" // for PNGShape
|
||||
#include "shapes/sphere_shape.h" // for SphereShape
|
||||
#include "shapes/torus_shape.h" // for TorusShape
|
||||
#include "ball.hpp" // for Ball
|
||||
#include "external/mouse.hpp" // for Mouse namespace
|
||||
#include "external/texture.hpp" // for Texture
|
||||
#include "shapes/atom_shape.hpp" // for AtomShape
|
||||
#include "shapes/cube_shape.hpp" // for CubeShape
|
||||
#include "shapes/cylinder_shape.hpp" // for CylinderShape
|
||||
#include "shapes/helix_shape.hpp" // for HelixShape
|
||||
#include "shapes/icosahedron_shape.hpp" // for IcosahedronShape
|
||||
#include "shapes/lissajous_shape.hpp" // for LissajousShape
|
||||
#include "shapes/png_shape.hpp" // for PNGShape
|
||||
#include "shapes/sphere_shape.hpp" // for SphereShape
|
||||
#include "shapes/torus_shape.hpp" // for TorusShape
|
||||
|
||||
// getExecutableDirectory() ya está definido en defines.h como inline
|
||||
|
||||
|
||||
@@ -10,18 +10,18 @@
|
||||
#include <string> // for string
|
||||
#include <vector> // for vector
|
||||
|
||||
#include "app_logo.h" // for AppLogo
|
||||
#include "ball.h" // for Ball
|
||||
#include "boids_mgr/boid_manager.h" // for BoidManager
|
||||
#include "defines.h" // for GravityDirection, ColorTheme, ShapeType
|
||||
#include "external/texture.h" // for Texture
|
||||
#include "input/input_handler.h" // for InputHandler
|
||||
#include "scene/scene_manager.h" // for SceneManager
|
||||
#include "shapes/shape.h" // for Shape (interfaz polimórfica)
|
||||
#include "shapes_mgr/shape_manager.h" // for ShapeManager
|
||||
#include "state/state_manager.h" // for StateManager
|
||||
#include "theme_manager.h" // for ThemeManager
|
||||
#include "ui/ui_manager.h" // for UIManager
|
||||
#include "app_logo.hpp" // for AppLogo
|
||||
#include "ball.hpp" // for Ball
|
||||
#include "boids_mgr/boid_manager.hpp" // for BoidManager
|
||||
#include "defines.hpp" // for GravityDirection, ColorTheme, ShapeType
|
||||
#include "external/texture.hpp" // for Texture
|
||||
#include "input/input_handler.hpp" // for InputHandler
|
||||
#include "scene/scene_manager.hpp" // for SceneManager
|
||||
#include "shapes/shape.hpp" // for Shape (interfaz polimórfica)
|
||||
#include "shapes_mgr/shape_manager.hpp" // for ShapeManager
|
||||
#include "state/state_manager.hpp" // for StateManager
|
||||
#include "theme_manager.hpp" // for ThemeManager
|
||||
#include "ui/ui_manager.hpp" // for UIManager
|
||||
|
||||
class Engine {
|
||||
public:
|
||||
2
source/external/mouse.cpp
vendored
2
source/external/mouse.cpp
vendored
@@ -1,4 +1,4 @@
|
||||
#include "mouse.h"
|
||||
#include "mouse.hpp"
|
||||
|
||||
#include <SDL3/SDL.h> // Para SDL_GetTicks, Uint32, SDL_HideCursor, SDL_ShowCursor
|
||||
|
||||
|
||||
4
source/external/sprite.cpp
vendored
4
source/external/sprite.cpp
vendored
@@ -1,6 +1,6 @@
|
||||
#include "sprite.h"
|
||||
#include "sprite.hpp"
|
||||
|
||||
#include "texture.h" // for Texture
|
||||
#include "texture.hpp" // for Texture
|
||||
|
||||
// Constructor
|
||||
Sprite::Sprite(std::shared_ptr<Texture> texture)
|
||||
|
||||
4
source/external/texture.cpp
vendored
4
source/external/texture.cpp
vendored
@@ -1,5 +1,5 @@
|
||||
#define STB_IMAGE_IMPLEMENTATION
|
||||
#include "texture.h"
|
||||
#include "texture.hpp"
|
||||
|
||||
#include <SDL3/SDL_error.h> // Para SDL_GetError
|
||||
#include <SDL3/SDL_log.h> // Para SDL_Log
|
||||
@@ -12,7 +12,7 @@
|
||||
#include <string> // Para operator<<, string
|
||||
|
||||
#include "stb_image.h" // Para stbi_failure_reason, stbi_image_free
|
||||
#include "../resource_manager.h" // Sistema de empaquetado de recursos centralizado
|
||||
#include "resource_manager.hpp" // Sistema de empaquetado de recursos centralizado
|
||||
|
||||
Texture::Texture(SDL_Renderer *renderer)
|
||||
: renderer_(renderer),
|
||||
|
||||
@@ -1,10 +1,10 @@
|
||||
#include "input_handler.h"
|
||||
#include "input_handler.hpp"
|
||||
|
||||
#include <SDL3/SDL_keycode.h> // for SDL_Keycode
|
||||
#include <string> // for std::string, std::to_string
|
||||
|
||||
#include "../engine.h" // for Engine
|
||||
#include "../external/mouse.h" // for Mouse namespace
|
||||
#include "engine.hpp" // for Engine
|
||||
#include "external/mouse.hpp" // for Mouse namespace
|
||||
|
||||
bool InputHandler::processEvents(Engine& engine) {
|
||||
SDL_Event event;
|
||||
|
||||
@@ -1,5 +1,5 @@
|
||||
#define STB_IMAGE_RESIZE_IMPLEMENTATION
|
||||
#include "logo_scaler.h"
|
||||
#include "logo_scaler.hpp"
|
||||
|
||||
#include <SDL3/SDL_error.h> // Para SDL_GetError
|
||||
#include <SDL3/SDL_log.h> // Para SDL_Log
|
||||
@@ -13,7 +13,7 @@
|
||||
|
||||
#include "external/stb_image.h" // Para stbi_load, stbi_image_free
|
||||
#include "external/stb_image_resize2.h" // Para stbir_resize_uint8_srgb
|
||||
#include "resource_manager.h" // Para cargar desde pack
|
||||
#include "resource_manager.hpp" // Para cargar desde pack
|
||||
|
||||
// ============================================================================
|
||||
// Detectar resolución nativa del monitor principal
|
||||
|
||||
@@ -1,9 +1,9 @@
|
||||
#include <iostream>
|
||||
#include <cstring>
|
||||
#include <string>
|
||||
#include "engine.h"
|
||||
#include "defines.h"
|
||||
#include "resource_manager.h"
|
||||
#include "engine.hpp"
|
||||
#include "defines.hpp"
|
||||
#include "resource_manager.hpp"
|
||||
|
||||
// getExecutableDirectory() ya está definido en defines.h como inline
|
||||
|
||||
|
||||
@@ -1,5 +1,5 @@
|
||||
#include "resource_manager.h"
|
||||
#include "resource_pack.h"
|
||||
#include "resource_manager.hpp"
|
||||
#include "resource_pack.hpp"
|
||||
|
||||
#include <iostream>
|
||||
#include <fstream>
|
||||
|
||||
@@ -1,5 +1,4 @@
|
||||
#ifndef RESOURCE_MANAGER_H
|
||||
#define RESOURCE_MANAGER_H
|
||||
#pragma once
|
||||
|
||||
#include <string>
|
||||
#include <vector>
|
||||
@@ -81,5 +80,3 @@ private:
|
||||
// Instancia del pack (nullptr si no está cargado)
|
||||
static ResourcePack* resourcePack_;
|
||||
};
|
||||
|
||||
#endif // RESOURCE_MANAGER_H
|
||||
@@ -1,4 +1,4 @@
|
||||
#include "resource_pack.h"
|
||||
#include "resource_pack.hpp"
|
||||
|
||||
#include <algorithm>
|
||||
#include <cstring>
|
||||
|
||||
@@ -1,5 +1,4 @@
|
||||
#ifndef RESOURCE_PACK_H
|
||||
#define RESOURCE_PACK_H
|
||||
#pragma once
|
||||
|
||||
#include <cstdint>
|
||||
#include <fstream>
|
||||
@@ -64,5 +63,3 @@ private:
|
||||
uint32_t calculateChecksum(const unsigned char* data, size_t size);
|
||||
std::string normalizePath(const std::string& path);
|
||||
};
|
||||
|
||||
#endif // RESOURCE_PACK_H
|
||||
@@ -1,10 +1,10 @@
|
||||
#include "scene_manager.h"
|
||||
#include "scene_manager.hpp"
|
||||
|
||||
#include <cstdlib> // for rand
|
||||
|
||||
#include "../defines.h" // for BALL_COUNT_SCENARIOS, GRAVITY_MASS_MIN, etc
|
||||
#include "../external/texture.h" // for Texture
|
||||
#include "../theme_manager.h" // for ThemeManager
|
||||
#include "defines.hpp" // for BALL_COUNT_SCENARIOS, GRAVITY_MASS_MIN, etc
|
||||
#include "external/texture.hpp" // for Texture
|
||||
#include "theme_manager.hpp" // for ThemeManager
|
||||
|
||||
SceneManager::SceneManager(int screen_width, int screen_height)
|
||||
: current_gravity_(GravityDirection::DOWN)
|
||||
|
||||
@@ -3,8 +3,8 @@
|
||||
#include <memory> // for unique_ptr, shared_ptr
|
||||
#include <vector> // for vector
|
||||
|
||||
#include "../ball.h" // for Ball
|
||||
#include "../defines.h" // for GravityDirection
|
||||
#include "ball.hpp" // for Ball
|
||||
#include "defines.hpp" // for GravityDirection
|
||||
|
||||
// Forward declarations
|
||||
class Texture;
|
||||
@@ -1,5 +1,5 @@
|
||||
#include "atom_shape.h"
|
||||
#include "../defines.h"
|
||||
#include "atom_shape.hpp"
|
||||
#include "defines.hpp"
|
||||
#include <cmath>
|
||||
|
||||
void AtomShape::generatePoints(int num_points, float screen_width, float screen_height) {
|
||||
|
||||
@@ -1,6 +1,6 @@
|
||||
#pragma once
|
||||
|
||||
#include "shape.h"
|
||||
#include "shape.hpp"
|
||||
|
||||
// Figura: Átomo con núcleo central y órbitas electrónicas
|
||||
// Comportamiento: Núcleo estático + electrones orbitando en planos inclinados
|
||||
@@ -1,5 +1,5 @@
|
||||
#include "cube_shape.h"
|
||||
#include "../defines.h"
|
||||
#include "cube_shape.hpp"
|
||||
#include "defines.hpp"
|
||||
#include <cmath>
|
||||
|
||||
void CubeShape::generatePoints(int num_points, float screen_width, float screen_height) {
|
||||
|
||||
@@ -1,6 +1,6 @@
|
||||
#pragma once
|
||||
|
||||
#include "shape.h"
|
||||
#include "shape.hpp"
|
||||
#include <vector>
|
||||
|
||||
// Figura: Cubo 3D rotante
|
||||
@@ -1,5 +1,5 @@
|
||||
#include "cylinder_shape.h"
|
||||
#include "../defines.h"
|
||||
#include "cylinder_shape.hpp"
|
||||
#include "defines.hpp"
|
||||
#include <cmath>
|
||||
#include <cstdlib> // Para rand()
|
||||
|
||||
|
||||
@@ -1,6 +1,6 @@
|
||||
#pragma once
|
||||
|
||||
#include "shape.h"
|
||||
#include "shape.hpp"
|
||||
|
||||
// Figura: Cilindro 3D rotante
|
||||
// Comportamiento: Superficie cilíndrica con rotación en eje Y + tumbling ocasional en X/Z
|
||||
@@ -1,5 +1,5 @@
|
||||
#include "helix_shape.h"
|
||||
#include "../defines.h"
|
||||
#include "helix_shape.hpp"
|
||||
#include "defines.hpp"
|
||||
#include <cmath>
|
||||
|
||||
void HelixShape::generatePoints(int num_points, float screen_width, float screen_height) {
|
||||
|
||||
@@ -1,6 +1,6 @@
|
||||
#pragma once
|
||||
|
||||
#include "shape.h"
|
||||
#include "shape.hpp"
|
||||
|
||||
// Figura: Espiral helicoidal 3D con distribución uniforme
|
||||
// Comportamiento: Rotación en eje Y + animación de fase vertical
|
||||
@@ -1,5 +1,5 @@
|
||||
#include "icosahedron_shape.h"
|
||||
#include "../defines.h"
|
||||
#include "icosahedron_shape.hpp"
|
||||
#include "defines.hpp"
|
||||
#include <cmath>
|
||||
#include <vector>
|
||||
|
||||
|
||||
@@ -1,6 +1,6 @@
|
||||
#pragma once
|
||||
|
||||
#include "shape.h"
|
||||
#include "shape.hpp"
|
||||
|
||||
// Figura: Icosaedro 3D (D20, poliedro regular de 20 caras)
|
||||
// Comportamiento: 12 vértices distribuidos uniformemente con rotación triple
|
||||
@@ -1,5 +1,5 @@
|
||||
#include "lissajous_shape.h"
|
||||
#include "../defines.h"
|
||||
#include "lissajous_shape.hpp"
|
||||
#include "defines.hpp"
|
||||
#include <cmath>
|
||||
|
||||
void LissajousShape::generatePoints(int num_points, float screen_width, float screen_height) {
|
||||
|
||||
@@ -1,6 +1,6 @@
|
||||
#pragma once
|
||||
|
||||
#include "shape.h"
|
||||
#include "shape.hpp"
|
||||
|
||||
// Figura: Curva de Lissajous 3D
|
||||
// Comportamiento: Curva paramétrica 3D con rotación global y animación de fase
|
||||
@@ -1,6 +1,6 @@
|
||||
#include "png_shape.h"
|
||||
#include "../defines.h"
|
||||
#include "../external/stb_image.h"
|
||||
#include "png_shape.hpp"
|
||||
#include "defines.hpp"
|
||||
#include "external/stb_image.h"
|
||||
#include <cmath>
|
||||
#include <algorithm>
|
||||
#include <iostream>
|
||||
|
||||
@@ -1,7 +1,7 @@
|
||||
#pragma once
|
||||
|
||||
#include "shape.h"
|
||||
#include "../defines.h" // Para PNG_IDLE_TIME_MIN/MAX constantes
|
||||
#include "shape.hpp"
|
||||
#include "defines.hpp" // Para PNG_IDLE_TIME_MIN/MAX constantes
|
||||
#include <vector>
|
||||
#include <cstdlib> // Para rand()
|
||||
|
||||
@@ -1,5 +1,5 @@
|
||||
#include "sphere_shape.h"
|
||||
#include "../defines.h"
|
||||
#include "sphere_shape.hpp"
|
||||
#include "defines.hpp"
|
||||
#include <cmath>
|
||||
|
||||
void SphereShape::generatePoints(int num_points, float screen_width, float screen_height) {
|
||||
|
||||
@@ -1,6 +1,6 @@
|
||||
#pragma once
|
||||
|
||||
#include "shape.h"
|
||||
#include "shape.hpp"
|
||||
|
||||
// Figura: Esfera 3D con distribución uniforme (Fibonacci Sphere Algorithm)
|
||||
// Comportamiento: Rotación dual en ejes X e Y
|
||||
@@ -1,5 +1,5 @@
|
||||
#include "torus_shape.h"
|
||||
#include "../defines.h"
|
||||
#include "torus_shape.hpp"
|
||||
#include "defines.hpp"
|
||||
#include <cmath>
|
||||
|
||||
void TorusShape::generatePoints(int num_points, float screen_width, float screen_height) {
|
||||
|
||||
@@ -1,6 +1,6 @@
|
||||
#pragma once
|
||||
|
||||
#include "shape.h"
|
||||
#include "shape.hpp"
|
||||
|
||||
// Figura: Torus/Toroide 3D (donut/rosquilla)
|
||||
// Comportamiento: Superficie toroidal con rotación triple (X, Y, Z)
|
||||
@@ -1,25 +1,25 @@
|
||||
#include "shape_manager.h"
|
||||
#include "shape_manager.hpp"
|
||||
|
||||
#include <algorithm> // for std::min, std::max
|
||||
#include <cstdlib> // for rand
|
||||
#include <string> // for std::string
|
||||
|
||||
#include "../ball.h" // for Ball
|
||||
#include "../defines.h" // for constantes
|
||||
#include "../scene/scene_manager.h" // for SceneManager
|
||||
#include "../state/state_manager.h" // for StateManager
|
||||
#include "../ui/ui_manager.h" // for UIManager
|
||||
#include "ball.hpp" // for Ball
|
||||
#include "defines.hpp" // for constantes
|
||||
#include "scene/scene_manager.hpp" // for SceneManager
|
||||
#include "state/state_manager.hpp" // for StateManager
|
||||
#include "ui/ui_manager.hpp" // for UIManager
|
||||
|
||||
// Includes de todas las shapes (necesario para creación polimórfica)
|
||||
#include "../shapes/atom_shape.h"
|
||||
#include "../shapes/cube_shape.h"
|
||||
#include "../shapes/cylinder_shape.h"
|
||||
#include "../shapes/helix_shape.h"
|
||||
#include "../shapes/icosahedron_shape.h"
|
||||
#include "../shapes/lissajous_shape.h"
|
||||
#include "../shapes/png_shape.h"
|
||||
#include "../shapes/sphere_shape.h"
|
||||
#include "../shapes/torus_shape.h"
|
||||
#include "shapes/atom_shape.hpp"
|
||||
#include "shapes/cube_shape.hpp"
|
||||
#include "shapes/cylinder_shape.hpp"
|
||||
#include "shapes/helix_shape.hpp"
|
||||
#include "shapes/icosahedron_shape.hpp"
|
||||
#include "shapes/lissajous_shape.hpp"
|
||||
#include "shapes/png_shape.hpp"
|
||||
#include "shapes/sphere_shape.hpp"
|
||||
#include "shapes/torus_shape.hpp"
|
||||
|
||||
ShapeManager::ShapeManager()
|
||||
: engine_(nullptr)
|
||||
|
||||
@@ -2,8 +2,8 @@
|
||||
|
||||
#include <memory> // for unique_ptr
|
||||
|
||||
#include "../defines.h" // for SimulationMode, ShapeType
|
||||
#include "../shapes/shape.h" // for Shape base class
|
||||
#include "defines.hpp" // for SimulationMode, ShapeType
|
||||
#include "shapes/shape.hpp" // for Shape base class
|
||||
|
||||
// Forward declarations
|
||||
class Engine;
|
||||
@@ -1,9 +1,9 @@
|
||||
#include "spatial_grid.h"
|
||||
#include "spatial_grid.hpp"
|
||||
|
||||
#include <algorithm> // for std::max, std::min
|
||||
#include <cmath> // for std::floor, std::ceil
|
||||
|
||||
#include "ball.h" // for Ball
|
||||
#include "ball.hpp" // for Ball
|
||||
|
||||
SpatialGrid::SpatialGrid(int world_width, int world_height, float cell_size)
|
||||
: world_width_(world_width)
|
||||
|
||||
@@ -1,5 +1,4 @@
|
||||
#ifndef SPATIAL_GRID_H
|
||||
#define SPATIAL_GRID_H
|
||||
#pragma once
|
||||
|
||||
#include <unordered_map>
|
||||
#include <vector>
|
||||
@@ -70,5 +69,3 @@ private:
|
||||
// Usamos unordered_map para O(1) lookup
|
||||
std::unordered_map<int, std::vector<Ball*>> cells_;
|
||||
};
|
||||
|
||||
#endif // SPATIAL_GRID_H
|
||||
@@ -1,10 +1,10 @@
|
||||
#include "state_manager.h"
|
||||
#include "state_manager.hpp"
|
||||
|
||||
#include <cstdlib> // for rand
|
||||
|
||||
#include "../defines.h" // for constantes DEMO/LOGO
|
||||
#include "../engine.h" // for Engine (callbacks)
|
||||
#include "../shapes/png_shape.h" // for PNGShape flip detection
|
||||
#include "defines.hpp" // for constantes DEMO/LOGO
|
||||
#include "engine.hpp" // for Engine (callbacks)
|
||||
#include "shapes/png_shape.hpp" // for PNGShape flip detection
|
||||
|
||||
StateManager::StateManager()
|
||||
: engine_(nullptr)
|
||||
|
||||
@@ -3,7 +3,7 @@
|
||||
#include <SDL3/SDL_stdinc.h> // for Uint64
|
||||
#include <cstddef> // for size_t
|
||||
|
||||
#include "../defines.h" // for AppMode, ShapeType, GravityDirection
|
||||
#include "defines.hpp" // for AppMode, ShapeType, GravityDirection
|
||||
|
||||
// Forward declarations
|
||||
class Engine;
|
||||
@@ -1,7 +1,7 @@
|
||||
#include "textrenderer.h"
|
||||
#include "textrenderer.hpp"
|
||||
#include <SDL3/SDL.h>
|
||||
#include <SDL3_ttf/SDL_ttf.h>
|
||||
#include "../resource_manager.h"
|
||||
#include "resource_manager.hpp"
|
||||
|
||||
TextRenderer::TextRenderer() : renderer_(nullptr), font_(nullptr), font_size_(0), use_antialiasing_(true), font_data_buffer_(nullptr) {
|
||||
}
|
||||
|
||||
@@ -1,7 +1,7 @@
|
||||
#include "theme_manager.h"
|
||||
#include "theme_manager.hpp"
|
||||
|
||||
#include "themes/static_theme.h"
|
||||
#include "themes/dynamic_theme.h"
|
||||
#include "themes/static_theme.hpp"
|
||||
#include "themes/dynamic_theme.hpp"
|
||||
|
||||
// ============================================================================
|
||||
// INICIALIZACIÓN
|
||||
|
||||
@@ -3,10 +3,10 @@
|
||||
#include <memory> // for unique_ptr
|
||||
#include <vector> // for vector
|
||||
|
||||
#include "ball.h" // for Ball class
|
||||
#include "defines.h" // for Color, ColorTheme
|
||||
#include "themes/theme.h" // for Theme interface
|
||||
#include "themes/theme_snapshot.h" // for ThemeSnapshot
|
||||
#include "ball.hpp" // for Ball class
|
||||
#include "defines.hpp" // for Color, ColorTheme
|
||||
#include "themes/theme.hpp" // for Theme interface
|
||||
#include "themes/theme_snapshot.hpp" // for ThemeSnapshot
|
||||
|
||||
/**
|
||||
* ThemeManager: Gestiona el sistema de temas visuales (unificado, estáticos y dinámicos)
|
||||
@@ -1,4 +1,4 @@
|
||||
#include "dynamic_theme.h"
|
||||
#include "dynamic_theme.hpp"
|
||||
#include <algorithm> // for std::min
|
||||
|
||||
DynamicTheme::DynamicTheme(const char* name_en, const char* name_es,
|
||||
|
||||
@@ -1,6 +1,6 @@
|
||||
#pragma once
|
||||
|
||||
#include "theme.h"
|
||||
#include "theme.hpp"
|
||||
#include <string>
|
||||
|
||||
// Forward declaration (estructura definida en defines.h)
|
||||
@@ -1,4 +1,4 @@
|
||||
#include "static_theme.h"
|
||||
#include "static_theme.hpp"
|
||||
|
||||
StaticTheme::StaticTheme(const char* name_en, const char* name_es,
|
||||
int text_r, int text_g, int text_b,
|
||||
|
||||
@@ -1,6 +1,6 @@
|
||||
#pragma once
|
||||
|
||||
#include "theme.h"
|
||||
#include "theme.hpp"
|
||||
#include <string>
|
||||
|
||||
/**
|
||||
@@ -1,7 +1,7 @@
|
||||
#pragma once
|
||||
|
||||
#include <vector>
|
||||
#include "../defines.h" // for Color, ThemeKeyframe
|
||||
#include "defines.hpp" // for Color, ThemeKeyframe
|
||||
|
||||
/**
|
||||
* Theme: Interfaz polimórfica para todos los temas (estáticos y dinámicos)
|
||||
@@ -2,7 +2,7 @@
|
||||
|
||||
#include <string>
|
||||
#include <vector>
|
||||
#include "../defines.h" // for Color
|
||||
#include "defines.hpp" // for Color
|
||||
|
||||
/**
|
||||
* ThemeSnapshot: "Fotografía" del estado de un tema en un momento dado
|
||||
@@ -1,9 +1,9 @@
|
||||
#include "help_overlay.h"
|
||||
#include "help_overlay.hpp"
|
||||
|
||||
#include <algorithm> // for std::min
|
||||
|
||||
#include "../text/textrenderer.h"
|
||||
#include "../theme_manager.h"
|
||||
#include "text/textrenderer.hpp"
|
||||
#include "theme_manager.hpp"
|
||||
|
||||
HelpOverlay::HelpOverlay()
|
||||
: renderer_(nullptr),
|
||||
@@ -28,7 +28,7 @@ HelpOverlay::HelpOverlay()
|
||||
// COLUMNA 1: SIMULACIÓN
|
||||
{"SIMULACIÓN", ""},
|
||||
{"1-8", "Escenarios (10 a 50,000 pelotas)"},
|
||||
{"F", "Toggle Física ↔ Última Figura"},
|
||||
{"F", "Toggle Física - Última Figura"},
|
||||
{"B", "Modo Boids (enjambre)"},
|
||||
{"ESPACIO", "Impulso contra gravedad"},
|
||||
{"G", "Toggle Gravedad ON/OFF"},
|
||||
|
||||
@@ -1,8 +1,8 @@
|
||||
#include "notifier.h"
|
||||
#include "../text/textrenderer.h"
|
||||
#include "../theme_manager.h"
|
||||
#include "../defines.h"
|
||||
#include "../utils/easing_functions.h"
|
||||
#include "notifier.hpp"
|
||||
#include "text/textrenderer.hpp"
|
||||
#include "theme_manager.hpp"
|
||||
#include "defines.hpp"
|
||||
#include "utils/easing_functions.hpp"
|
||||
#include <SDL3/SDL.h>
|
||||
|
||||
// ============================================================================
|
||||
|
||||
@@ -1,17 +1,17 @@
|
||||
#include "ui_manager.h"
|
||||
#include "ui_manager.hpp"
|
||||
|
||||
#include <SDL3/SDL.h>
|
||||
#include <string>
|
||||
|
||||
#include "../ball.h" // for Ball
|
||||
#include "../defines.h" // for TEXT_DURATION, NOTIFICATION_DURATION, AppMode, SimulationMode
|
||||
#include "../engine.h" // for Engine (info de sistema)
|
||||
#include "../scene/scene_manager.h" // for SceneManager
|
||||
#include "../shapes/shape.h" // for Shape
|
||||
#include "../text/textrenderer.h" // for TextRenderer
|
||||
#include "../theme_manager.h" // for ThemeManager
|
||||
#include "notifier.h" // for Notifier
|
||||
#include "help_overlay.h" // for HelpOverlay
|
||||
#include "ball.hpp" // for Ball
|
||||
#include "defines.hpp" // for TEXT_DURATION, NOTIFICATION_DURATION, AppMode, SimulationMode
|
||||
#include "engine.hpp" // for Engine (info de sistema)
|
||||
#include "scene/scene_manager.hpp" // for SceneManager
|
||||
#include "shapes/shape.hpp" // for Shape
|
||||
#include "text/textrenderer.hpp" // for TextRenderer
|
||||
#include "theme_manager.hpp" // for ThemeManager
|
||||
#include "notifier.hpp" // for Notifier
|
||||
#include "help_overlay.hpp" // for HelpOverlay
|
||||
|
||||
// ============================================================================
|
||||
// HELPER: Obtener viewport en coordenadas físicas (no lógicas)
|
||||
|
||||
@@ -1,4 +1,4 @@
|
||||
#include "../source/resource_pack.h"
|
||||
#include "../source/resource_pack.hpp"
|
||||
#include <iostream>
|
||||
#include <filesystem>
|
||||
|
||||
|
||||
Reference in New Issue
Block a user