You can subscribe to this list here.
| 2009 |
Jan
|
Feb
|
Mar
|
Apr
|
May
|
Jun
(25) |
Jul
(288) |
Aug
(119) |
Sep
(31) |
Oct
(59) |
Nov
(458) |
Dec
(359) |
|---|---|---|---|---|---|---|---|---|---|---|---|---|
| 2010 |
Jan
(268) |
Feb
(26) |
Mar
(36) |
Apr
(48) |
May
(119) |
Jun
(37) |
Jul
(173) |
Aug
(429) |
Sep
(137) |
Oct
(156) |
Nov
(59) |
Dec
(45) |
| 2011 |
Jan
(398) |
Feb
(257) |
Mar
(49) |
Apr
(5) |
May
(34) |
Jun
(11) |
Jul
(38) |
Aug
(12) |
Sep
(1) |
Oct
(49) |
Nov
(5) |
Dec
(10) |
| 2012 |
Jan
(21) |
Feb
(32) |
Mar
(20) |
Apr
(1) |
May
(2) |
Jun
|
Jul
(173) |
Aug
|
Sep
(25) |
Oct
(6) |
Nov
(44) |
Dec
|
|
From: Lasse Kärkkäi. <tr...@us...> - 2009-11-14 17:23:03
|
Module: performous Branch: master Commit: 47051bd2c8ef88f1b895100c9c0add3e803731fe Author: Lasse Karkkainen <tro...@tr...> Date: Sat Nov 14 19:21:39 2009 +0200 Merge branch 'master' of ssh://tronic@git.performous.org/gitroot/performous/performous --- |
|
From: Lasse Kärkkäi. <tr...@us...> - 2009-11-14 17:23:03
|
Module: performous
Branch: master
Commit: 1e188dba99b4322e35fd4f0c6b65591f44e0aca8
Author: Lasse Karkkainen <tro...@tr...>
Date: Sat Nov 14 19:18:24 2009 +0200
Rename difficulty levels
---
game/guitargraph.cc | 8 ++++----
1 files changed, 4 insertions(+), 4 deletions(-)
diff --git a/game/guitargraph.cc b/game/guitargraph.cc
index 60281c5..eff9119 100644
--- a/game/guitargraph.cc
+++ b/game/guitargraph.cc
@@ -11,10 +11,10 @@
namespace {
struct Diff { std::string name; int basepitch; } diffv[] = {
- { "Supaeasy", 0x3C },
- { "Easy", 0x48 },
- { "Medium", 0x54 },
- { "Amazing", 0x60 }
+ { "Easy", 0x3C },
+ { "Medium", 0x48 },
+ { "Hard", 0x54 },
+ { "Expert", 0x60 }
};
const size_t diffsz = sizeof(diffv) / sizeof(*diffv);
|
|
From: Tapio V. <aa...@us...> - 2009-11-14 17:17:39
|
Module: performous
Branch: master
Commit: 68cf4a6a04f4ec8022df21bfcd8ef9c6c00f216f
Author: Tapio Vierros <tap...@gm...>
Date: Sat Nov 14 19:15:09 2009 +0200
Fixed forgotten renames.
Also lowered the no player threshold for instruments for easier testing (there is no random noise with instruments).
---
game/screen_sing.cc | 8 ++++----
1 files changed, 4 insertions(+), 4 deletions(-)
diff --git a/game/screen_sing.cc b/game/screen_sing.cc
index e38a99b..a6c383b 100644
--- a/game/screen_sing.cc
+++ b/game/screen_sing.cc
@@ -339,10 +339,10 @@ ScoreWindow::ScoreWindow(Instruments& instruments, Database& database):
item.track_simple = it->getTrack();
item.track = it->getTrack() + " - " + it->getDifficultyString();
item.track[0] = toupper(item.track[0]);
- if (item.score < 500) { std::cout << "kick " << item.track << std::endl; it = instruments.erase(it); continue; }
+ if (item.score < 100) { std::cout << "kick " << item.track << std::endl; it = instruments.erase(it); continue; }
- if (item.track == "drums") item.color = glutil::Color(0.1f, 0.1f, 0.1f);
- else if (item.track == "bass") item.color = glutil::Color(0.5f, 0.3f, 0.1f);
+ if (item.track_simple == "drums") item.color = glutil::Color(0.1f, 0.1f, 0.1f);
+ else if (item.track_simple == "bass") item.color = glutil::Color(0.5f, 0.3f, 0.1f);
else item.color = glutil::Color(1.0f, 0.0f, 0.0f);
std::cout << "insert " << item.track << " score: " << item.score << std::endl;
@@ -355,7 +355,7 @@ ScoreWindow::ScoreWindow(Instruments& instruments, Database& database):
m_rank = "No player!";
else {
int topScore = m_database.scores.front().score;
- if (m_database.scores.front().track == "vocals") {
+ if (m_database.scores.front().track_simple == "vocals") {
if (topScore > 8000) m_rank = "Hit singer";
else if (topScore > 6000) m_rank = "Lead singer";
else if (topScore > 4000) m_rank = "Rising star";
|
|
From: Tapio V. <aa...@us...> - 2009-11-14 17:02:55
|
Module: performous
Branch: master
Commit: 71ce891269829aa0f3646994f35491d9acf5c1a0
Author: Tapio Vierros <tap...@gm...>
Date: Sat Nov 14 19:01:32 2009 +0200
Changed hiscore database track-attribute format (capitalization, space between hyphen).
---
game/screen_sing.cc | 5 +++--
1 files changed, 3 insertions(+), 2 deletions(-)
diff --git a/game/screen_sing.cc b/game/screen_sing.cc
index e89bdd5..e38a99b 100644
--- a/game/screen_sing.cc
+++ b/game/screen_sing.cc
@@ -326,7 +326,7 @@ ScoreWindow::ScoreWindow(Instruments& instruments, Database& database):
for (std::list<Player>::iterator p = m_database.cur.begin(); p != m_database.cur.end(); ++p) {
ScoreItem item;
item.score = p->getScore();
- item.track = "vocals";
+ item.track = "Vocals";
item.track_simple = "vocals";
item.color = glutil::Color(p->m_color.r, p->m_color.g, p->m_color.b);
@@ -337,7 +337,8 @@ ScoreWindow::ScoreWindow(Instruments& instruments, Database& database):
ScoreItem item;
item.score = it->getScore();
item.track_simple = it->getTrack();
- item.track = it->getTrack() + "-" + it->getDifficultyString();
+ item.track = it->getTrack() + " - " + it->getDifficultyString();
+ item.track[0] = toupper(item.track[0]);
if (item.score < 500) { std::cout << "kick " << item.track << std::endl; it = instruments.erase(it); continue; }
if (item.track == "drums") item.color = glutil::Color(0.1f, 0.1f, 0.1f);
|
|
From: Tapio V. <aa...@us...> - 2009-11-14 17:02:53
|
Module: performous
Branch: master
Commit: 6d70e2d3bb6bdc41e565a2f60042ed9f0a767f2e
Author: Tapio Vierros <tap...@gm...>
Date: Sat Nov 14 18:46:57 2009 +0200
Space exits the ScoreWindow (workaround for Enter issue with instruments).
---
game/screen_sing.cc | 1 +
1 files changed, 1 insertions(+), 0 deletions(-)
diff --git a/game/screen_sing.cc b/game/screen_sing.cc
index 0314037..e89bdd5 100644
--- a/game/screen_sing.cc
+++ b/game/screen_sing.cc
@@ -181,6 +181,7 @@ void ScreenSing::manageEvent(SDL_Event event) {
m_score_window.reset(new ScoreWindow(m_instruments, m_database)); // Song finished, but no score window -> show it
}
}
+ else if (key == SDLK_SPACE && m_score_window.get()) { activateNextScreen(); return; } // Score window visible -> Space quits
else if (key == SDLK_SPACE || key == SDLK_PAUSE) m_audio.togglePause();
if (m_score_window.get()) return;
// The rest are only available when score window is not displayed and when there are no instruments
|
|
From: Tapio V. <aa...@us...> - 2009-11-14 17:02:51
|
Module: performous
Branch: master
Commit: 0c7fdeb13c0c1a913175bdf396c3c9e2a01ad3e0
Author: Tapio Vierros <tap...@gm...>
Date: Sat Nov 14 18:40:35 2009 +0200
Hiscore database includes difficulty into the track-attribute.
---
game/database.hh | 8 +++-----
game/guitargraph.cc | 2 ++
game/guitargraph.hh | 1 +
game/screen_sing.cc | 9 ++++++---
4 files changed, 12 insertions(+), 8 deletions(-)
diff --git a/game/database.hh b/game/database.hh
index f23da1d..4463692 100644
--- a/game/database.hh
+++ b/game/database.hh
@@ -11,12 +11,10 @@
struct ScoreItem {
int score;
- std::string track;
+ std::string track; // includes difficulty
+ std::string track_simple; // no difficulty
glutil::Color color;
- bool operator < (ScoreItem const& other)
- {
- return score < other.score;
- }
+ bool operator < (ScoreItem const& other) { return score < other.score; }
};
/**Access to a database for performous which holds
diff --git a/game/guitargraph.cc b/game/guitargraph.cc
index e437130..60281c5 100644
--- a/game/guitargraph.cc
+++ b/game/guitargraph.cc
@@ -316,6 +316,8 @@ void GuitarGraph::nextTrack() {
updateNeck();
}
+std::string GuitarGraph::getDifficultyString() const { return diffv[m_level].name; }
+
void GuitarGraph::difficultyAuto(bool tryKeep) {
if (tryKeep && difficulty(Difficulty(m_level))) return;
for (int level = 0; level < DIFFICULTYCOUNT; ++level) if (difficulty(Difficulty(level))) return;
diff --git a/game/guitargraph.hh b/game/guitargraph.hh
index 9bd3517..8adaafc 100644
--- a/game/guitargraph.hh
+++ b/game/guitargraph.hh
@@ -60,6 +60,7 @@ class GuitarGraph {
std::string getTrackIndex() const { return m_track_index->first; }
int getScore() const { return m_score * m_scoreFactor; }
std::string getTrack() const { return m_track_index->first; }
+ std::string getDifficultyString() const;
private:
void fail(double time, int fret);
void endHold(int fret);
diff --git a/game/screen_sing.cc b/game/screen_sing.cc
index c068189..0314037 100644
--- a/game/screen_sing.cc
+++ b/game/screen_sing.cc
@@ -326,6 +326,7 @@ ScoreWindow::ScoreWindow(Instruments& instruments, Database& database):
ScoreItem item;
item.score = p->getScore();
item.track = "vocals";
+ item.track_simple = "vocals";
item.color = glutil::Color(p->m_color.r, p->m_color.g, p->m_color.b);
if (item.score < 500) { p = m_database.cur.erase(p); continue; }
@@ -334,12 +335,14 @@ ScoreWindow::ScoreWindow(Instruments& instruments, Database& database):
for (Instruments::iterator it = instruments.begin(); it != instruments.end(); ++it) {
ScoreItem item;
item.score = it->getScore();
- item.track = it->getTrack();
+ item.track_simple = it->getTrack();
+ item.track = it->getTrack() + "-" + it->getDifficultyString();
+ if (item.score < 500) { std::cout << "kick " << item.track << std::endl; it = instruments.erase(it); continue; }
+
if (item.track == "drums") item.color = glutil::Color(0.1f, 0.1f, 0.1f);
else if (item.track == "bass") item.color = glutil::Color(0.5f, 0.3f, 0.1f);
else item.color = glutil::Color(1.0f, 0.0f, 0.0f);
- if (item.score < 500) { std::cout << "kick " << item.track << std::endl; it = instruments.erase(it); continue; }
std::cout << "insert " << item.track << " score: " << item.score << std::endl;
m_database.scores.push_back(item);
}
@@ -384,7 +387,7 @@ void ScoreWindow::draw() {
m_score_text.render(boost::lexical_cast<std::string>(score));
m_score_text.dimensions().middle(x).top(0.24).fixedHeight(0.05);
m_score_text.draw();
- m_score_text.render(p->track);
+ m_score_text.render(p->track_simple);
m_score_text.dimensions().middle(x).top(0.20).fixedHeight(0.05);
m_score_text.draw();
glColor3f(1.0f, 1.0f, 1.0f);
|
|
From: Tapio V. <aa...@us...> - 2009-11-14 13:34:36
|
Module: performous
Branch: master
Commit: a7a728c5dba7d3439bf311438217fc15aa84f5fb
Author: Tapio Vierros <tap...@gm...>
Date: Sat Nov 14 15:31:26 2009 +0200
Improvements to ScoreWindow:
- Different colors for instruments
- Track name display above scores
- Different ranks for instruments
Also fixed guitargraph to correctly report track name.
---
game/guitargraph.cc | 1 -
game/guitargraph.hh | 3 +--
game/screen_sing.cc | 48 +++++++++++++++++++++++++++++-------------------
3 files changed, 30 insertions(+), 22 deletions(-)
diff --git a/game/guitargraph.cc b/game/guitargraph.cc
index 88d2bfd..e437130 100644
--- a/game/guitargraph.cc
+++ b/game/guitargraph.cc
@@ -46,7 +46,6 @@ namespace {
}
GuitarGraph::GuitarGraph(Audio& audio, Song const& song, std::string track):
- m_track(track),
m_audio(audio),
m_input(track=="drums" ? input::DRUMS : input::GUITAR),
m_song(song),
diff --git a/game/guitargraph.hh b/game/guitargraph.hh
index bcf9aa6..9bd3517 100644
--- a/game/guitargraph.hh
+++ b/game/guitargraph.hh
@@ -59,11 +59,10 @@ class GuitarGraph {
double correctness() const { return m_correctness.get(); }
std::string getTrackIndex() const { return m_track_index->first; }
int getScore() const { return m_score * m_scoreFactor; }
- std::string getTrack() const { return m_track; }
+ std::string getTrack() const { return m_track_index->first; }
private:
void fail(double time, int fret);
void endHold(int fret);
- std::string m_track;
Audio& m_audio;
input::InputDev m_input;
Song const& m_song;
diff --git a/game/screen_sing.cc b/game/screen_sing.cc
index 9dec6fd..c068189 100644
--- a/game/screen_sing.cc
+++ b/game/screen_sing.cc
@@ -321,10 +321,8 @@ ScoreWindow::ScoreWindow(Instruments& instruments, Database& database):
m_score_rank(getThemePath("score_rank.svg"))
{
m_pos.setTarget(0.0);
-
m_database.scores.clear();
- int topScore = 0;
- for (std::list<Player>::iterator p = m_database.cur.begin(); p != m_database.cur.end();) {
+ for (std::list<Player>::iterator p = m_database.cur.begin(); p != m_database.cur.end(); ++p) {
ScoreItem item;
item.score = p->getScore();
item.track = "vocals";
@@ -332,33 +330,42 @@ ScoreWindow::ScoreWindow(Instruments& instruments, Database& database):
if (item.score < 500) { p = m_database.cur.erase(p); continue; }
m_database.scores.push_back(item);
- if (item.score > topScore) topScore = item.score;
- ++p;
}
- for (Instruments::iterator it = instruments.begin(); it != instruments.end();) {
+ for (Instruments::iterator it = instruments.begin(); it != instruments.end(); ++it) {
ScoreItem item;
item.score = it->getScore();
item.track = it->getTrack();
-
+ if (item.track == "drums") item.color = glutil::Color(0.1f, 0.1f, 0.1f);
+ else if (item.track == "bass") item.color = glutil::Color(0.5f, 0.3f, 0.1f);
+ else item.color = glutil::Color(1.0f, 0.0f, 0.0f);
+
if (item.score < 500) { std::cout << "kick " << item.track << std::endl; it = instruments.erase(it); continue; }
std::cout << "insert " << item.track << " score: " << item.score << std::endl;
m_database.scores.push_back(item);
- // TODO: top score for best instrumental
- // if (item.score > topScore) topScore = item.score;
- ++it;
}
m_database.scores.sort();
m_database.scores.reverse(); // top should be first
- // topScore is also in m_database.scores.front()
- if (m_database.scores.empty()) m_rank = "No player!";
- else if (topScore > 8000) m_rank = "Hit singer";
- else if (topScore > 6000) m_rank = "Lead singer";
- else if (topScore > 4000) m_rank = "Rising star";
- else if (topScore > 2000) m_rank = "Amateur";
- else m_rank = "Tone deaf";
+ if (m_database.scores.empty())
+ m_rank = "No player!";
+ else {
+ int topScore = m_database.scores.front().score;
+ if (m_database.scores.front().track == "vocals") {
+ if (topScore > 8000) m_rank = "Hit singer";
+ else if (topScore > 6000) m_rank = "Lead singer";
+ else if (topScore > 4000) m_rank = "Rising star";
+ else if (topScore > 2000) m_rank = "Amateur";
+ else m_rank = "Tone deaf";
+ } else {
+ if (topScore > 8000) m_rank = "Virtuoso";
+ else if (topScore > 6000) m_rank = "Rocker";
+ else if (topScore > 4000) m_rank = "Rising star";
+ else if (topScore > 2000) m_rank = "Amateur";
+ else m_rank = "Tone deaf";
+ }
+ }
m_bg.dimensions.middle().center();
- m_scoreBar.dimensions.fixedWidth(0.1);
+ m_scoreBar.dimensions.fixedWidth(0.09);
}
void ScoreWindow::draw() {
@@ -372,11 +379,14 @@ void ScoreWindow::draw() {
int score = p->score;
glColor4fv(p->color);
double x = -0.12 + spacing * (0.5 + i - 0.5 * m_database.cur.size());
- m_scoreBar.dimensions.middle(x).bottom(0.24);
+ m_scoreBar.dimensions.middle(x).bottom(0.20);
m_scoreBar.draw(score / 10000.0);
m_score_text.render(boost::lexical_cast<std::string>(score));
m_score_text.dimensions().middle(x).top(0.24).fixedHeight(0.05);
m_score_text.draw();
+ m_score_text.render(p->track);
+ m_score_text.dimensions().middle(x).top(0.20).fixedHeight(0.05);
+ m_score_text.draw();
glColor3f(1.0f, 1.0f, 1.0f);
}
m_score_rank.draw(m_rank);
|
|
From: Tapio V. <aa...@us...> - 2009-11-14 07:57:52
|
Module: performous
Branch: dance
Commit: 39e00d7835b81b7709b2936ae30e5f9232548903
Author: Tapio Vierros <tap...@gm...>
Date: Sat Nov 14 09:56:07 2009 +0200
Removed some temporary hacks, readded a dancetrack for all songs (for testing).
---
game/screen_sing.cc | 14 ++++++--------
game/song.hh | 3 ---
2 files changed, 6 insertions(+), 11 deletions(-)
diff --git a/game/screen_sing.cc b/game/screen_sing.cc
index b6b1141..e4f29b3 100644
--- a/game/screen_sing.cc
+++ b/game/screen_sing.cc
@@ -84,15 +84,13 @@ void ScreenSing::enter() {
}
}
// Load dance tracks
+ m_dancers.push_back(new DanceGraph(m_audio, *m_song)); // REMOVEME
if ( !m_song->danceTracks.empty() ) {
- m_dancers.push_back(new DanceGraph(m_audio, *m_song));
- if (true) {
- while(true) {
- try {
- m_dancers.push_back(new DanceGraph(m_audio, *m_song));
- break; // REMOVEME
- } catch (std::runtime_error&) { break; }
- }
+ while(1) {
+ try {
+ m_dancers.push_back(new DanceGraph(m_audio, *m_song));
+ break; // REMOVEME
+ } catch (std::runtime_error&) { break; }
}
}
m_audio.playMusic(m_song->music, false, 0.0, m_instruments.empty() ? -1.0 : -8.0); // Startup delay for instruments is longer than for singing only
diff --git a/game/song.hh b/game/song.hh
index a35103d..deb42d7 100644
--- a/game/song.hh
+++ b/game/song.hh
@@ -41,9 +41,6 @@ class Song: boost::noncopyable {
Notes notes; ///< notes for song (only used for singing)
TrackMap track_map; ///< guitar etc. notes for this song
DanceTracks danceTracks; ///< dance tracks
- // TODO: TEMPORARY TO ALLOW COMPILING
- std::vector<std::map<int, Note> > d_notes; ///< dance notes
- // ^
typedef std::vector<double> Beats;
Beats beats;
int noteMin, ///< lowest note
|
|
From: Tapio V. <aa...@us...> - 2009-11-14 07:37:14
|
Module: performous
Branch: dance
Commit: 3c820258ad3d4a361ec4372ba2db1455c54d7d9d
Author: Tapio Vierros <tap...@gm...>
Date: Sat Nov 14 09:32:55 2009 +0200
A couple of fixes for the songparser to call sm-parser.
---
game/songparser-sm.cc | 7 ++++++-
game/songparser-txt.cc | 4 +++-
game/songparser.hh | 6 ++++--
3 files changed, 13 insertions(+), 4 deletions(-)
diff --git a/game/songparser-sm.cc b/game/songparser-sm.cc
index c501e57..3618bab 100644
--- a/game/songparser-sm.cc
+++ b/game/songparser-sm.cc
@@ -34,7 +34,12 @@ namespace {
-bool SongParser::smCheck(std::vector<char> const& data) { return data[0] == '#' && data[1] >= 'A' && data[1] <= 'Z' && data.back() == ';'; }
+bool SongParser::smCheck(std::vector<char> const& data) {
+ if (data[0] != '#' || data[1] < 'A' || data[1] > 'Z') return false;
+ for (std::vector<char>::const_iterator it = data.begin(); it != data.end(); ++it)
+ if (*it == ';') return true;
+ return false;
+}
void SongParser::smParse() {
Song& s = m_song;
diff --git a/game/songparser-txt.cc b/game/songparser-txt.cc
index 5204204..2b2fdb9 100644
--- a/game/songparser-txt.cc
+++ b/game/songparser-txt.cc
@@ -31,7 +31,9 @@ namespace {
}
}
-bool SongParser::txtCheck(std::vector<char> const& data) { return data[0] == '#' && data[1] >= 'A' && data[1] <= 'Z'; }
+bool SongParser::txtCheck(std::vector<char> const& data) {
+ return data[0] == '#' && data[1] >= 'A' && data[1] <= 'Z';
+}
void SongParser::txtParse() {
Song& s = m_song;
diff --git a/game/songparser.hh b/game/songparser.hh
index b95e93c..fdcd0c6 100644
--- a/game/songparser.hh
+++ b/game/songparser.hh
@@ -22,7 +22,7 @@ class SongParser {
m_relativeShift(),
m_maxScore()
{
- enum { NONE, TXT, INI } type = NONE;
+ enum { NONE, TXT, INI, SM } type = NONE;
// Read the file, determine the type and do some initial validation checks
{
std::ifstream f((s.path + s.filename).c_str());
@@ -33,7 +33,8 @@ class SongParser {
f.seekg(0);
std::vector<char> data(size);
if (!f.read(&data[0], size)) throw SongParserException("Unexpected I/O error", 0);
- if (txtCheck(data)) type = TXT;
+ if (smCheck(data)) type = SM;
+ else if (txtCheck(data)) type = TXT;
else if (iniCheck(data)) type = INI;
else throw SongParserException("Does not look like a song file (wrong header)", 1, true);
m_ss.write(&data[0], size);
@@ -42,6 +43,7 @@ class SongParser {
try {
if (type == TXT) txtParse();
if (type == INI) iniParse();
+ if (type == SM) smParse();
} catch (std::runtime_error& e) {
throw SongParserException(e.what(), m_linenum);
}
|
|
From: Jaakko N. <jni...@us...> - 2009-11-13 20:39:08
|
Module: performous
Branch: dance
Commit: a465f0994a3473a20826db3a7f23913f5d808462
Author: Jaakko Nikkola <jaa...@tk...>
Date: Fri Nov 13 22:37:58 2009 +0200
Now finds also files in format .sm
---
game/songs.cc | 2 +-
1 files changed, 1 insertions(+), 1 deletions(-)
diff --git a/game/songs.cc b/game/songs.cc
index f98ce87..f0a30c4 100644
--- a/game/songs.cc
+++ b/game/songs.cc
@@ -59,7 +59,7 @@ void Songs::reload_internal(fs::path const& parent) {
namespace fs = fs;
if (std::distance(parent.begin(), parent.end()) > 20) { std::cout << ">>> Not scanning: " << parent.string() << " (maximum depth reached, possibly due to cyclic symlinks)" << std::endl; return; }
try {
- boost::regex expression("(.*\\.txt|^song\\.ini)$", boost::regex_constants::icase);
+ boost::regex expression("(.*\\.txt|^song\\.ini|.*\\.sm)$", boost::regex_constants::icase);
boost::cmatch match;
for (fs::directory_iterator dirIt(parent), dirEnd; m_loading && dirIt != dirEnd; ++dirIt) {
fs::path p = dirIt->path();
|
|
From: Jaakko N. <jni...@us...> - 2009-11-13 20:39:08
|
Module: performous
Branch: dance
Commit: a3b90de1b56277defb82fa0db1b4b09fee76e9a3
Author: Jaakko Nikkola <jaa...@tk...>
Date: Fri Nov 13 18:23:06 2009 +0200
dance file check enabled (checks if DanceTracks container is empty)
---
game/screen_sing.cc | 17 +++++++++--------
1 files changed, 9 insertions(+), 8 deletions(-)
diff --git a/game/screen_sing.cc b/game/screen_sing.cc
index 24e9a11..b6b1141 100644
--- a/game/screen_sing.cc
+++ b/game/screen_sing.cc
@@ -84,14 +84,15 @@ void ScreenSing::enter() {
}
}
// Load dance tracks
- //if ( !m_song->danceTracks.empty() ) {
- m_dancers.push_back(new DanceGraph(m_audio, *m_song));
- if (true) {
- while(true) {
- try {
- m_dancers.push_back(new DanceGraph(m_audio, *m_song));
- break; // REMOVEME
- } catch (std::runtime_error&) { break; }
+ if ( !m_song->danceTracks.empty() ) {
+ m_dancers.push_back(new DanceGraph(m_audio, *m_song));
+ if (true) {
+ while(true) {
+ try {
+ m_dancers.push_back(new DanceGraph(m_audio, *m_song));
+ break; // REMOVEME
+ } catch (std::runtime_error&) { break; }
+ }
}
}
m_audio.playMusic(m_song->music, false, 0.0, m_instruments.empty() ? -1.0 : -8.0); // Startup delay for instruments is longer than for singing only
|
|
From: Markus R. <god...@us...> - 2009-11-13 16:10:23
|
Module: performous
Branch: master
Commit: 4a96b171395c8c5aa1004dc412cdfe0b244ef56f
Author: Markus Raab <un...@ma...>
Date: Fri Nov 13 17:09:31 2009 +0100
config path not hardcoded anymore
---
game/configuration.cc | 2 +-
game/fs.cc | 12 ++++++++++++
game/fs.hh | 3 +++
game/main.cc | 2 +-
4 files changed, 17 insertions(+), 2 deletions(-)
diff --git a/game/configuration.cc b/game/configuration.cc
index 19cee2c..26d41b6 100644
--- a/game/configuration.cc
+++ b/game/configuration.cc
@@ -201,7 +201,7 @@ void ConfigItem::update(xmlpp::Element& elem, int mode) {
}
fs::path systemConfFile = "/etc/xdg/performous/config.xml";
-fs::path userConfFile = getHomeDir() / ".config" / "performous" / "config.xml";
+fs::path userConfFile = getConfigDir() / "config.xml";
void writeConfig(bool system) {
xmlpp::Document doc;
diff --git a/game/fs.cc b/game/fs.cc
index e1ace89..090e47e 100644
--- a/game/fs.cc
+++ b/game/fs.cc
@@ -18,6 +18,18 @@ fs::path getHomeDir() {
return dir;
}
+fs::path getConfigDir() {
+ static fs::path dir;
+ static bool initialized = false;
+ if (!initialized) {
+ initialized = true;
+ char const* conf = getenv("XDG_CONFIG_HOME");
+ if (conf) dir = fs::path(conf) / "performous";
+ else dir = getHomeDir() / ".config" / "performous";
+ }
+ return dir;
+}
+
fs::path pathMangle(fs::path const& dir) {
fs::path ret;
for (fs::path::const_iterator it = dir.begin(); it != dir.end(); ++it) {
diff --git a/game/fs.hh b/game/fs.hh
index fd63e86..2756e8d 100644
--- a/game/fs.hh
+++ b/game/fs.hh
@@ -8,6 +8,9 @@ namespace fs = boost::filesystem;
/** Get user's home folder **/
fs::path getHomeDir();
+/** Get the users configuration folder **/
+fs::path getConfigDir();
+
/** Do mangling to convert user-entered path into path suitable for use with stdlib etc. **/
fs::path pathMangle(fs::path const& dir);
diff --git a/game/main.cc b/game/main.cc
index 677d634..dcfa16a 100644
--- a/game/main.cc
+++ b/game/main.cc
@@ -140,7 +140,7 @@ void mainLoop(std::string const& songlist) {
Audio audio;
audioSetup(capture, audio);
Backgrounds backgrounds;
- Database database(getHomeDir() / ".config" / "performous" / "database.xml");
+ Database database(getConfigDir() / "database.xml");
Songs songs(database, songlist);
ScreenManager sm;
Window window(config["graphic/window_width"].i(), config["graphic/window_height"].i(), config["graphic/fullscreen"].b());
|
|
From: Tapio V. <aa...@us...> - 2009-11-13 15:48:35
|
Module: performous
Branch: master
Commit: f054d79681581dfbe14138447a4bf8c31dded056
Author: Tapio Vierros <tap...@gm...>
Date: Fri Nov 13 17:47:48 2009 +0200
Preliminary support for displaying instruments in ScoreWindow.
---
game/database.hh | 3 ++-
game/glutil.hh | 2 +-
game/screen_sing.cc | 15 ++++++++-------
game/screen_sing.hh | 2 +-
4 files changed, 12 insertions(+), 10 deletions(-)
diff --git a/game/database.hh b/game/database.hh
index c1be3de..f23da1d 100644
--- a/game/database.hh
+++ b/game/database.hh
@@ -6,12 +6,13 @@
#include "players.hh"
#include "hiscore.hh"
#include "songitems.hh"
-
+#include "glutil.hh"
#include "fs.hh"
struct ScoreItem {
int score;
std::string track;
+ glutil::Color color;
bool operator < (ScoreItem const& other)
{
return score < other.score;
diff --git a/game/glutil.hh b/game/glutil.hh
index 94cc921..ad7f309 100644
--- a/game/glutil.hh
+++ b/game/glutil.hh
@@ -63,7 +63,7 @@ namespace glutil {
b, ///< blue
a; ///< alpha value
/// create nec Color object with given channels
- Color(float r_, float g_, float b_, float a_ = 1.0): r(r_), g(g_), b(b_), a(a_) {}
+ Color(float r_ = 0.0, float g_ = 0.0, float b_ = 0.0, float a_ = 1.0): r(r_), g(g_), b(b_), a(a_) {}
/// overload float cast
operator float*() { return reinterpret_cast<float*>(this); }
/// overload float const cast
diff --git a/game/screen_sing.cc b/game/screen_sing.cc
index 8cf0e6c..9dec6fd 100644
--- a/game/screen_sing.cc
+++ b/game/screen_sing.cc
@@ -8,7 +8,7 @@
#include "database.hh"
#include "video.hh"
#include "guitargraph.hh"
-
+#include "glutil.hh"
#include <boost/format.hpp>
#include <boost/lexical_cast.hpp>
@@ -328,7 +328,8 @@ ScoreWindow::ScoreWindow(Instruments& instruments, Database& database):
ScoreItem item;
item.score = p->getScore();
item.track = "vocals";
-
+ item.color = glutil::Color(p->m_color.r, p->m_color.g, p->m_color.b);
+
if (item.score < 500) { p = m_database.cur.erase(p); continue; }
m_database.scores.push_back(item);
if (item.score > topScore) topScore = item.score;
@@ -350,7 +351,7 @@ ScoreWindow::ScoreWindow(Instruments& instruments, Database& database):
m_database.scores.reverse(); // top should be first
// topScore is also in m_database.scores.front()
- if (m_database.cur.empty()) m_rank = "No singer!";
+ if (m_database.scores.empty()) m_rank = "No player!";
else if (topScore > 8000) m_rank = "Hit singer";
else if (topScore > 6000) m_rank = "Lead singer";
else if (topScore > 4000) m_rank = "Rising star";
@@ -364,12 +365,12 @@ void ScoreWindow::draw() {
glutil::PushMatrix block;
glTranslatef(0.0, m_pos.get(), 0.0);
m_bg.draw();
- const double spacing = 0.1 + 0.1 / m_database.cur.size();
+ const double spacing = 0.1 + 0.1 / m_database.scores.size();
unsigned i = 0;
- for (std::list<Player>::const_iterator p = m_database.cur.begin(); p != m_database.cur.end(); ++p, ++i) {
- int score = p->getScore();
- glColor3f(p->m_color.r, p->m_color.g, p->m_color.b);
+ for (Database::cur_scores_t::const_iterator p = m_database.scores.begin(); p != m_database.scores.end(); ++p, ++i) {
+ int score = p->score;
+ glColor4fv(p->color);
double x = -0.12 + spacing * (0.5 + i - 0.5 * m_database.cur.size());
m_scoreBar.dimensions.middle(x).bottom(0.24);
m_scoreBar.draw(score / 10000.0);
diff --git a/game/screen_sing.hh b/game/screen_sing.hh
index 8663473..56b73aa 100644
--- a/game/screen_sing.hh
+++ b/game/screen_sing.hh
@@ -31,7 +31,7 @@ class ScoreWindow {
ScoreWindow(Instruments& instruments, Database& database);
/// draws ScoreWindow
void draw();
- bool empty() { return m_database.cur.empty(); }
+ bool empty() { return m_database.scores.empty(); }
private:
Database& m_database;
AnimValue m_pos;
|
|
From: Jaakko N. <jni...@us...> - 2009-11-13 15:00:20
|
Module: performous
Branch: dance
Commit: 47b49b4349c32e6b4cbc50298a9f3518e28006df
Author: Jaakko Nikkola <jaa...@tk...>
Date: Fri Nov 13 16:59:12 2009 +0200
minor fix...
---
game/songparser-sm.cc | 2 +-
1 files changed, 1 insertions(+), 1 deletions(-)
diff --git a/game/songparser-sm.cc b/game/songparser-sm.cc
index b6f0d8d..c501e57 100644
--- a/game/songparser-sm.cc
+++ b/game/songparser-sm.cc
@@ -145,7 +145,7 @@ bool SongParser::smParseNote(std::string line, DanceChords chords){
for(int j = count - lcount; j<count ; j++) {
for(int i = 0; i<4; i++) {
DanceChord _chord = chords.at(j);
- if(_chord[i] != _chord.end()) {
+ if(_chord.find(i) != _chord.end()) {
_chord[i].begin = tm;
_chord[i].end = tm;
}
|
|
From: Markus R. <god...@us...> - 2009-11-13 14:47:23
|
Module: performous Branch: master Commit: 701c2265ba1ca2ae42213f1f4fbb6b88e5c0e7fa Author: Markus Raab <un...@ma...> Date: Fri Nov 13 15:47:01 2009 +0100 Merge branch 'master' of ssh://godman707@git.performous.org/gitroot/performous/performous Conflicts: game/screen_sing.cc --- |
|
From: Markus R. <god...@us...> - 2009-11-13 14:47:22
|
Module: performous
Branch: master
Commit: 945dbb55def4101b95d3ea3c8acd50a10af0e9ed
Author: Markus Raab <un...@ma...>
Date: Fri Nov 13 15:37:34 2009 +0100
hiscore for instruments
added some info output
getTrack in GuitarGraph added
kill the engine outside of score window
---
game/database.cc | 10 ++++++----
game/database.hh | 11 ++++++++++-
game/guitargraph.cc | 1 +
game/guitargraph.hh | 2 ++
game/screen_players.cc | 2 +-
game/screen_sing.cc | 41 +++++++++++++++++++++++++++++++----------
game/screen_sing.hh | 5 +++--
7 files changed, 54 insertions(+), 18 deletions(-)
diff --git a/game/database.cc b/game/database.cc
index aa6c871..c53a57d 100644
--- a/game/database.cc
+++ b/game/database.cc
@@ -71,17 +71,19 @@ void Database::addSong (boost::shared_ptr<Song> s) {
void Database::addHiscore (boost::shared_ptr<Song> s) {
int playerid = m_players.lookup(m_players.current().name);
- int score = scores.front();
+ int score = scores.front().score;
+ std::string track = scores.front().track;
int songid = m_songs.lookup(s);
- m_hiscores.addHiscore(score, playerid, songid);
+ m_hiscores.addHiscore(score, playerid, songid, track);
}
bool Database::reachedHiscore (boost::shared_ptr<Song> s) const {
- int score = scores.front();
+ int score = scores.front().score;
+ std::string track = scores.front().track;
int songid = m_songs.lookup(s);
- return m_hiscores.reachedHiscore(score, songid);
+ return m_hiscores.reachedHiscore(score, songid, track);
}
void Database::queryOverallHiscore (std::ostream & os, std::string const& track) const {
diff --git a/game/database.hh b/game/database.hh
index 00af889..c1be3de 100644
--- a/game/database.hh
+++ b/game/database.hh
@@ -9,6 +9,15 @@
#include "fs.hh"
+struct ScoreItem {
+ int score;
+ std::string track;
+ bool operator < (ScoreItem const& other)
+ {
+ return score < other.score;
+ }
+};
+
/**Access to a database for performous which holds
Player-, Hiscore-, Song-, Track- and (in future)
Partydata.
@@ -64,7 +73,7 @@ class Database
friend class Engine;
private: // will be bypassed by above friend declaration
typedef std::list<Player> cur_players_t;
- typedef std::list<int> cur_scores_t;
+ typedef std::list<ScoreItem> cur_scores_t;
//This fields are misused as additional parameters
cur_players_t cur;
diff --git a/game/guitargraph.cc b/game/guitargraph.cc
index e437130..88d2bfd 100644
--- a/game/guitargraph.cc
+++ b/game/guitargraph.cc
@@ -46,6 +46,7 @@ namespace {
}
GuitarGraph::GuitarGraph(Audio& audio, Song const& song, std::string track):
+ m_track(track),
m_audio(audio),
m_input(track=="drums" ? input::DRUMS : input::GUITAR),
m_song(song),
diff --git a/game/guitargraph.hh b/game/guitargraph.hh
index 44d12fd..bcf9aa6 100644
--- a/game/guitargraph.hh
+++ b/game/guitargraph.hh
@@ -59,9 +59,11 @@ class GuitarGraph {
double correctness() const { return m_correctness.get(); }
std::string getTrackIndex() const { return m_track_index->first; }
int getScore() const { return m_score * m_scoreFactor; }
+ std::string getTrack() const { return m_track; }
private:
void fail(double time, int fret);
void endHold(int fret);
+ std::string m_track;
Audio& m_audio;
input::InputDev m_input;
Song const& m_song;
diff --git a/game/screen_players.cc b/game/screen_players.cc
index 48115aa..afb6e3b 100644
--- a/game/screen_players.cc
+++ b/game/screen_players.cc
@@ -115,7 +115,7 @@ void ScreenPlayers::draw() {
}
} else {
// Format the player information text
- oss_song << "You reached " << m_database.scores.front() << " points!\n";
+ oss_song << "You reached " << m_database.scores.front().score << " points!\n";
oss_order << "Please enter your Name!\n"
<< "Name: " << m_players.current().name << '\n'
<< "Search Text: "
diff --git a/game/screen_sing.cc b/game/screen_sing.cc
index 5f51a8f..9736314 100644
--- a/game/screen_sing.cc
+++ b/game/screen_sing.cc
@@ -92,7 +92,10 @@ void ScreenSing::enter() {
void ScreenSing::instrumentLayout(double time) {
for (Instruments::iterator it = m_instruments.begin(); it != m_instruments.end();) {
- if (it->dead(time)) it = m_instruments.erase(it); else ++it;
+ if (it->dead(time)) {
+ std::cout << it->getTrack() << " was thrown out after " << time << " inactive" << std::endl;
+ it = m_instruments.erase(it);
+ } else ++it;
}
double iw = std::min(0.5, 1.0 / m_instruments.size());
for (Instruments::size_type i = 0, s = m_instruments.size(); i < s; ++i) {
@@ -173,7 +176,10 @@ void ScreenSing::manageEvent(SDL_Event event) {
}
else if (key == SDLK_RETURN) {
if (m_score_window.get()) { activateNextScreen(); return; } // Score window visible -> Enter quits
- else if (status == Song::FINISHED) m_score_window.reset(new ScoreWindow(*m_engine, m_database)); // Song finished, but no score window -> show it
+ else if (status == Song::FINISHED) {
+ m_engine->kill(); // kill the engine thread (to avoid consuming memory)
+ m_score_window.reset(new ScoreWindow(m_instruments, m_database)); // Song finished, but no score window -> show it
+ }
}
else if (key == SDLK_SPACE || key == SDLK_PAUSE) m_audio.togglePause();
if (m_score_window.get()) return;
@@ -295,7 +301,8 @@ void ScreenSing::draw() {
else if (!m_audio.isPlaying() || (status == Song::FINISHED && m_audio.getLength() - time < 3.0)) {
// Time to create the score window
m_quitTimer.setValue(QUIT_TIMEOUT);
- m_score_window.reset(new ScoreWindow(*m_engine, m_database));
+ m_engine->kill(); // kill the engine thread (to avoid consuming memory)
+ m_score_window.reset(new ScoreWindow(m_instruments, m_database));
}
}
@@ -305,7 +312,7 @@ void ScreenSing::draw() {
}
}
-ScoreWindow::ScoreWindow(Engine& e, Database& database):
+ScoreWindow::ScoreWindow(Instruments& instruments, Database& database):
m_database(database),
m_pos(0.8, 2.0),
m_bg(getThemePath("score_window.svg")),
@@ -314,17 +321,31 @@ ScoreWindow::ScoreWindow(Engine& e, Database& database):
m_score_rank(getThemePath("score_rank.svg"))
{
m_pos.setTarget(0.0);
- e.kill(); // kill the engine thread (to avoid consuming memory)
m_database.scores.clear();
- unsigned int topScore = 0;
+ int topScore = 0;
for (std::list<Player>::iterator p = m_database.cur.begin(); p != m_database.cur.end();) {
- unsigned int score = p->getScore();
- if (score < 500) { p = m_database.cur.erase(p); continue; }
- m_database.scores.push_back(score);
- if (score > topScore) topScore = score;
+ ScoreItem item;
+ item.score = p->getScore();
+ item.track = "vocals";
+
+ if (item.score < 500) { p = m_database.cur.erase(p); continue; }
+ m_database.scores.push_back(item);
+ if (item.score > topScore) topScore = item.score;
++p;
}
+ for (Instruments::iterator it = instruments.begin(); it != instruments.end();) {
+ ScoreItem item;
+ item.score = it->getScore();
+ item.track = it->getTrack();
+
+ if (item.score < 500) { std::cout << "kick " << item.track << std::endl; it = instruments.erase(it); continue; }
+ std::cout << "insert " << item.track << " score: " << item.score << std::endl;
+ m_database.scores.push_back(item);
+ // TODO: top score for best instrumental
+ // if (item.score > topScore) topScore = item.score;
+ ++it;
+ }
m_database.scores.sort();
m_database.scores.reverse(); // top should be first
// topScore is also in m_database.scores.front()
diff --git a/game/screen_sing.hh b/game/screen_sing.hh
index 10a8095..8663473 100644
--- a/game/screen_sing.hh
+++ b/game/screen_sing.hh
@@ -22,11 +22,13 @@ class Capture;
class Database;
class Video;
+typedef boost::ptr_vector<GuitarGraph> Instruments;
+
/// shows score at end of song
class ScoreWindow {
public:
/// constructor
- ScoreWindow(Engine & e, Database& database);
+ ScoreWindow(Instruments& instruments, Database& database);
/// draws ScoreWindow
void draw();
bool empty() { return m_database.cur.empty(); }
@@ -79,7 +81,6 @@ class ScreenSing: public Screen {
boost::scoped_ptr<Surface> m_help;
boost::scoped_ptr<Engine> m_engine;
boost::scoped_ptr<LayoutSinger> m_layout_singer;
- typedef boost::ptr_vector<GuitarGraph> Instruments;
Instruments m_instruments;
double m_latencyAV; // Latency between audio and video output (do not confuse with latencyAR)
boost::shared_ptr<ThemeSing> theme;
|
|
From: Jaakko N. <jni...@us...> - 2009-11-13 13:41:46
|
Module: performous Branch: dance Commit: d5e6f7058e14b18809379b1085c35f58ba5a22ad Author: Jaakko Nikkola <jaa...@tk...> Date: Fri Nov 13 15:40:53 2009 +0200 Merge branch 'dance' of jni...@gi...:/gitroot/performous/performous into dance --- |
|
From: Jaakko N. <jni...@us...> - 2009-11-13 13:41:45
|
Module: performous
Branch: dance
Commit: f818691cc5fff5ac26fa905d37138821838636d0
Author: Jaakko Nikkola <jaa...@tk...>
Date: Fri Nov 13 15:38:04 2009 +0200
Remaining compile problems fixed, parser is now ready to be tested.
---
game/songparser-sm.cc | 12 +++++++-----
1 files changed, 7 insertions(+), 5 deletions(-)
diff --git a/game/songparser-sm.cc b/game/songparser-sm.cc
index 441edd8..b6f0d8d 100644
--- a/game/songparser-sm.cc
+++ b/game/songparser-sm.cc
@@ -91,8 +91,8 @@ bool SongParser::smParseField(std::string line) {
while (getline(line) && smParseNote(line, chords)) {}
DanceTrack danceTrack(description, chords);
-// danceDifficultyMap[danceDifficulty] = danceTrack;
-// m_song.danceTracks[notestype] = danceDifficultyMap;
+ danceDifficultyMap.insert(std::make_pair(danceDifficulty, danceTrack));
+ m_song.danceTracks.insert(std::make_pair(notestype, danceDifficultyMap));
return true;
}
@@ -144,9 +144,11 @@ 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;
-
+ DanceChord _chord = chords.at(j);
+ if(_chord[i] != _chord.end()) {
+ _chord[i].begin = tm;
+ _chord[i].end = tm;
+ }
}
tm += dur;
}
|
|
From: Tapio V. <aa...@us...> - 2009-11-13 13:27:50
|
Module: performous
Branch: master
Commit: 966da19ec32ee48627d5a8836ba11d45e191931e
Author: Tapio Vierros <tap...@gm...>
Date: Fri Nov 13 15:27:07 2009 +0200
Fix for score window displaying too early with instruments.
---
game/screen_sing.cc | 2 +-
1 files changed, 1 insertions(+), 1 deletions(-)
diff --git a/game/screen_sing.cc b/game/screen_sing.cc
index 5f51a8f..3f52660 100644
--- a/game/screen_sing.cc
+++ b/game/screen_sing.cc
@@ -173,7 +173,7 @@ void ScreenSing::manageEvent(SDL_Event event) {
}
else if (key == SDLK_RETURN) {
if (m_score_window.get()) { activateNextScreen(); return; } // Score window visible -> Enter quits
- else if (status == Song::FINISHED) m_score_window.reset(new ScoreWindow(*m_engine, m_database)); // Song finished, but no score window -> show it
+ else if (status == Song::FINISHED && m_song->track_map.empty()) m_score_window.reset(new ScoreWindow(*m_engine, m_database)); // Song finished, but no score window -> show it
}
else if (key == SDLK_SPACE || key == SDLK_PAUSE) m_audio.togglePause();
if (m_score_window.get()) return;
|
|
From: Tapio V. <aa...@us...> - 2009-11-13 13:09:07
|
Module: performous
Branch: master
Commit: 0548b3378009d7c1213828740edf3939f2314491
Author: Tapio Vierros <tap...@gm...>
Date: Fri Nov 13 15:08:21 2009 +0200
Display score_window for FoF songs also.
---
game/screen_sing.cc | 2 +-
1 files changed, 1 insertions(+), 1 deletions(-)
diff --git a/game/screen_sing.cc b/game/screen_sing.cc
index 4c9d681..5f51a8f 100644
--- a/game/screen_sing.cc
+++ b/game/screen_sing.cc
@@ -276,7 +276,7 @@ void ScreenSing::draw() {
theme->timer.draw(statustxt);
}
- if (config["game/karaoke_mode"].b() || !m_song->track_map.empty()) {
+ if (config["game/karaoke_mode"].b()) {
if (!m_audio.isPlaying()) {
ScreenManager* sm = ScreenManager::getSingletonPtr();
sm->activateScreen("Songs");
|
|
From: Lasse Kärkkäi. <tr...@us...> - 2009-11-13 12:05:24
|
Module: performous
Branch: dance
Commit: 55411a50a24435e95e5d6c6202c87e0617195425
Author: Lasse Karkkainen <tro...@tr...>
Date: Fri Nov 13 14:05:39 2009 +0200
Missing include
---
game/dancegraph.cc | 3 ++-
1 files changed, 2 insertions(+), 1 deletions(-)
diff --git a/game/dancegraph.cc b/game/dancegraph.cc
index a335950..c93eabc 100644
--- a/game/dancegraph.cc
+++ b/game/dancegraph.cc
@@ -1,6 +1,7 @@
#include "dancegraph.hh"
-#include "fs.hh"
+#include "fs.hh"
+#include <boost/lexical_cast.hpp>
namespace {
const float past = -0.2f;
|
|
From: Tapio V. <aa...@us...> - 2009-11-13 12:00:42
|
Module: performous
Branch: dance
Commit: 93be5f69274393fa8e0f9d74301b4a0dcc3e0662
Author: Tapio Vierros <tap...@gm...>
Date: Fri Nov 13 13:59:10 2009 +0200
Improved arrow image.
---
themes/default/arrow.svg | 50 ++++++++++++---------------------------------
1 files changed, 14 insertions(+), 36 deletions(-)
diff --git a/themes/default/arrow.svg b/themes/default/arrow.svg
index 64219ca..d97daf7 100644
--- a/themes/default/arrow.svg
+++ b/themes/default/arrow.svg
@@ -9,8 +9,8 @@
xmlns="http://www.w3.org/2000/svg"
xmlns:sodipodi="http://sodipodi.sourceforge.net/DTD/sodipodi-0.dtd"
xmlns:inkscape="http://www.inkscape.org/namespaces/inkscape"
- width="109.22793"
- height="125.19736"
+ width="64"
+ height="64"
id="svg1901"
sodipodi:version="0.32"
inkscape:version="0.47pre4 r22446"
@@ -47,14 +47,14 @@
borderopacity="1.0"
inkscape:pageopacity="0.0"
inkscape:pageshadow="2"
- inkscape:zoom="1.979899"
- inkscape:cx="131.20005"
- inkscape:cy="16.74754"
+ inkscape:zoom="11.2"
+ inkscape:cx="37.272172"
+ inkscape:cy="43.096772"
inkscape:document-units="px"
inkscape:current-layer="layer1"
- inkscape:window-width="789"
+ inkscape:window-width="980"
inkscape:window-height="826"
- inkscape:window-x="634"
+ inkscape:window-x="198"
inkscape:window-y="22"
showgrid="false"
inkscape:window-maximized="0" />
@@ -66,7 +66,7 @@
<dc:format>image/svg+xml</dc:format>
<dc:type
rdf:resource="http://purl.org/dc/dcmitype/StillImage" />
- <dc:title></dc:title>
+ <dc:title />
</cc:Work>
</rdf:RDF>
</metadata>
@@ -74,34 +74,12 @@
inkscape:label="Taso 1"
inkscape:groupmode="layer"
id="layer1"
- transform="translate(-160.26987,-378.39184)">
- <rect
- style="opacity:0.9;fill:#ffffff;fill-opacity:1;fill-rule:nonzero;stroke:#000000;stroke-width:1.22426020999999996;stroke-miterlimit:4;stroke-opacity:1;stroke-dasharray:none"
+ transform="translate(-160.26987,-439.5892)">
+ <path
+ style="opacity:0.9;fill:#ffffff;fill-opacity:1;fill-rule:nonzero;stroke:#000000;stroke-width:0.62583303;stroke-miterlimit:4;stroke-opacity:1"
+ d="M 31.647321,0.3125 C 29.265439,0.77669743 27.734704,2.7549284 26.5,3.875 L 5.1875,25.03125 c -1.4695138,1.458652 -0.8381353,4.457652 1.40625,6.71875 2.2443853,2.261098 5.217986,2.896152 6.6875,1.4375 L 25.9375,20.625 l 0,37.3125 c 0,3.14684 2.54066,5.6875 5.6875,5.6875 3.14683,0 5.6875,-2.54066 5.6875,-5.6875 l 0,-37.28125 L 50.6875,34 c 1.465618,1.462566 4.468342,0.817604 6.71875,-1.4375 2.250408,-2.255104 2.871868,-5.256184 1.40625,-6.71875 L 36.933036,3.9375 C 34.961269,1.8469735 34.170182,0.6936683 31.647321,0.3125 z"
+ transform="translate(160.26987,439.5892)"
id="rect2823-7"
- width="22.499096"
- height="81.087944"
- x="417.73743"
- y="111.99822"
- ry="7.3112082"
- transform="matrix(0.70447892,0.70972491,-0.70972491,0.70447892,0,0)"
- rx="11.249548" />
- <rect
- style="opacity:0.9;fill:#ffffff;fill-opacity:1;fill-rule:nonzero;stroke:#000000;stroke-width:1.22426020999999996;stroke-miterlimit:4;stroke-opacity:1;stroke-dasharray:none"
- id="rect2823-7-0"
- width="22.499096"
- height="81.087944"
- x="-137.28905"
- y="418.45737"
- ry="7.3112082"
- transform="matrix(0.70636938,-0.70784341,0.70784341,0.70636938,0,0)"
- rx="11.249548" />
- <rect
- style="opacity:1;fill:#ffffff;fill-opacity:1;fill-rule:nonzero;stroke:#000000;stroke-width:1.50000000000000000;stroke-miterlimit:4;stroke-opacity:1;stroke-dasharray:none"
- id="rect2823"
- width="22.223356"
- height="123.23861"
- x="203.04066"
- y="379.60059"
- ry="11.111678" />
+ sodipodi:nodetypes="cccscccscccsccc" />
</g>
</svg>
|
|
From: Tapio V. <aa...@us...> - 2009-11-13 12:00:41
|
Module: performous
Branch: dance
Commit: 161133a4db0c81007b044fe3f609c6d4eacc5c38
Author: Tapio Vierros <tap...@gm...>
Date: Fri Nov 13 13:46:35 2009 +0200
Some code to display dance icon in song browser.
---
game/screen_songs.cc | 67 ++++++++++++++++++++++++++++++++-----------------
1 files changed, 44 insertions(+), 23 deletions(-)
diff --git a/game/screen_songs.cc b/game/screen_songs.cc
index 7c0e6de..adf997e 100644
--- a/game/screen_songs.cc
+++ b/game/screen_songs.cc
@@ -167,6 +167,13 @@ void ScreenSongs::drawJukebox() {
}
}
+namespace {
+ float getIconTex(int i) {
+ static int iconcount = 8;
+ return (i-1)/float(iconcount);
+ }
+}
+
void ScreenSongs::draw() {
m_songs.update(); // Poll for new songs
double length = m_audio.getLength();
@@ -227,6 +234,7 @@ void ScreenSongs::draw() {
Dimensions dim = Dimensions(m_instrumentList->ar()).middle(-0.2 + 0.17 * (i - shift)).bottom(y - (0.14+diff) - 0.2 * diff).fitInside(0.14 + diff, 0.14 + diff);
double x;
float alpha;
+ float xincr = 0.2f;
{
// vocals
alpha = (song_display.notes.size()) ? 1.00 : 0.25;
@@ -238,11 +246,11 @@ void ScreenSongs::draw() {
glColor4f(1.0, 1.0, 1.0, alpha);
}
x = dim.x1()+0.00*(dim.x2()-dim.x1());
- glTexCoord2f(0.00f, 0.0f); glVertex2f(x, dim.y1());
- glTexCoord2f(0.00f, 1.0f); glVertex2f(x, dim.y2());
- x = dim.x1()+0.25*(dim.x2()-dim.x1());
- glTexCoord2f(0.25f, 0.0f); glVertex2f(x, dim.y1());
- glTexCoord2f(0.25f, 1.0f); glVertex2f(x, dim.y2());
+ glTexCoord2f(getIconTex(1), 0.0f); glVertex2f(x, dim.y1());
+ glTexCoord2f(getIconTex(1), 1.0f); glVertex2f(x, dim.y2());
+ x = dim.x1()+xincr*(dim.x2()-dim.x1());
+ glTexCoord2f(getIconTex(2), 0.0f); glVertex2f(x, dim.y1());
+ glTexCoord2f(getIconTex(2), 1.0f); glVertex2f(x, dim.y2());
}
{
// guitars
@@ -255,12 +263,12 @@ void ScreenSongs::draw() {
for (int i = guitarCount-1; i >= 0; i--) {
glutil::Begin block(GL_TRIANGLE_STRIP);
glColor4f(1.0, 1.0, 1.0, alpha);
- x = dim.x1()+(0.25+i*0.04)*(dim.x2()-dim.x1());
- glTexCoord2f(0.25f, 0.0f); glVertex2f(x, dim.y1());
- glTexCoord2f(0.25f, 1.0f); glVertex2f(x, dim.y2());
- x = dim.x1()+(0.50+i*0.04)*(dim.x2()-dim.x1());
- glTexCoord2f(0.50f, 0.0f); glVertex2f(x, dim.y1());
- glTexCoord2f(0.50f, 1.0f); glVertex2f(x, dim.y2());
+ x = dim.x1()+(xincr+i*0.04)*(dim.x2()-dim.x1());
+ glTexCoord2f(getIconTex(2), 0.0f); glVertex2f(x, dim.y1());
+ glTexCoord2f(getIconTex(2), 1.0f); glVertex2f(x, dim.y2());
+ x = dim.x1()+(2*xincr+i*0.04)*(dim.x2()-dim.x1());
+ glTexCoord2f(getIconTex(3), 0.0f); glVertex2f(x, dim.y1());
+ glTexCoord2f(getIconTex(3), 1.0f); glVertex2f(x, dim.y2());
}
}
{
@@ -268,24 +276,37 @@ void ScreenSongs::draw() {
alpha = (isTrackInside(song_display.track_map,"bass")) ? 1.00 : 0.25;
glutil::Begin block(GL_TRIANGLE_STRIP);
glColor4f(1.0, 1.0, 1.0, alpha);
- x = dim.x1()+0.50*(dim.x2()-dim.x1());
- glTexCoord2f(0.50f, 0.0f); glVertex2f(x, dim.y1());
- glTexCoord2f(0.50f, 1.0f); glVertex2f(x, dim.y2());
- x = dim.x1()+0.75*(dim.x2()-dim.x1());
- glTexCoord2f(0.75f, 0.0f); glVertex2f(x, dim.y1());
- glTexCoord2f(0.75f, 1.0f); glVertex2f(x, dim.y2());
+ x = dim.x1()+2*xincr*(dim.x2()-dim.x1());
+ glTexCoord2f(getIconTex(3), 0.0f); glVertex2f(x, dim.y1());
+ glTexCoord2f(getIconTex(3), 1.0f); glVertex2f(x, dim.y2());
+ x = dim.x1()+3*xincr*(dim.x2()-dim.x1());
+ glTexCoord2f(getIconTex(4), 0.0f); glVertex2f(x, dim.y1());
+ glTexCoord2f(getIconTex(4), 1.0f); glVertex2f(x, dim.y2());
}
{
// drums
alpha = (isTrackInside(song_display.track_map,"drums")) ? 1.00 : 0.25;
glutil::Begin block(GL_TRIANGLE_STRIP);
glColor4f(1.0, 1.0, 1.0, alpha);
- x = dim.x1()+0.75*(dim.x2()-dim.x1());
- glTexCoord2f(0.75f, 0.0f); glVertex2f(x, dim.y1());
- glTexCoord2f(0.75f, 1.0f); glVertex2f(x, dim.y2());
- x = dim.x1()+1.00*(dim.x2()-dim.x1());
- glTexCoord2f(1.00f, 0.0f); glVertex2f(x, dim.y1());
- glTexCoord2f(1.00f, 1.0f); glVertex2f(x, dim.y2());
+ x = dim.x1()+3*xincr*(dim.x2()-dim.x1());
+ glTexCoord2f(getIconTex(4), 0.0f); glVertex2f(x, dim.y1());
+ glTexCoord2f(getIconTex(4), 1.0f); glVertex2f(x, dim.y2());
+ x = dim.x1()+4*xincr*(dim.x2()-dim.x1());
+ glTexCoord2f(getIconTex(5), 0.0f); glVertex2f(x, dim.y1());
+ glTexCoord2f(getIconTex(5), 1.0f); glVertex2f(x, dim.y2());
+ }
+ {
+ // dancing
+ // TODO: test for dance track
+ alpha = 0.25;
+ glutil::Begin block(GL_TRIANGLE_STRIP);
+ glColor4f(1.0, 1.0, 1.0, alpha);
+ x = dim.x1()+4*xincr*(dim.x2()-dim.x1());
+ glTexCoord2f(getIconTex(5), 0.0f); glVertex2f(x, dim.y1());
+ glTexCoord2f(getIconTex(5), 1.0f); glVertex2f(x, dim.y2());
+ x = dim.x1()+5*xincr*(dim.x2()-dim.x1());
+ glTexCoord2f(getIconTex(6), 0.0f); glVertex2f(x, dim.y1());
+ glTexCoord2f(getIconTex(6), 1.0f); glVertex2f(x, dim.y2());
}
glColor4f(1.0, 1.0, 1.0, 1.0);
}
|
|
From: Tapio V. <aa...@us...> - 2009-11-13 12:00:39
|
Module: performous Branch: dance Commit: 841c66e1a15da1d4e39d0b9d7806d5bd64703832 Author: Tapio Vierros <tap...@gm...> Date: Fri Nov 13 13:22:50 2009 +0200 Horrible dancer icon added. --- themes/default/instruments.svg | 59 ++++++++++++++++++++++++++++----------- 1 files changed, 42 insertions(+), 17 deletions(-) |
|
From: Markus R. <god...@us...> - 2009-11-13 11:59:21
|
Module: performous Branch: master Commit: 9fa64e99f097760c45e47167fb6eb0719066d45f Author: Markus Raab <un...@ma...> Date: Fri Nov 13 12:56:37 2009 +0100 share code between screen hiscore and songs inherit from ScreenSongs 3 methods for common drawing behaviour make a common baseclass would be better? --- game/main.cc | 2 +- game/screen_hiscore.cc | 95 ++++++++---------------------------------------- game/screen_hiscore.hh | 22 ++++-------- game/screen_songs.cc | 48 +++++++++++++++--------- game/screen_songs.hh | 15 +++++++- 5 files changed, 67 insertions(+), 115 deletions(-) |