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: Tapio V. <aa...@us...> - 2009-11-15 10:16:33
|
Module: performous Branch: master Commit: 985d158c19a64467357219c926787812f42a48d1 Author: Tapio Vierros <tap...@gm...> Date: Sun Nov 15 12:08:03 2009 +0200 Changed the default image for players. --- game/screen_players.cc | 2 +- themes/default/no_player_image.svg | 131 ++++++++++++++++++++++++++++++++++++ 2 files changed, 132 insertions(+), 1 deletions(-) |
|
From: Lasse Kärkkäi. <tr...@us...> - 2009-11-14 18:45:29
|
Module: performous Branch: dance Commit: 5057b438e594ae40149ad65a683f2951681bccc0 Author: Lasse Karkkainen <tro...@tr...> Date: Sat Nov 14 20:41:29 2009 +0200 Merge branch 'master' into dance A difficult merge due to major changes in master. Seems to be working fine, but be prepared for strange automerge results. Conflicts: game/screen_sing.hh game/screen_songs.cc --- |
|
From: Lasse Kärkkäi. <tr...@us...> - 2009-11-14 18:45:28
|
Module: performous Branch: dance Commit: 839f4c1a6f7c3ab7114216bf1cd1434a16de320b Author: Lasse Karkkainen <tro...@tr...> Date: Sat Nov 14 20:25:22 2009 +0200 Update Packaging.txt --- docs/Packaging.txt | 7 +------ 1 files changed, 1 insertions(+), 6 deletions(-) diff --git a/docs/Packaging.txt b/docs/Packaging.txt index 0710c07..651f816 100644 --- a/docs/Packaging.txt +++ b/docs/Packaging.txt @@ -5,7 +5,7 @@ cmake/performous-packaging.cmake. Source packages: -- Remove any extra files in source tree (the ones from SVN and build folder can be kept) +- Remove any extra files in source tree (the ones from Git and an the build folder can be kept) cmake ../ make package_source @@ -18,8 +18,3 @@ Binary packages: cmake ../ make package - -Ubuntu 8.04 needs special care: -- CMake 2.4 cannot package for Debian, so install 2.6 from backports -- Be sure not to install anything else from backports if you intend plain 8.04 package - |
|
From: Lasse Kärkkäi. <tr...@us...> - 2009-11-14 18:45:26
|
Module: performous
Branch: dance
Commit: 67a36855f2414d5679ae0e7cb249817ff5ce6d8c
Author: Lasse Karkkainen <tro...@tr...>
Date: Sat Nov 14 20:05:02 2009 +0200
Update TODO
---
docs/TODO.txt | 11 ++++-------
1 files changed, 4 insertions(+), 7 deletions(-)
diff --git a/docs/TODO.txt b/docs/TODO.txt
index 4cc6347..496eb21 100644
--- a/docs/TODO.txt
+++ b/docs/TODO.txt
@@ -7,22 +7,19 @@ Structural:
* Also playback and Vorbis + MP3 decoding
* Mixer and samplerate conversion inside
- Get rid of ScreenManager in favor of recursive approach?
-- Switch to Clanlib?
+- Switch to Clanlib or SFML?
- Switch to GStreamer? (both the ripper and the game)
Big features:
- Add compose screen (using features discussed on mailing list)
-- Multiplayer duet (needs XML song format)
+- Multiplayer duet (needs XML or MIDI song format)
- Recording performances
* Internet highscore
-- Ingame Singstar DVD support (integrated ripping + ffmpeg feeding + XML song format)
-- Playing and dancing
- * Guitar code from Silky Strings project (needs some love, but should be quite usable)
- * Drum code from scratch? [currently has testing mode in practice screen]
- * Dance code from scratch?
- Mic effects (reduce volume for bad singers, perfect pitch, reverb, etc)
+- Ingame Singstar DVD support (integrated ripping + ffmpeg feeding + XML song format)
+- Dance game [WIP]
Features:
|
|
From: Lasse Kärkkäi. <tr...@us...> - 2009-11-14 18:45:24
|
Module: performous
Branch: dance
Commit: fad338dde91edd99262e642fe8ee1f8acd0a674b
Author: Lasse Karkkainen <tro...@tr...>
Date: Sat Nov 14 19:23:24 2009 +0200
No global variables for failsamples (this should avoid the mutex assertion failure on exit)
---
game/guitargraph.cc | 32 +++++++++++++++-----------------
game/guitargraph.hh | 1 +
2 files changed, 16 insertions(+), 17 deletions(-)
diff --git a/game/guitargraph.cc b/game/guitargraph.cc
index eff9119..ed011d3 100644
--- a/game/guitargraph.cc
+++ b/game/guitargraph.cc
@@ -41,8 +41,6 @@ namespace {
return score;
}
- std::vector<Sample> g_samplesG, g_samplesD;
-
}
GuitarGraph::GuitarGraph(Audio& audio, Song const& song, std::string track):
@@ -75,19 +73,20 @@ GuitarGraph::GuitarGraph(Audio& audio, Song const& song, std::string track):
m_use3d = false;
}
unsigned int sr = m_audio.getSR();
- if (g_samplesD.empty()) {
- g_samplesD.push_back(Sample(getPath("sounds/drum_bass.ogg"), sr));
- g_samplesD.push_back(Sample(getPath("sounds/drum_snare.ogg"), sr));
- g_samplesD.push_back(Sample(getPath("sounds/drum_hi-hat.ogg"), sr));
- g_samplesD.push_back(Sample(getPath("sounds/drum_tom1.ogg"), sr));
- g_samplesD.push_back(Sample(getPath("sounds/drum_cymbal.ogg"), sr));
- //g_samplesD.push_back(Sample(getPath("sounds/drum_tom2.ogg"), sr));
- g_samplesG.push_back(Sample(getPath("sounds/guitar_fail1.ogg"), sr));
- g_samplesG.push_back(Sample(getPath("sounds/guitar_fail2.ogg"), sr));
- g_samplesG.push_back(Sample(getPath("sounds/guitar_fail3.ogg"), sr));
- g_samplesG.push_back(Sample(getPath("sounds/guitar_fail4.ogg"), sr));
- g_samplesG.push_back(Sample(getPath("sounds/guitar_fail5.ogg"), sr));
- g_samplesG.push_back(Sample(getPath("sounds/guitar_fail6.ogg"), sr));
+ if (m_drums) {
+ m_samples.push_back(Sample(getPath("sounds/drum_bass.ogg"), sr));
+ m_samples.push_back(Sample(getPath("sounds/drum_snare.ogg"), sr));
+ m_samples.push_back(Sample(getPath("sounds/drum_hi-hat.ogg"), sr));
+ m_samples.push_back(Sample(getPath("sounds/drum_tom1.ogg"), sr));
+ m_samples.push_back(Sample(getPath("sounds/drum_cymbal.ogg"), sr));
+ //m_samples.push_back(Sample(getPath("sounds/drum_tom2.ogg"), sr));
+ } else {
+ m_samples.push_back(Sample(getPath("sounds/guitar_fail1.ogg"), sr));
+ m_samples.push_back(Sample(getPath("sounds/guitar_fail2.ogg"), sr));
+ m_samples.push_back(Sample(getPath("sounds/guitar_fail3.ogg"), sr));
+ m_samples.push_back(Sample(getPath("sounds/guitar_fail4.ogg"), sr));
+ m_samples.push_back(Sample(getPath("sounds/guitar_fail5.ogg"), sr));
+ m_samples.push_back(Sample(getPath("sounds/guitar_fail6.ogg"), sr));
}
unsigned int i = 0;
for (TrackMap::const_iterator it = m_song.track_map.begin(); it != m_song.track_map.end(); ++it,++i) {
@@ -193,8 +192,7 @@ void GuitarGraph::fail(double time, int fret) {
if (fret == -2) return; // Tapped note
m_events.push_back(Event(time, 0, fret));
if (fret < 0) fret = std::rand();
- std::vector<Sample> const& samples = (m_drums ? g_samplesD : g_samplesG);
- m_audio.play(samples[unsigned(fret) % samples.size()], "audio/fail_volume");
+ m_audio.play(m_samples[unsigned(fret) % m_samples.size()], "audio/fail_volume");
m_score -= 50;
m_streak = 0;
}
diff --git a/game/guitargraph.hh b/game/guitargraph.hh
index 8adaafc..b4a6a15 100644
--- a/game/guitargraph.hh
+++ b/game/guitargraph.hh
@@ -73,6 +73,7 @@ class GuitarGraph {
Object3d m_fretObj;
Object3d m_tappableObj;
AnimValue m_hit[6];
+ std::vector<Sample> m_samples;
boost::scoped_ptr<Texture> m_neck;
bool m_drums;
bool m_use3d;
|
|
From: Lasse Kärkkäi. <tr...@us...> - 2009-11-14 18:45:22
|
Module: performous Branch: dance 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 18:45:21
|
Module: performous
Branch: dance
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: Lasse Kärkkäi. <tr...@us...> - 2009-11-14 18:45:19
|
Module: performous
Branch: dance
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: Lasse Kärkkäi. <tr...@us...> - 2009-11-14 18:45:17
|
Module: performous
Branch: dance
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: Lasse Kärkkäi. <tr...@us...> - 2009-11-14 18:45:16
|
Module: performous
Branch: dance
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: Lasse Kärkkäi. <tr...@us...> - 2009-11-14 18:45:14
|
Module: performous
Branch: dance
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: Lasse Kärkkäi. <tr...@us...> - 2009-11-14 18:45:12
|
Module: performous
Branch: dance
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: Lasse Kärkkäi. <tr...@us...> - 2009-11-14 18:45:10
|
Module: performous
Branch: dance
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: Lasse Kärkkäi. <tr...@us...> - 2009-11-14 18:45:09
|
Module: performous
Branch: dance
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: Lasse Kärkkäi. <tr...@us...> - 2009-11-14 18:45:06
|
Module: performous Branch: dance 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: Lasse Kärkkäi. <tr...@us...> - 2009-11-14 18:45:00
|
Module: performous
Branch: dance
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: Lasse Kärkkäi. <tr...@us...> - 2009-11-14 18:44:58
|
Module: performous
Branch: dance
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: Lasse Kärkkäi. <tr...@us...> - 2009-11-14 18:44:57
|
Module: performous
Branch: dance
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-14 18:44:55
|
Module: performous Branch: dance 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(-) |
|
From: Lasse Kärkkäi. <tr...@us...> - 2009-11-14 18:44:55
|
Module: performous
Branch: dance
Commit: af9dc9799c9231f13c046e829b2e30995543a903
Author: Markus Raab <un...@ma...>
Date: Fri Nov 13 10:21:12 2009 +0100
path for pictures work again
like discussed pictures are placed below:
.local/share/games/performous/pictures
---
game/player.hh | 8 ++++----
game/players.cc | 7 ++++++-
game/screen_players.cc | 2 +-
3 files changed, 11 insertions(+), 6 deletions(-)
diff --git a/game/player.hh b/game/player.hh
index ae808ea..9751435 100644
--- a/game/player.hh
+++ b/game/player.hh
@@ -65,11 +65,11 @@ struct Player {
Used for Players Management.
*/
struct PlayerItem {
- int id; /// unique identifier for this PlayerItem, Link to hiscore
+ int id; ///< unique identifier for this PlayerItem, Link to hiscore
- std::string name; /// name displayed and used for searching the player
- std::string path; /// a path to a picture shown
- std::string picture; /// + the filename for it
+ std::string name; ///< name displayed and used for searching the player
+ std::string picture; ///< the filename which was passed from xml (and is written back)
+ std::string path; ///< a full path to a picture shown, generated from picture above
/* Future ideas
std::string displayedName; /// artist name, short name, nick (can be changed)
std::map<std::string, int> scores; /// map between a Song and the highest score the Player achieved
diff --git a/game/players.cc b/game/players.cc
index 1a581e9..47188c6 100644
--- a/game/players.cc
+++ b/game/players.cc
@@ -89,7 +89,12 @@ void Players::addPlayer (std::string const& name, std::string const& picture, in
if (pi.picture != "") // no picture, so don't search path
{
- // pi.picture = getXdgPath(fs::path("pictures") / pi.picture);
+ try {
+ pi.path = getPath(fs::path("pictures") / pi.picture);
+ } catch (std::runtime_error const& e)
+ {
+ std::cerr << e.what() << std::endl;
+ }
}
m_dirty = true;
diff --git a/game/screen_players.cc b/game/screen_players.cc
index 03c352b..0bc80e1 100644
--- a/game/screen_players.cc
+++ b/game/screen_players.cc
@@ -129,7 +129,7 @@ void ScreenPlayers::draw() {
Surface* cover = 0;
if (player_display.path != "")
{
- try { cover = &m_covers[player_display.path + "/" + player_display.picture]; }
+ try { cover = &m_covers[player_display.path]; }
catch (std::exception const&) {}
}
Surface& s = (cover ? *cover : *m_emptyCover);
|
|
From: Lasse Kärkkäi. <tr...@us...> - 2009-11-14 18:44:55
|
Module: performous
Branch: dance
Commit: caf0838f4e338537526c365e02b17c11788fc992
Author: Markus Raab <un...@ma...>
Date: Fri Nov 13 10:52:09 2009 +0100
large constructor should not be implicit inline
remove some header dependencies:
- work fine with boost::scoped_ptr
- work fine with boost::shared_ptr
- but does *not* work with boost::ptr_vector
---
game/player.cc | 7 +++++++
game/player.hh | 11 ++++++-----
game/screen_players.cc | 4 ++++
game/screen_players.hh | 12 +++++++-----
game/screen_sing.cc | 4 ++++
game/screen_sing.hh | 10 +++++-----
game/songs.cc | 2 ++
game/songs.hh | 7 ++++---
8 files changed, 39 insertions(+), 18 deletions(-)
diff --git a/game/player.cc b/game/player.cc
index 618ed3f..51d5bcf 100644
--- a/game/player.cc
+++ b/game/player.cc
@@ -1,7 +1,14 @@
#include "player.hh"
+#include "song.hh"
#include "engine.hh" // just for Engine::TIMESTEP
+Player::Player(Song& song, Analyzer& analyzer, size_t frames):
+ m_song(song), m_analyzer(analyzer), m_pitch(frames, std::make_pair(getNaN(),
+ -getInf())), m_pos(), m_score(), m_lineScore(), m_maxLineScore(), m_prevLineScore(-1),
+ m_feedbackFader(0.0, 2.0), m_activitytimer(), m_scoreIt(m_song.notes.begin())
+{ }
+
void Player::update() {
if (m_pos == m_pitch.size()) return; // End of song already
double beginTime = Engine::TIMESTEP * m_pos;
diff --git a/game/player.hh b/game/player.hh
index 9751435..bede5f0 100644
--- a/game/player.hh
+++ b/game/player.hh
@@ -1,11 +1,15 @@
#pragma once
-#include "song.hh"
#include "color.hh"
#include "pitch.hh"
#include "util.hh"
+#include "notes.hh"
#include "animvalue.hh"
+#include <string>
#include <vector>
+#include <utility>
+
+class Song;
/// player class
struct Player {
@@ -36,10 +40,7 @@ struct Player {
/// score iterator
Notes::const_iterator m_scoreIt;
/// constructor
- Player(Song& song, Analyzer& analyzer, size_t frames):
- m_song(song), m_analyzer(analyzer), m_pitch(frames, std::make_pair(getNaN(),
- -getInf())), m_pos(), m_score(), m_lineScore(), m_maxLineScore(), m_prevLineScore(-1),
- m_feedbackFader(0.0, 2.0), m_activitytimer(), m_scoreIt(m_song.notes.begin()) {}
+ Player(Song& song, Analyzer& analyzer, size_t frames);
/// prepares analyzer
void prepare() { m_analyzer.process(); }
/// updates player stats
diff --git a/game/screen_players.cc b/game/screen_players.cc
index 0bc80e1..48115aa 100644
--- a/game/screen_players.cc
+++ b/game/screen_players.cc
@@ -5,6 +5,10 @@
#include "database.hh"
#include "fs.hh"
#include "util.hh"
+#include "layout_singer.hh"
+#include "theme.hh"
+#include "video.hh"
+
#include <iostream>
#include <sstream>
diff --git a/game/screen_players.hh b/game/screen_players.hh
index a78b025..5786d5b 100644
--- a/game/screen_players.hh
+++ b/game/screen_players.hh
@@ -5,14 +5,16 @@
#include "cachemap.hh"
#include "screen.hh"
#include "textinput.hh"
-#include "theme.hh"
-#include "video.hh"
-#include "hiscore.hh"
-#include "layout_singer.hh"
+class Song;
class Audio;
-class Database;
+class Video;
class Players;
+class Surface;
+class Database;
+class ThemeSongs;
+class LayoutSinger;
+
/** song chooser screen.
Database is passed as argument, but only the players is stored
diff --git a/game/screen_sing.cc b/game/screen_sing.cc
index f6c46ac..4c9d681 100644
--- a/game/screen_sing.cc
+++ b/game/screen_sing.cc
@@ -5,6 +5,10 @@
#include "configuration.hh"
#include "screen_players.hh"
#include "fs.hh"
+#include "database.hh"
+#include "video.hh"
+#include "guitargraph.hh"
+
#include <boost/format.hpp>
#include <boost/lexical_cast.hpp>
diff --git a/game/screen_sing.hh b/game/screen_sing.hh
index 298fb8b..10a8095 100644
--- a/game/screen_sing.hh
+++ b/game/screen_sing.hh
@@ -6,32 +6,32 @@
#include "layout_singer.hh"
#include "animvalue.hh"
#include "engine.hh"
-#include "guitargraph.hh"
#include "screen.hh"
#include "backgrounds.hh"
#include "theme.hh"
-#include "video.hh"
#include "surface.hh"
#include "opengl_text.hh"
#include "progressbar.hh"
-#include "database.hh"
+#include "guitargraph.hh"
#include "screen_players.hh"
class Players;
class Audio;
class Capture;
+class Database;
+class Video;
/// shows score at end of song
class ScoreWindow {
public:
/// constructor
- ScoreWindow(Engine & e, Database & database);
+ ScoreWindow(Engine & e, Database& database);
/// draws ScoreWindow
void draw();
bool empty() { return m_database.cur.empty(); }
private:
- Database & m_database;
+ Database& m_database;
AnimValue m_pos;
Surface m_bg;
ProgressBar m_scoreBar;
diff --git a/game/songs.cc b/game/songs.cc
index 4a9c5a5..d6a4d64 100644
--- a/game/songs.cc
+++ b/game/songs.cc
@@ -2,6 +2,8 @@
#include "configuration.hh"
#include "fs.hh"
+#include "song.hh"
+#include "database.hh"
#include <boost/bind.hpp>
#include <boost/format.hpp>
diff --git a/game/songs.hh b/game/songs.hh
index ee5028b..7ae1545 100644
--- a/game/songs.hh
+++ b/game/songs.hh
@@ -2,8 +2,6 @@
#include "animvalue.hh"
#include "fs.hh"
-#include "song.hh"
-#include "database.hh"
#include <boost/shared_ptr.hpp>
#include <boost/scoped_ptr.hpp>
#include <boost/thread/mutex.hpp>
@@ -11,11 +9,14 @@
#include <set>
#include <vector>
+class Song;
+class Database;
+
/// songs class for songs screen
class Songs: boost::noncopyable {
public:
/// constructor
- Songs(Database & database, std::string const& songlist = std::string());
+ Songs(Database& database, std::string const& songlist = std::string());
~Songs();
/// updates filtered songlist
void update();
|
|
From: Lasse Kärkkäi. <tr...@us...> - 2009-11-14 18:44:49
|
Module: performous
Branch: dance
Commit: a3789c1dc33930453e12b64640e4474e930d256e
Author: Markus Raab <un...@ma...>
Date: Fri Nov 13 09:45:11 2009 +0100
songlist not as global variable
---
game/main.cc | 7 +++----
1 files changed, 3 insertions(+), 4 deletions(-)
diff --git a/game/main.cc b/game/main.cc
index a863bfd..c73e4df 100644
--- a/game/main.cc
+++ b/game/main.cc
@@ -134,9 +134,7 @@ void audioSetup(Capture& capture, Audio& audio) {
if (!audio.isOpen()) std::cerr << "No playback devices could be used. Please use --pdev to define one." << std::endl;
}
-std::string songlist;
-
-void mainLoop() {
+void mainLoop(std::string const& songlist) {
try {
Capture capture;
Audio audio;
@@ -205,6 +203,7 @@ int main(int argc, char** argv) {
std::vector<std::string> songdirs;
namespace po = boost::program_options;
po::options_description opt1("Generic options");
+ std::string songlist;
opt1.add_options()
("help,h", "you are viewing it")
("version,v", "display version number")
@@ -288,7 +287,7 @@ int main(int argc, char** argv) {
confOverride(mics, "audio/capture");
confOverride(pdevs, "audio/playback");
// Run the game init and main loop
- mainLoop();
+ mainLoop(songlist);
return 0; // Do not remove. SDL_Main (which this function is called on some platforms) needs return statement.
}
|
|
From: Lasse Kärkkäi. <tr...@us...> - 2009-11-14 18:44:47
|
Module: performous
Branch: dance
Commit: 6b0487c8fb2ae98e586b65f4017a82380a6eb4e7
Author: Markus Raab <un...@ma...>
Date: Fri Nov 13 09:34:31 2009 +0100
audio; video or background is shown in hiscore
---
game/screen_hiscore.cc | 51 +++++++++++++++++++++++++++++++++++++++++++++--
game/screen_hiscore.hh | 1 +
2 files changed, 49 insertions(+), 3 deletions(-)
diff --git a/game/screen_hiscore.cc b/game/screen_hiscore.cc
index a45b502..6dbe593 100644
--- a/game/screen_hiscore.cc
+++ b/game/screen_hiscore.cc
@@ -20,6 +20,18 @@ ScreenHiscore::ScreenHiscore(std::string const& name, Audio& audio, Database& da
}
void ScreenHiscore::enter() {
+ if (!m_song->background.empty()) {
+ try {
+ m_background.reset(new Surface(m_song->path + m_song->background, true));
+ } catch (std::exception& e) {
+ std::cerr << e.what() << std::endl;
+ }
+ }
+
+ if (!m_song->video.empty() && config["graphic/video"].b()) {
+ m_video.reset(new Video(m_song->path + m_song->video, m_song->videoGap));
+ }
+
m_score_text[0].reset(new SvgTxtThemeSimple(getThemePath("sing_score_text.svg"), config["graphic/text_lod"].f()));
m_score_text[1].reset(new SvgTxtThemeSimple(getThemePath("sing_score_text.svg"), config["graphic/text_lod"].f()));
m_score_text[2].reset(new SvgTxtThemeSimple(getThemePath("sing_score_text.svg"), config["graphic/text_lod"].f()));
@@ -29,7 +41,8 @@ void ScreenHiscore::enter() {
m_emptyCover.reset(new Surface(getThemePath("no_cover.svg"))); // TODO use persons head
m_search.text.clear();
m_players.setFilter(m_search.text);
- m_audio.fadeout();
+ // m_audio.fadeout();
+ m_audio.playMusic(m_song->music, false, 0.0, -1.0);
}
void ScreenHiscore::exit() {
@@ -97,12 +110,44 @@ void ScreenHiscore::drawScores() {
}
}
+namespace {
+
+ const double arMin = 1.33;
+ const double arMax = 2.35;
+
+ void fillBG() {
+ Dimensions dim(arMin);
+ dim.fixedWidth(1.0);
+ glutil::Begin block(GL_QUADS);
+ glVertex2f(dim.x1(), dim.y1());
+ glVertex2f(dim.x2(), dim.y1());
+ glVertex2f(dim.x2(), dim.y2());
+ glVertex2f(dim.x1(), dim.y2());
+ }
+
+}
+
void ScreenHiscore::draw() {
+ const double arMin = 1.33;
+ const double arMax = 2.35;
+
m_players.update(); // Poll for new players
double length = m_audio.getLength();
double time = clamp(m_audio.getPosition() - config["audio/video_delay"].f(), 0.0, length);
- if (m_songbg.get()) m_songbg->draw();
- if (m_video.get()) m_video->render(time);
+ time -= config["audio/video_delay"].f();
+
+ // Rendering starts
+ {
+ double ar = arMax;
+ if (m_background) {
+ ar = m_background->dimensions.ar();
+ if (ar > arMax || (m_video && ar > arMin)) fillBG(); // Fill white background to avoid black borders
+ m_background->draw();
+ } else fillBG();
+ if (m_video) { m_video->render(time); double tmp = m_video->dimensions().ar(); if (tmp > 0.0) ar = tmp; }
+ ar = clamp(ar, arMin, arMax);
+ }
+
theme->bg.draw();
std::string music, songbg, video;
double videoGap = 0.0;
diff --git a/game/screen_hiscore.hh b/game/screen_hiscore.hh
index 6d48f02..c8d7c6d 100644
--- a/game/screen_hiscore.hh
+++ b/game/screen_hiscore.hh
@@ -42,6 +42,7 @@ class ScreenHiscore : public Screen {
boost::scoped_ptr<Surface> m_songbg;
boost::scoped_ptr<Video> m_video;
boost::scoped_ptr<ThemeSongs> theme;
+ boost::scoped_ptr<Surface> m_background;
std::string m_playing;
std::string m_playReq;
AnimValue m_playTimer;
|
|
From: Lasse Kärkkäi. <tr...@us...> - 2009-11-14 18:44:46
|
Module: performous
Branch: dance
Commit: 53b979b022c94894d7b59fe36010766c1a292ef4
Author: Markus Raab <un...@ma...>
Date: Fri Nov 13 09:18:21 2009 +0100
give error message for song hiscore without items
---
game/database.cc | 8 ++++++++
1 files changed, 8 insertions(+), 0 deletions(-)
diff --git a/game/database.cc b/game/database.cc
index cd91a9f..aa6c871 100644
--- a/game/database.cc
+++ b/game/database.cc
@@ -99,6 +99,14 @@ void Database::queryOverallHiscore (std::ostream & os, std::string const& track)
void Database::queryPerSongHiscore (std::ostream & os, boost::shared_ptr<Song> s, std::string const& track) const {
int songid = m_songs.lookup(s);
std::vector<HiscoreItem> hi = m_hiscores.queryHiscore(10, -1, songid, track);
+
+ if (songid == -1 || hi.size() == 0)
+ {
+ os << "No Items up to now.\n";
+ os << "Be the first to be listed here!\n";
+ return;
+ }
+
for (size_t i=0; i<hi.size(); ++i)
{
os << i+1 << ".\t"
|
|
From: Lasse Kärkkäi. <tr...@us...> - 2009-11-14 18:44:44
|
Module: performous Branch: dance Commit: a896f09f74c23713383a1483f709bcb6e691a183 Author: Lasse Karkkainen <tro...@tr...> Date: Fri Nov 13 01:27:03 2009 +0200 Merge branch 'master' of ssh://tronic@git.performous.org/gitroot/performous/performous --- |