tweak(playfield): el grid principal es dibuixa sobre el subgrid a les interseccions

This commit is contained in:
2026-05-22 22:43:32 +02:00
parent 4b0d85c010
commit 26bd5a9efa
+28 -2
View File
@@ -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<float>(i) * INTERVAL_V;
lines_.push_back(verticals[i]);
}
for (int i = 0; i < NUM_H; i++) {
horizontals[i].spawn_time_s = static_cast<float>(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);
}
}
}