style: aplicar fixes de clang-tidy (todo excepto uppercase-literal-suffix)

Corregidos ~2570 issues automáticamente con clang-tidy --fix-errors
más ajustes manuales posteriores:

- modernize: designated-initializers, trailing-return-type, use-auto,
  avoid-c-arrays (→ std::array<>), use-ranges, use-emplace,
  deprecated-headers, use-equals-default, pass-by-value,
  return-braced-init-list, use-default-member-init
- readability: math-missing-parentheses, implicit-bool-conversion,
  braces-around-statements, isolate-declaration, use-std-min-max,
  identifier-naming, else-after-return, redundant-casting,
  convert-member-functions-to-static, make-member-function-const,
  static-accessed-through-instance
- performance: avoid-endl, unnecessary-value-param, type-promotion,
  inefficient-vector-operation
- dead code: XOR_KEY (orphan tras eliminar encryptData/decryptData),
  dead stores en engine.cpp y png_shape.cpp
- NOLINT justificado en 10 funciones con alta complejidad cognitiva
  (initialize, render, main, processEvents, update×3, performDemoAction,
  randomizeOnDemoStart, renderDebugHUD, AppLogo::update)

Compilación: gcc -Wall sin warnings. clang-tidy: 0 issues.

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
This commit is contained in:
2026-03-21 10:52:07 +01:00
parent 4801f287df
commit c9bcce6f9b
71 changed files with 3469 additions and 2838 deletions

View File

@@ -30,42 +30,42 @@ class Ball; // Forward declaration
// ============================================================================
class SpatialGrid {
public:
// Constructor: especificar dimensiones del mundo y tamaño de celda
SpatialGrid(int world_width, int world_height, float cell_size);
public:
// Constructor: especificar dimensiones del mundo y tamaño de celda
SpatialGrid(int world_width, int world_height, float cell_size);
// Limpiar todas las celdas (llamar al inicio de cada frame)
void clear();
// Limpiar todas las celdas (llamar al inicio de cada frame)
void clear();
// Insertar objeto en el grid según su posición (x, y)
void insert(Ball* ball, float x, float y);
// Insertar objeto en el grid según su posición (x, y)
void insert(Ball* ball, float x, float y);
// Buscar todos los objetos dentro del radio especificado desde (x, y)
// Devuelve vector de punteros a Ball (puede contener duplicados si ball está en múltiples celdas)
std::vector<Ball*> queryRadius(float x, float y, float radius);
// Buscar todos los objetos dentro del radio especificado desde (x, y)
// Devuelve vector de punteros a Ball (puede contener duplicados si ball está en múltiples celdas)
std::vector<Ball*> queryRadius(float x, float y, float radius);
// Actualizar dimensiones del mundo (útil para cambios de resolución F4)
void updateWorldSize(int world_width, int world_height);
// Actualizar dimensiones del mundo (útil para cambios de resolución F4)
void updateWorldSize(int world_width, int world_height);
private:
// Convertir coordenadas (x, y) a índice de celda (cell_x, cell_y)
void getCellCoords(float x, float y, int& cell_x, int& cell_y) const;
private:
// Convertir coordenadas (x, y) a índice de celda (cell_x, cell_y)
void getCellCoords(float x, float y, int& cell_x, int& cell_y) const;
// Convertir (cell_x, cell_y) a hash key único para el mapa
int getCellKey(int cell_x, int cell_y) const;
// Convertir (cell_x, cell_y) a hash key único para el mapa
int getCellKey(int cell_x, int cell_y) const;
// Dimensiones del mundo (ancho/alto en píxeles)
int world_width_;
int world_height_;
// Dimensiones del mundo (ancho/alto en píxeles)
int world_width_;
int world_height_;
// Tamaño de cada celda (en píxeles)
float cell_size_;
// Tamaño de cada celda (en píxeles)
float cell_size_;
// Número de celdas en cada dimensión
int grid_cols_;
int grid_rows_;
// Número de celdas en cada dimensión
int grid_cols_;
int grid_rows_;
// Estructura de datos: hash map de cell_key → vector de Ball*
// Usamos unordered_map para O(1) lookup
std::unordered_map<int, std::vector<Ball*>> cells_;
// Estructura de datos: hash map de cell_key → vector de Ball*
// Usamos unordered_map para O(1) lookup
std::unordered_map<int, std::vector<Ball*>> cells_;
};