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:
@@ -1,19 +1,15 @@
|
||||
#include "dynamic_theme.hpp"
|
||||
|
||||
#include <algorithm> // for std::min
|
||||
|
||||
DynamicTheme::DynamicTheme(const char* name_en, const char* name_es,
|
||||
int text_r, int text_g, int text_b,
|
||||
std::vector<DynamicThemeKeyframe> keyframes,
|
||||
bool loop)
|
||||
DynamicTheme::DynamicTheme(const char* name_en, const char* name_es, int text_r, int text_g, int text_b, std::vector<DynamicThemeKeyframe> keyframes, bool loop)
|
||||
: name_en_(name_en),
|
||||
name_es_(name_es),
|
||||
text_r_(text_r), text_g_(text_g), text_b_(text_b),
|
||||
text_r_(text_r),
|
||||
text_g_(text_g),
|
||||
text_b_(text_b),
|
||||
keyframes_(std::move(keyframes)),
|
||||
loop_(loop),
|
||||
current_keyframe_index_(0),
|
||||
target_keyframe_index_(1),
|
||||
transition_progress_(0.0f),
|
||||
paused_(false) {
|
||||
loop_(loop) {
|
||||
// Validación: mínimo 2 keyframes
|
||||
if (keyframes_.size() < 2) {
|
||||
// Fallback: duplicar primer keyframe si solo hay 1
|
||||
@@ -29,7 +25,9 @@ DynamicTheme::DynamicTheme(const char* name_en, const char* name_es,
|
||||
}
|
||||
|
||||
void DynamicTheme::update(float delta_time) {
|
||||
if (paused_) return; // No actualizar si está pausado
|
||||
if (paused_) {
|
||||
return; // No actualizar si está pausado
|
||||
}
|
||||
|
||||
// Obtener duración del keyframe objetivo
|
||||
float duration = keyframes_[target_keyframe_index_].duration;
|
||||
@@ -74,14 +72,14 @@ void DynamicTheme::advanceToNextKeyframe() {
|
||||
transition_progress_ = 0.0f;
|
||||
}
|
||||
|
||||
Color DynamicTheme::getBallColor(size_t ball_index, float progress) const {
|
||||
auto DynamicTheme::getBallColor(size_t ball_index, float progress) const -> Color {
|
||||
// Obtener keyframes actual y objetivo
|
||||
const auto& current_kf = keyframes_[current_keyframe_index_];
|
||||
const auto& target_kf = keyframes_[target_keyframe_index_];
|
||||
|
||||
// Si paletas vacías, retornar blanco
|
||||
if (current_kf.ball_colors.empty() || target_kf.ball_colors.empty()) {
|
||||
return {255, 255, 255};
|
||||
return {.r = 255, .g = 255, .b = 255};
|
||||
}
|
||||
|
||||
// Obtener colores de ambos keyframes (con wrap)
|
||||
@@ -95,15 +93,18 @@ Color DynamicTheme::getBallColor(size_t ball_index, float progress) const {
|
||||
// (progress parámetro será usado en PHASE 3 para LERP externo)
|
||||
float t = transition_progress_;
|
||||
return {
|
||||
static_cast<int>(lerp(c1.r, c2.r, t)),
|
||||
static_cast<int>(lerp(c1.g, c2.g, t)),
|
||||
static_cast<int>(lerp(c1.b, c2.b, t))
|
||||
};
|
||||
.r = static_cast<int>(lerp(c1.r, c2.r, t)),
|
||||
.g = static_cast<int>(lerp(c1.g, c2.g, t)),
|
||||
.b = static_cast<int>(lerp(c1.b, c2.b, t))};
|
||||
}
|
||||
|
||||
void DynamicTheme::getBackgroundColors(float progress,
|
||||
float& tr, float& tg, float& tb,
|
||||
float& br, float& bg, float& bb) const {
|
||||
float& tr,
|
||||
float& tg,
|
||||
float& tb,
|
||||
float& br,
|
||||
float& bg,
|
||||
float& bb) const {
|
||||
// Obtener keyframes actual y objetivo
|
||||
const auto& current_kf = keyframes_[current_keyframe_index_];
|
||||
const auto& target_kf = keyframes_[target_keyframe_index_];
|
||||
|
||||
Reference in New Issue
Block a user