Merge remote-tracking branch 'origin/master'

This commit is contained in:
Gordon Weeks 2026-01-31 17:54:57 -08:00
commit d8f35df012
37 changed files with 13 additions and 6 deletions

View File

@ -83,10 +83,10 @@ const Color INSTRUMENT_COLORS[MAX_INSTRUMENT_TYPES] = {
}; };
const float INSTRUMENT_VOLUME[MAX_INSTRUMENT_TYPES] = { const float INSTRUMENT_VOLUME[MAX_INSTRUMENT_TYPES] = {
0.4f, 0.3f,
0.6f, 0.5f,
1.0f, 1.0f,
0.7f 0.6f
}; };
/* Index i = MIDI note (48 + i); notes outside [48, 83] are not rendered. */ /* Index i = MIDI note (48 + i); notes outside [48, 83] are not rendered. */
@ -343,8 +343,10 @@ public:
bool music_loaded = false; bool music_loaded = false;
std::vector<Glyph> chart; std::vector<Glyph> chart;
std::vector<Glyph*> spawned; std::vector<Glyph*> spawned;
std::unordered_set<Glyph*> completed_notes_history;
std::unordered_set<Glyph*> completed_notes; std::unordered_set<Glyph*> completed_notes;
std::unordered_set<Glyph*> missed_notes; std::unordered_set<Glyph*> missed_notes;
std::unordered_set<Glyph*> missed_notes_history;
std::vector<PendingSound> pending_sounds; std::vector<PendingSound> pending_sounds;
std::vector<ActiveSustainedSound> active_sustained; std::vector<ActiveSustainedSound> active_sustained;
bool instrument_has_hits[MAX_INSTRUMENT_TYPES] = {false}; bool instrument_has_hits[MAX_INSTRUMENT_TYPES] = {false};
@ -583,6 +585,7 @@ public:
if (it != spawned.end()) if (it != spawned.end())
{ {
hit_flash_timer[n->lane] = PRESS_FLASH_DURATION; hit_flash_timer[n->lane] = PRESS_FLASH_DURATION;
completed_notes_history.insert(n);
completed_notes.insert(n); completed_notes.insert(n);
// n.time is when the bottom should hit the line // n.time is when the bottom should hit the line
float bottom_hits_line_time = n->time + chart_time_offset; float bottom_hits_line_time = n->time + chart_time_offset;
@ -753,10 +756,14 @@ public:
if (!has_hits) if (!has_hits)
continue; continue;
float bottom_y = glyph_bottom_y(*n); float bottom_y = glyph_bottom_y(*n);
if (bottom_y > hit_line_y + HIT_ZONE_MARGIN) if (bottom_y > hit_line_y + HIT_ZONE_MARGIN &&
std::find(completed_notes_history.begin(), completed_notes_history.end(), n) == completed_notes_history.end() &&
std::find(missed_notes_history.begin(), missed_notes_history.end(), n) == missed_notes_history.end()
)
{ {
missed_notes_history.insert(n);
missed_notes.insert(n); missed_notes.insert(n);
TraceLog(LOG_WARNING, "COMBO RESET -> 0 (missed note: lane %d, inst %d, is_auto=%d, has_hits=%d, PHYSICAL_GP[%d]=%d)", TraceLog(LOG_WARNING, "COMBO RESET0 -> 0 (missed note: lane %d, inst %d, is_auto=%d, has_hits=%d, PHYSICAL_GP[%d]=%d)",
n->lane, n->instrument_slot, is_auto, has_hits, n->instrument_slot, INSTRUMENT_PHYSICAL_GAMEPAD[n->instrument_slot]); n->lane, n->instrument_slot, is_auto, has_hits, n->instrument_slot, INSTRUMENT_PHYSICAL_GAMEPAD[n->instrument_slot]);
combo = 0; combo = 0;
} }
@ -843,7 +850,7 @@ public:
} }
else else
{ {
TraceLog(LOG_WARNING, "COMBO RESET -> 0 (lane %d pressed but no valid note found)", lane); TraceLog(LOG_WARNING, "COMBO RESET2 -> 0 (lane %d pressed but no valid note found)", lane);
combo = 0; combo = 0;
score = std::max(0, score - 25); score = std::max(0, score - 25);
} }