|
From: Jaakko N. <jni...@us...> - 2009-11-12 19:08:30
|
Module: performous
Branch: dance
Commit: 91c36eae3510a69821a155ec69e3a2b48dcb7678
Author: Jaakko Nikkola <jaa...@tk...>
Date: Thu Nov 12 21:07:03 2009 +0200
typedef correction (Chord and Chords for sm-parser to DanceChord DanceChords)
---
game/notes.cc | 2 +-
game/notes.hh | 8 ++++----
game/songparser-sm.cc | 10 +++++-----
3 files changed, 10 insertions(+), 10 deletions(-)
diff --git a/game/notes.cc b/game/notes.cc
index 29d00ae..e8e8ab2 100644
--- a/game/notes.cc
+++ b/game/notes.cc
@@ -78,7 +78,7 @@ double Note::scoreMultiplier(double error) const {
Duration::Duration(): begin(getNaN()), end(getNaN()) {}
-DanceTrack::DanceTrack(std::string d, Chords c) : description(d), chords(c) {}
+DanceTrack::DanceTrack(std::string d, DanceChords c) : description(d), chords(c) {}
diff --git a/game/notes.hh b/game/notes.hh
index 5f2ba88..5bd2e09 100644
--- a/game/notes.hh
+++ b/game/notes.hh
@@ -97,16 +97,16 @@ struct Note {
typedef std::vector<Note> Notes;
//container for dance songs
-typedef std::map<int, Note> Chord; //int indicates "arrow" position (cmp. fret in guitar)
-typedef std::vector<Chord> Chords;
+typedef std::map<int, Note> DanceChord; //int indicates "arrow" position (cmp. fret in guitar)
+typedef std::vector<DanceChord> DanceChords;
struct DanceTrack {
//track description
std::string description;
//container for the actual note data
- Chords chords;
- DanceTrack(std::string d, Chords c);
+ DanceChords chords;
+ DanceTrack(std::string d, DanceChords c);
};
enum DanceDifficulty {
diff --git a/game/songparser-sm.cc b/game/songparser-sm.cc
index 21bc5f5..e13a209 100644
--- a/game/songparser-sm.cc
+++ b/game/songparser-sm.cc
@@ -58,7 +58,7 @@ bool SongParser::smParseField(std::string line) {
//temporary containers for note data
DanceTrackMap danceTrackMap;
- Chords chords;
+ DanceChords chords;
//Note values are analyzed here. Values are:
@@ -130,7 +130,7 @@ bool SongParser::smParseField(std::string line) {
return true;
}
-bool SongParser::smParseNote(std::string line, Chords chords){
+bool SongParser::smParseNote(std::string line, DanceChords chords){
if(line.empty()) return true;
if(line[0] == '#') throw std::runtime_error("Key found in the middle of notes");
if(line[0] == ';') return false; //end mark
@@ -145,8 +145,8 @@ bool SongParser::smParseNote(std::string line, Chords chords){
dur = 4 * ( 1/(m_bpm/60) ) / lcount; //counts one note duration in seconds;
for(int j = count - lcount; j<count ; j++) {
for(int i = 0; i<4; i++) {
- if(m_song.dance_chords[j][i]) m_song.dance_chords[j][i].begin = tm;
- if(m_song.dance_chords[j][i]) m_song.dance_chords[j][i].end = tm;
+ if(chords[j][i]) chords[j][i].begin = tm;
+ if(chords[j][i]) chords[j][i].end = tm;
}
tm += dur;
@@ -157,7 +157,7 @@ bool SongParser::smParseNote(std::string line, Chords chords){
//reading notes into a chord
std::istringstream iss(line);
- Chord chord;
+ DanceChord chord;
for(int i =1; i <= 4; i++){
if(iss.get() == '1') {
Note note;
|