|
From: Jaakko N. <jni...@us...> - 2009-11-12 19:39:35
|
Module: performous
Branch: dance
Commit: bf7bccbabcd77b071a13d7c9d8086937a5101947
Author: Jaakko Nikkola <jaa...@tk...>
Date: Thu Nov 12 21:38:44 2009 +0200
Some problems fixed (should compile)
---
game/notes.cc | 2 +-
game/notes.hh | 2 +-
game/songparser-sm.cc | 13 ++++++-------
game/songparser.hh | 4 ++--
4 files changed, 10 insertions(+), 11 deletions(-)
diff --git a/game/notes.cc b/game/notes.cc
index e8e8ab2..6e307c4 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, DanceChords 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 5bd2e09..3af625f 100644
--- a/game/notes.hh
+++ b/game/notes.hh
@@ -102,11 +102,11 @@ typedef std::vector<DanceChord> DanceChords;
struct DanceTrack {
+ DanceTrack(std::string& d, DanceChords& c);
//track description
std::string description;
//container for the actual note data
DanceChords chords;
- DanceTrack(std::string d, DanceChords c);
};
enum DanceDifficulty {
diff --git a/game/songparser-sm.cc b/game/songparser-sm.cc
index e13a209..441edd8 100644
--- a/game/songparser-sm.cc
+++ b/game/songparser-sm.cc
@@ -57,18 +57,17 @@ bool SongParser::smParseField(std::string line) {
if (key == "NOTES") {
//temporary containers for note data
- DanceTrackMap danceTrackMap;
+ DanceDifficultyMap danceDifficultyMap;
DanceChords chords;
//Note values are analyzed here. Values are:
//<NotesType>:
if(!getline(line)) { throw std::runtime_error("Required note data missing"); }
- std::string notestype = boost::trim_copy(line.substr(0, line.size() -1);
+ std::string notestype = boost::trim_copy(line.substr(0, line.size() -1));
//<Description>:
if(!getline(line)) { throw std::runtime_error("Required note data missing"); }
std::string description = boost::trim_copy(line.substr(0, line.size() -1));
- m_song.dance_data.addDescription(description);
//<DifficultyClass>:
if(!getline(line)) { throw std::runtime_error("Required note data missing"); }
std::string difficultyclass = boost::trim_copy(line.substr(0, line.size() -1));
@@ -92,8 +91,8 @@ bool SongParser::smParseField(std::string line) {
while (getline(line) && smParseNote(line, chords)) {}
DanceTrack danceTrack(description, chords);
- danceTrackMap[danceDifficulty] = danceTrack;
- m_song.danceTracks[notestype] = danceTrackMap;
+// danceDifficultyMap[danceDifficulty] = danceTrack;
+// m_song.danceTracks[notestype] = danceDifficultyMap;
return true;
}
@@ -145,8 +144,8 @@ bool SongParser::smParseNote(std::string line, DanceChords 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(chords[j][i]) chords[j][i].begin = tm;
- if(chords[j][i]) 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;
diff --git a/game/songparser.hh b/game/songparser.hh
index 5d1db07..b95e93c 100644
--- a/game/songparser.hh
+++ b/game/songparser.hh
@@ -96,8 +96,8 @@ class SongParser {
void iniParse();
bool smCheck(std::vector<char> const& data);
void smParse();
- bool smParseField(std::string& line);
- bool smParseNote(std::string& line);
+ bool smParseField(std::string line);
+ bool smParseNote(std::string line, DanceChords chords);
double m_prevtime;
unsigned int m_prevts;
unsigned int m_relativeShift;
|