tweak(playfield): rejilla violeta synthwave + brillos +5%; starfield unificat al color del títol
This commit is contained in:
@@ -3,6 +3,8 @@
|
||||
|
||||
#pragma once
|
||||
|
||||
#include <SDL3/SDL.h>
|
||||
|
||||
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
|
||||
|
||||
@@ -290,7 +290,9 @@ namespace Graphics {
|
||||
static_cast<int>(START_Y),
|
||||
static_cast<int>(END_X),
|
||||
static_cast<int>(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<int>(START_Y + (DY * HEAD_T)),
|
||||
static_cast<int>(END_X),
|
||||
static_cast<int>(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<int>(prev_y),
|
||||
static_cast<int>(NX),
|
||||
static_cast<int>(NY),
|
||||
line.brightness);
|
||||
line.brightness,
|
||||
0.0F,
|
||||
Defaults::Playfield::GRID_COLOR);
|
||||
prev_x = NX;
|
||||
prev_y = NY;
|
||||
}
|
||||
|
||||
@@ -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<Uint8>(255.0F * (1.0F - T)),
|
||||
.g = 255,
|
||||
.b = 255,
|
||||
.a = 255}};
|
||||
.color = Defaults::Title::Colors::STARFIELD};
|
||||
}
|
||||
};
|
||||
|
||||
|
||||
Reference in New Issue
Block a user