From e954d4ea59f4e4794d4357be86a592947304930e Mon Sep 17 00:00:00 2001 From: Sergio Valor Date: Fri, 22 May 2026 23:10:06 +0200 Subject: [PATCH] =?UTF-8?q?tweak(playfield):=20rejilla=20violeta=20synthwa?= =?UTF-8?q?ve=20+=20brillos=20+5%;=20starfield=20unificat=20al=20color=20d?= =?UTF-8?q?el=20t=C3=ADtol?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- source/core/defaults/playfield.hpp | 9 +++++++-- source/core/graphics/playfield.cpp | 12 +++++++++--- source/core/graphics/starfield_parallax.cpp | 11 +++-------- 3 files changed, 19 insertions(+), 13 deletions(-) diff --git a/source/core/defaults/playfield.hpp b/source/core/defaults/playfield.hpp index 512722c..d0dc67a 100644 --- a/source/core/defaults/playfield.hpp +++ b/source/core/defaults/playfield.hpp @@ -3,6 +3,8 @@ #pragma once +#include + namespace Defaults::Playfield { // Estructura de la graella (cel·les omplen tota la PLAYAREA) @@ -11,8 +13,11 @@ namespace Defaults::Playfield { constexpr int SUBDIVISIONS = 4; // cada cel·la principal es divideix en N subcel·les // Brillo respecte al color global (border = 1.0) - constexpr float GRID_BRIGHTNESS = 0.15F; - constexpr float SUBGRID_BRIGHTNESS = 0.05F; + constexpr float GRID_BRIGHTNESS = 0.20F; + constexpr float SUBGRID_BRIGHTNESS = 0.10F; + + // Color de la rejilla (lila/violeta synthwave). Es modula amb brillantor. + constexpr SDL_Color GRID_COLOR = {.r = 160, .g = 80, .b = 255, .a = 255}; // Animació de creació amb timer intern del Playfield. // L'animació total cobreix tot l'INIT_HUD (3 s). Cada línia es pinta en diff --git a/source/core/graphics/playfield.cpp b/source/core/graphics/playfield.cpp index f382a4e..4358cb5 100644 --- a/source/core/graphics/playfield.cpp +++ b/source/core/graphics/playfield.cpp @@ -290,7 +290,9 @@ namespace Graphics { static_cast(START_Y), static_cast(END_X), static_cast(END_Y), - line.brightness); + line.brightness, + 0.0F, + Defaults::Playfield::GRID_COLOR); // Cap brillant mentre creix. if (P < 1.0F) { const float LENGTH = std::sqrt((DX * DX) + (DY * DY)); @@ -302,7 +304,9 @@ namespace Graphics { static_cast(START_Y + (DY * HEAD_T)), static_cast(END_X), static_cast(END_Y), - Defaults::Playfield::HEAD_BRIGHTNESS); + Defaults::Playfield::HEAD_BRIGHTNESS, + 0.0F, + Defaults::Playfield::GRID_COLOR); } } return; @@ -329,7 +333,9 @@ namespace Graphics { static_cast(prev_y), static_cast(NX), static_cast(NY), - line.brightness); + line.brightness, + 0.0F, + Defaults::Playfield::GRID_COLOR); prev_x = NX; prev_y = NY; } diff --git a/source/core/graphics/starfield_parallax.cpp b/source/core/graphics/starfield_parallax.cpp index 32b4da3..8735ace 100644 --- a/source/core/graphics/starfield_parallax.cpp +++ b/source/core/graphics/starfield_parallax.cpp @@ -31,20 +31,15 @@ namespace Graphics { const float MIN_Y = zona.y; const float MAX_Y = zona.y + zona.h; - // Tint aleatori entre blanc (255,255,255) i cyan (0,255,255) per estrella. - // T ∈ [0,1]: 0 → blanc; 1 → cyan. R = 255·(1-T), G=B=255. + // Color únic per a totes les estrelles: el mateix blanc-blau gel + // del starfield del títol (Defaults::Title::Colors::STARFIELD). const auto FILL_LAYER = [&](int layer, int count, int& idx) { for (int i = 0; i < count; i++) { - const float T = randUniform(0.0F, 1.0F); stars_[idx++] = Star{ .x = randUniform(MIN_X, MAX_X), .y = randUniform(MIN_Y, MAX_Y), .layer = layer, - .color = SDL_Color{ - .r = static_cast(255.0F * (1.0F - T)), - .g = 255, - .b = 255, - .a = 255}}; + .color = Defaults::Title::Colors::STARFIELD}; } };