Implementar transiciones suaves de temas con LERP
Características: - Sistema LERP para interpolar colores de fondo y sprites - Transiciones de 0.5 segundos sin interrumpir física - Variables de estado: target_theme, transitioning, transition_progress - getInterpolatedColor() para colores en tiempo real - Actualización automática de colores al finalizar transición - setColor() añadido a Ball class - Teclas B y Numpad 1-6 activan transiciones suaves - Ya no reinicia pelotas al cambiar tema 🤖 Generated with [Claude Code](https://claude.com/claude-code) Co-Authored-By: Claude <noreply@anthropic.com>
This commit is contained in:
@@ -70,9 +70,16 @@ private:
|
||||
|
||||
// Sistema de temas
|
||||
ColorTheme current_theme_ = ColorTheme::SUNSET;
|
||||
ColorTheme target_theme_ = ColorTheme::SUNSET; // Tema destino para transición
|
||||
bool transitioning_ = false; // ¿Estamos en transición?
|
||||
float transition_progress_ = 0.0f; // Progreso de 0.0 a 1.0
|
||||
float transition_duration_ = 0.5f; // Duración en segundos
|
||||
|
||||
// Estructura de tema de colores
|
||||
struct ThemeColors {
|
||||
const char* name_en; // Nombre en inglés (para debug)
|
||||
const char* name_es; // Nombre en español (para display)
|
||||
int text_color_r, text_color_g, text_color_b; // Color del texto del tema
|
||||
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;
|
||||
@@ -116,6 +123,11 @@ private:
|
||||
void checkAutoRestart();
|
||||
void performRandomRestart();
|
||||
|
||||
// Sistema de transiciones LERP
|
||||
float lerp(float a, float b, float t) const { return a + (b - a) * t; }
|
||||
Color getInterpolatedColor(size_t ball_index) const; // Obtener color interpolado durante transición
|
||||
void startThemeTransition(ColorTheme new_theme);
|
||||
|
||||
// Sistema de zoom dinámico
|
||||
int calculateMaxWindowZoom() const;
|
||||
void setWindowZoom(int new_zoom);
|
||||
|
||||
Reference in New Issue
Block a user