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:
@@ -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)
|
||||
|
||||
Reference in New Issue
Block a user