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>
46 lines
1.6 KiB
C++
46 lines
1.6 KiB
C++
#include "static_theme.hpp"
|
|
|
|
StaticTheme::StaticTheme(const char* name_en, const char* name_es, int text_r, int text_g, int text_b, int notif_bg_r, int notif_bg_g, int notif_bg_b, float bg_top_r, float bg_top_g, float bg_top_b, float bg_bottom_r, float bg_bottom_g, float bg_bottom_b, std::vector<Color> ball_colors)
|
|
: name_en_(name_en),
|
|
name_es_(name_es),
|
|
text_r_(text_r),
|
|
text_g_(text_g),
|
|
text_b_(text_b),
|
|
notif_bg_r_(notif_bg_r),
|
|
notif_bg_g_(notif_bg_g),
|
|
notif_bg_b_(notif_bg_b),
|
|
bg_top_r_(bg_top_r),
|
|
bg_top_g_(bg_top_g),
|
|
bg_top_b_(bg_top_b),
|
|
bg_bottom_r_(bg_bottom_r),
|
|
bg_bottom_g_(bg_bottom_g),
|
|
bg_bottom_b_(bg_bottom_b),
|
|
ball_colors_(std::move(ball_colors)) {
|
|
}
|
|
|
|
auto StaticTheme::getBallColor(size_t ball_index, float progress) const -> Color {
|
|
// Tema estático: siempre retorna color de paleta según índice
|
|
// (progress se ignora aquí, pero será usado en PHASE 3 para LERP externo)
|
|
if (ball_colors_.empty()) {
|
|
return {.r = 255, .g = 255, .b = 255}; // Blanco por defecto si paleta vacía
|
|
}
|
|
return ball_colors_[ball_index % ball_colors_.size()];
|
|
}
|
|
|
|
void StaticTheme::getBackgroundColors(float progress,
|
|
float& tr,
|
|
float& tg,
|
|
float& tb,
|
|
float& br,
|
|
float& bg,
|
|
float& bb) const {
|
|
// Tema estático: siempre retorna colores de fondo fijos
|
|
// (progress se ignora aquí, pero será usado en PHASE 3 para LERP externo)
|
|
tr = bg_top_r_;
|
|
tg = bg_top_g_;
|
|
tb = bg_top_b_;
|
|
br = bg_bottom_r_;
|
|
bg = bg_bottom_g_;
|
|
bb = bg_bottom_b_;
|
|
}
|