|
From: Tapio V. <aa...@us...> - 2010-05-17 17:00:59
|
Module: performous
Branch: master
Commit: 77edaf5cfec85b522c753172490210c178f28eee
Author: Tapio Vierros <tap...@gm...>
Date: Wed Apr 21 11:49:42 2010 +0300
Add a 3s countdown to instrument notes start using popups.
---
game/guitargraph.cc | 10 +++++++++-
game/guitargraph.hh | 1 +
2 files changed, 10 insertions(+), 1 deletions(-)
diff --git a/game/guitargraph.cc b/game/guitargraph.cc
index 078969f..d4eabbe 100644
--- a/game/guitargraph.cc
+++ b/game/guitargraph.cc
@@ -74,7 +74,8 @@ GuitarGraph::GuitarGraph(Audio& audio, Song const& song, bool drums, int number)
m_drumfillScore(),
m_soloTotal(),
m_soloScore(),
- m_solo()
+ m_solo(),
+ m_countdown(3)
{
// Copy all tracks of supported types (either drums or non-drums) to m_instrumentTracks
for (InstrumentTracks::const_iterator it = m_song.instrumentTracks.begin(); it != m_song.instrumentTracks.end(); ++it) {
@@ -179,6 +180,13 @@ void GuitarGraph::engine() {
if (m_input.pressed(i)) m_hit[i + 1].setValue(1.0);
}
}
+ // Countdown
+ if (time < m_chords.front().begin && time >= m_chords.front().begin - m_countdown - 1) {
+ m_popups.push_back(Popup(m_countdown > 0 ?
+ std::string("- ") +boost::lexical_cast<std::string>(unsigned(m_countdown))+" -" : "Rock On!",
+ glutil::Color(0.0f, 0.0f, 1.0f), 3.0, m_popupText.get()));
+ --m_countdown;
+ }
if (!m_drumfills.empty()) updateDrumFill(time); // Drum Fills / BREs
if (m_starpower.get() > 0.001) m_correctness.setTarget(1.0, true);
if (time < m_jointime) m_dead = 0; // Disable dead counting while joining
diff --git a/game/guitargraph.hh b/game/guitargraph.hh
index 650cdeb..59eacad 100644
--- a/game/guitargraph.hh
+++ b/game/guitargraph.hh
@@ -127,5 +127,6 @@ class GuitarGraph: public InstrumentGraph {
double m_soloTotal; /// maximum solo score
double m_soloScore; /// score during solo
bool m_solo; /// are we currently playing a solo
+ int m_countdown; /// countdown counter
};
|