|
From: Tapio V. <aa...@us...> - 2010-01-26 18:55:56
|
Module: performous
Branch: master
Commit: a8f7ee7546050560b60684af260ad8140e91e3b0
Author: Tapio Vierros <tap...@gm...>
Date: Tue Jan 26 20:50:49 2010 +0200
Use guitar track first rather than bass; also, put drum graph last (until it can be put middle).
---
game/notes.hh | 12 ++++++++++--
game/screen_sing.cc | 6 +++---
2 files changed, 13 insertions(+), 5 deletions(-)
diff --git a/game/notes.hh b/game/notes.hh
index 9ea9fe6..f5bbe71 100644
--- a/game/notes.hh
+++ b/game/notes.hh
@@ -45,6 +45,14 @@ struct Duration {
typedef std::vector<Duration> Durations;
typedef std::map<int, Durations> NoteMap;
+/// Sort by instrument track name
+struct CompTrack {
+ bool operator()(std::string const& l, std::string const& r) const {
+ // TODO: Sort other guitar tracks (coop / rhythm) properly
+ return l > r;
+ }
+};
+
struct Track {
// TODO: name should not be needed here (contained into the map)
Track(std::string n): name(n) {}
@@ -53,8 +61,8 @@ struct Track {
};
// keep these ones
-typedef std::map<std::string,Track> TrackMap;
-typedef std::map<std::string,Track const*> TrackMapConstPtr; // this one really needed ? can't we save only the map key for comparison ?
+typedef std::map<std::string, Track, CompTrack> TrackMap;
+typedef std::map<std::string, Track const*, CompTrack> TrackMapConstPtr; // this one really needed ? can't we save only the map key for comparison ?
namespace {
bool isTrackInside(TrackMap const& track_map, std::string const& name) {
diff --git a/game/screen_sing.cc b/game/screen_sing.cc
index ef0d8ec..03ad50f 100644
--- a/game/screen_sing.cc
+++ b/game/screen_sing.cc
@@ -67,12 +67,12 @@ void ScreenSing::enter() {
try {
if (idx == 0) {
if (type == 0 && !m_song->hasDance()) ++type;
- if (type == 1 && !m_song->hasDrums()) ++type;
- if (type == 2 && !m_song->hasGuitars()) ++type;
+ if (type == 1 && !m_song->hasGuitars()) ++type;
+ if (type == 2 && !m_song->hasDrums()) ++type;
if (type == 3) break;
}
if (type == 0) m_dancers.push_back(new DanceGraph(m_audio, *m_song));
- else m_instruments.push_back(new GuitarGraph(m_audio, *m_song, type == 1, idx));
+ else m_instruments.push_back(new GuitarGraph(m_audio, *m_song, type == 2, idx));
++idx;
} catch (input::NoDevError&) {
++type;
|