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,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;
|
||||
Reference in New Issue
Block a user