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); + } } }