|
From: Lasse Kärkkäi. <tr...@us...> - 2010-05-24 03:15:14
|
Module: performous
Branch: master
Commit: 3566fec4c29042cebb6112ee283d4c7cfcaf037e
Author: Lasse Karkkainen <tro...@tr...>
Date: Mon May 24 06:15:01 2010 +0300
Comment the code better.
---
game/guitargraph.cc | 9 +++++++--
1 files changed, 7 insertions(+), 2 deletions(-)
diff --git a/game/guitargraph.cc b/game/guitargraph.cc
index 059ac59..54f9418 100644
--- a/game/guitargraph.cc
+++ b/game/guitargraph.cc
@@ -440,23 +440,28 @@ void GuitarGraph::drumHit(double time, int fret) {
signed_error = it->begin - time;
}
}
- if (best == m_chords.end()) fail(time, fret);
+ if (best == m_chords.end()) fail(time, fret); // None found
else {
+ // Skip all chords earlier than the best fit chord
for (; best != m_chordIt; ++m_chordIt) {
if (m_chordIt->status == m_chordIt->polyphony) continue;
endStreak();
}
- ++m_chordIt->status;
+ ++m_chordIt->status; // One more drum belonging to the chord hit
Duration const* dur = m_chordIt->dur[fret];
+ // Record the hit event
m_events.push_back(Event(time, 1, fret, dur));
m_notes[dur] = m_events.size();
+ // Scoring
double score = points(tolerance);
m_chordIt->score += score;
m_score += score;
if (!m_drumfills.empty()) m_starmeter += score; // Only add starmeter if it's possible to activate GodMode
+ // Graphical effects
m_flames[fret].push_back(AnimValue(0.0, flameSpd));
m_flames[fret].back().setTarget(1.0);
if (fret == 0) m_drumJump.setTarget(1.0); // Do a jump for bass drum
+ // All drums of the chord hit already?
if (m_chordIt->status == m_chordIt->polyphony) {
//m_score -= m_chordIt->score;
//m_chordIt->score *= m_chordIt->polyphony;
|