|
From: knittl <kn...@us...> - 2009-08-03 08:39:37
|
Module: performous
Branch: master
Commit: 77a31d239c1388f2bc0ddce6cec900025d49233a
Author: Lasse Karkkainen <tro...@tr...>
Date: Fri Jul 31 13:21:04 2009 +0300
Initial work on the chord-based guitar engine.
---
game/guitargraph.cc | 1 +
game/guitargraph.hh | 16 ++++++++++++++++
2 files changed, 17 insertions(+), 0 deletions(-)
diff --git a/game/guitargraph.cc b/game/guitargraph.cc
index fe43bbb..987e5d9 100644
--- a/game/guitargraph.cc
+++ b/game/guitargraph.cc
@@ -202,6 +202,7 @@ bool GuitarGraph::difficulty(Difficulty level) {
for (int fret = 0; fret < 5; ++fret) if (nm.find(basepitch + fret) == nm.end()) ++fail;
if (fail == 5) return false;
m_level = level;
+ updateChords();
return true;
}
diff --git a/game/guitargraph.hh b/game/guitargraph.hh
index 32bb160..eb79a25 100644
--- a/game/guitargraph.hh
+++ b/game/guitargraph.hh
@@ -9,6 +9,20 @@
class Song;
+struct Chord {
+ double begin;
+ bool fret[5];
+ Duration const* dur[5];
+ bool chord;
+ bool tappable;
+ bool tapped;
+ int tapScore;
+};
+
+static inline bool operator==(Chord const& a, Chord const& b) {
+ return std::equal(a.fret, a.fret + 5, b.fret);
+}
+
/// handles drawing of notes and waves
class GuitarGraph {
public:
@@ -39,6 +53,8 @@ class GuitarGraph {
void difficultyAuto();
bool difficulty(Difficulty level);
SvgTxtTheme m_text;
+ void updateChords() {}
+ std::vector<Chord> m_chords;
typedef std::map<Duration const*, int> NoteStatus;
NoteStatus m_notes;
bool m_hammerReady;
|