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>
81 lines
2.9 KiB
C++
81 lines
2.9 KiB
C++
#pragma once
|
|
|
|
#include <string>
|
|
|
|
#include "theme.hpp"
|
|
|
|
/**
|
|
* StaticTheme: Tema estático con 1 keyframe (sin animación)
|
|
*
|
|
* Características:
|
|
* - Colores fijos (no cambian con el tiempo)
|
|
* - Sin update() necesario (needsUpdate() retorna false)
|
|
* - Progress siempre 0.0 (no hay animación interna)
|
|
* - Compatible con LERP externo (PHASE 3) vía parámetro progress
|
|
*
|
|
* Uso:
|
|
* - 7 temas estáticos: SUNSET, OCEAN, NEON, FOREST, RGB, MONOCHROME, LAVENDER
|
|
* - Indices 0-6 en el array unificado de ThemeManager
|
|
*/
|
|
class StaticTheme : public Theme {
|
|
public:
|
|
/**
|
|
* Constructor
|
|
* @param name_en: Nombre en inglés
|
|
* @param name_es: Nombre en español
|
|
* @param text_r, text_g, text_b: Color de texto UI
|
|
* @param notif_bg_r, notif_bg_g, notif_bg_b: Color de fondo de notificaciones
|
|
* @param bg_top_r, bg_top_g, bg_top_b: Color superior de fondo
|
|
* @param bg_bottom_r, bg_bottom_g, bg_bottom_b: Color inferior de fondo
|
|
* @param ball_colors: Paleta de colores para pelotas
|
|
*/
|
|
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);
|
|
|
|
~StaticTheme() override = default;
|
|
|
|
// ========================================
|
|
// QUERIES BÁSICAS
|
|
// ========================================
|
|
|
|
const char* getNameEN() const override { return name_en_.c_str(); }
|
|
const char* getNameES() const override { return name_es_.c_str(); }
|
|
void getTextColor(int& r, int& g, int& b) const override {
|
|
r = text_r_;
|
|
g = text_g_;
|
|
b = text_b_;
|
|
}
|
|
void getNotificationBackgroundColor(int& r, int& g, int& b) const override {
|
|
r = notif_bg_r_;
|
|
g = notif_bg_g_;
|
|
b = notif_bg_b_;
|
|
}
|
|
|
|
// ========================================
|
|
// CORE: OBTENER COLORES
|
|
// ========================================
|
|
|
|
Color getBallColor(size_t ball_index, float progress) const override;
|
|
void getBackgroundColors(float progress,
|
|
float& tr,
|
|
float& tg,
|
|
float& tb,
|
|
float& br,
|
|
float& bg,
|
|
float& bb) const override;
|
|
|
|
// ========================================
|
|
// ANIMACIÓN (sin soporte - tema estático)
|
|
// ========================================
|
|
|
|
// update(), needsUpdate(), getProgress(), resetProgress() usan defaults de Theme
|
|
|
|
private:
|
|
std::string name_en_;
|
|
std::string name_es_;
|
|
int text_r_, text_g_, text_b_;
|
|
int notif_bg_r_, notif_bg_g_, notif_bg_b_;
|
|
float bg_top_r_, bg_top_g_, bg_top_b_;
|
|
float bg_bottom_r_, bg_bottom_g_, bg_bottom_b_;
|
|
std::vector<Color> ball_colors_;
|
|
};
|