From 26bd5a9efa7c8cffbbd54a98290a4dc2f780a0af Mon Sep 17 00:00:00 2001 From: Sergio Valor Date: Fri, 22 May 2026 22:43:32 +0200 Subject: [PATCH] tweak(playfield): el grid principal es dibuixa sobre el subgrid a les interseccions --- source/core/graphics/playfield.cpp | 30 ++++++++++++++++++++++++++++-- 1 file changed, 28 insertions(+), 2 deletions(-) diff --git a/source/core/graphics/playfield.cpp b/source/core/graphics/playfield.cpp index 8d74d42..f382a4e 100644 --- a/source/core/graphics/playfield.cpp +++ b/source/core/graphics/playfield.cpp @@ -196,13 +196,39 @@ namespace Graphics { lines_.clear(); lines_.reserve(verticals.size() + horizontals.size()); + // El spawn_time_s s'assigna per índex espacial perquè la diagonal de + // l'ona de creixement avanci uniformement. L'ordre dins lines_, en + // canvi, ha de garantir que el grid principal (més brillant) es + // dibuixi DESPRÉS del subgrid: així a les interseccions guanya el + // principal i no queden tallades pel subgrid. for (int i = 0; i < NUM_V; i++) { verticals[i].spawn_time_s = static_cast(i) * INTERVAL_V; - lines_.push_back(verticals[i]); } for (int i = 0; i < NUM_H; i++) { horizontals[i].spawn_time_s = static_cast(i) * INTERVAL_H; - lines_.push_back(horizontals[i]); + } + + // Passada 1: subgrid (verticals + horitzontals). + for (const auto& v : verticals) { + if (v.brightness < Defaults::Playfield::GRID_BRIGHTNESS) { + lines_.push_back(v); + } + } + for (const auto& h : horizontals) { + if (h.brightness < Defaults::Playfield::GRID_BRIGHTNESS) { + lines_.push_back(h); + } + } + // Passada 2: grid principal (verticals + horitzontals). + for (const auto& v : verticals) { + if (v.brightness >= Defaults::Playfield::GRID_BRIGHTNESS) { + lines_.push_back(v); + } + } + for (const auto& h : horizontals) { + if (h.brightness >= Defaults::Playfield::GRID_BRIGHTNESS) { + lines_.push_back(h); + } } }