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:
@@ -3,10 +3,10 @@
|
||||
#include <memory> // for unique_ptr
|
||||
#include <vector> // for vector
|
||||
|
||||
#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
|
||||
#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)
|
||||
@@ -42,7 +42,7 @@ class ThemeManager {
|
||||
~ThemeManager() = default;
|
||||
|
||||
// Inicialización
|
||||
void initialize(); // Inicializa 15 temas unificados (9 estáticos + 6 dinámicos)
|
||||
void initialize(); // Inicializa 15 temas unificados (9 estáticos + 6 dinámicos)
|
||||
void setMaxBallCount(int n) { max_ball_count_ = n; } // Máximo real (escenario 8 o custom si mayor)
|
||||
|
||||
// Interfaz unificada (PHASE 2 + PHASE 3)
|
||||
@@ -53,9 +53,8 @@ class ThemeManager {
|
||||
void pauseDynamic(); // Toggle pausa de animación (Shift+D, solo dinámicos)
|
||||
|
||||
// Queries de colores (usado en rendering)
|
||||
Color getInterpolatedColor(size_t ball_index) const; // Obtiene color interpolado para pelota
|
||||
void getBackgroundColors(float& top_r, float& top_g, float& top_b,
|
||||
float& bottom_r, float& bottom_g, float& bottom_b) const; // Obtiene colores de fondo degradado
|
||||
Color getInterpolatedColor(size_t ball_index) const; // Obtiene color interpolado para pelota
|
||||
void getBackgroundColors(float& top_r, float& top_g, float& top_b, float& bottom_r, float& bottom_g, float& bottom_b) const; // Obtiene colores de fondo degradado
|
||||
|
||||
// Queries de estado (para debug display y lógica)
|
||||
int getCurrentThemeIndex() const { return current_theme_index_; }
|
||||
@@ -89,13 +88,13 @@ class ThemeManager {
|
||||
// ========================================
|
||||
|
||||
// Estado de transición
|
||||
bool transitioning_ = false; // ¿Hay transición LERP activa?
|
||||
float transition_progress_ = 0.0f; // Progreso 0.0-1.0 (0.0 = origen, 1.0 = destino)
|
||||
bool transitioning_ = false; // ¿Hay transición LERP activa?
|
||||
float transition_progress_ = 0.0f; // Progreso 0.0-1.0 (0.0 = origen, 1.0 = destino)
|
||||
float transition_duration_ = THEME_TRANSITION_DURATION; // Duración en segundos (configurable en defines.h)
|
||||
|
||||
// Índices de temas involucrados en transición
|
||||
int source_theme_index_ = 0; // Tema origen (del que venimos)
|
||||
int target_theme_index_ = 0; // Tema destino (al que vamos)
|
||||
int source_theme_index_ = 0; // Tema origen (del que venimos)
|
||||
int target_theme_index_ = 0; // Tema destino (al que vamos)
|
||||
|
||||
// Snapshot del tema origen (capturado al iniciar transición)
|
||||
std::unique_ptr<ThemeSnapshot> source_snapshot_; // nullptr si no hay transición
|
||||
@@ -112,6 +111,6 @@ class ThemeManager {
|
||||
void initializeDynamicThemes(); // Crea 6 temas dinámicos (índices 9-14)
|
||||
|
||||
// Sistema de transición LERP (PHASE 3)
|
||||
std::unique_ptr<ThemeSnapshot> captureCurrentSnapshot() const; // Captura snapshot del tema actual
|
||||
std::unique_ptr<ThemeSnapshot> captureCurrentSnapshot() const; // Captura snapshot del tema actual
|
||||
float lerp(float a, float b, float t) const { return a + (b - a) * t; } // Interpolación lineal
|
||||
};
|
||||
|
||||
Reference in New Issue
Block a user