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

@@ -1,7 +1,10 @@
#include "torus_shape.hpp"
#include "defines.hpp"
#include <algorithm>
#include <cmath>
#include "defines.hpp"
void TorusShape::generatePoints(int num_points, float screen_width, float screen_height) {
num_points_ = num_points;
major_radius_ = screen_height * TORUS_MAJOR_RADIUS_FACTOR;
@@ -26,10 +29,10 @@ void TorusShape::getPoint3D(int index, float& x, float& y, float& z) const {
// Calcular número aproximado de anillos y puntos por anillo
int num_rings = static_cast<int>(sqrtf(static_cast<float>(num_points_) * 0.5f));
if (num_rings < 2) num_rings = 2;
num_rings = std::max(num_rings, 2);
int points_per_ring = num_points_ / num_rings;
if (points_per_ring < 3) points_per_ring = 3;
points_per_ring = std::max(points_per_ring, 3);
// Obtener parámetros u y v del índice
int ring = index / points_per_ring;
@@ -57,7 +60,7 @@ void TorusShape::getPoint3D(int index, float& x, float& y, float& z) const {
float cos_u = cosf(u);
float sin_u = sinf(u);
float radius_at_v = major_radius_ + minor_radius_ * cos_v;
float radius_at_v = major_radius_ + (minor_radius_ * cos_v);
float x_base = radius_at_v * cos_u;
float y_base = radius_at_v * sin_u;
@@ -66,20 +69,20 @@ void TorusShape::getPoint3D(int index, float& x, float& y, float& z) const {
// Aplicar rotación en eje X
float cos_x = cosf(angle_x_);
float sin_x = sinf(angle_x_);
float y_rot_x = y_base * cos_x - z_base * sin_x;
float z_rot_x = y_base * sin_x + z_base * cos_x;
float y_rot_x = (y_base * cos_x) - (z_base * sin_x);
float z_rot_x = (y_base * sin_x) + (z_base * cos_x);
// Aplicar rotación en eje Y
float cos_y = cosf(angle_y_);
float sin_y = sinf(angle_y_);
float x_rot_y = x_base * cos_y - z_rot_x * sin_y;
float z_rot_y = x_base * sin_y + z_rot_x * cos_y;
float x_rot_y = (x_base * cos_y) - (z_rot_x * sin_y);
float z_rot_y = (x_base * sin_y) + (z_rot_x * cos_y);
// Aplicar rotación en eje Z
float cos_z = cosf(angle_z_);
float sin_z = sinf(angle_z_);
float x_final = x_rot_y * cos_z - y_rot_x * sin_z;
float y_final = x_rot_y * sin_z + y_rot_x * cos_z;
float x_final = (x_rot_y * cos_z) - (y_rot_x * sin_z);
float y_final = (x_rot_y * sin_z) + (y_rot_x * cos_z);
// Retornar coordenadas finales rotadas
x = x_final;
@@ -87,7 +90,7 @@ void TorusShape::getPoint3D(int index, float& x, float& y, float& z) const {
z = z_rot_y;
}
float TorusShape::getScaleFactor(float screen_height) const {
auto TorusShape::getScaleFactor(float screen_height) const -> float {
// Factor de escala para física: proporcional al radio mayor
// Radio mayor base = 60px (0.25 * 240px en resolución 320x240)
const float BASE_RADIUS = 60.0f;