|
From: Tapio V. <aa...@us...> - 2009-11-08 08:30:30
|
Module: performous
Branch: dance
Commit: 3b7b339729609656cd4eee9916072e6fb8dde403
Author: Lasse Karkkainen <tro...@tr...>
Date: Thu Oct 29 02:15:44 2009 +0200
Skip score window if there are no players
---
game/screen_sing.cc | 10 ++++++++--
game/screen_sing.hh | 2 +-
2 files changed, 9 insertions(+), 3 deletions(-)
diff --git a/game/screen_sing.cc b/game/screen_sing.cc
index 04d4070..0e682f0 100644
--- a/game/screen_sing.cc
+++ b/game/screen_sing.cc
@@ -243,10 +243,16 @@ void ScreenSing::draw() {
}
} else {
if (m_score_window.get()) {
- if (m_quitTimer.get() == 0.0 && !m_audio.isPaused()) { activateNextScreen(); return; }
- m_score_window->draw();
+ // Score window has been created (we are near the end)
+ if (m_score_window->empty()) { // No players to display scores for
+ if (!m_audio.isPlaying()) { activateNextScreen(); return; }
+ } else { // Window being displayed
+ if (m_quitTimer.get() == 0.0 && !m_audio.isPaused()) { activateNextScreen(); return; }
+ m_score_window->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_players));
}
diff --git a/game/screen_sing.hh b/game/screen_sing.hh
index d195bd5..a14a7b8 100644
--- a/game/screen_sing.hh
+++ b/game/screen_sing.hh
@@ -27,7 +27,7 @@ class ScoreWindow {
ScoreWindow(Engine & e, Players & players);
/// draws ScoreWindow
void draw();
-
+ bool empty() { return m_players.cur.empty(); }
private:
Players & m_players;
AnimValue m_pos;
|