|
From: Lasse Kärkkäi. <tr...@us...> - 2011-01-26 23:03:08
|
Module: performous
Branch: opengl2
Commit: f340c6f12b095347966dc535a612f8cbfba4f1d7
Author: Vincent Le Ligeour <yo...@us...>
Date: Sun Jan 23 14:37:59 2011 +0100
Reverted manually bf2c4bdf (practice drum mode not used at all) to simplify guitargraph
---
game/guitargraph.cc | 42 +++++-------------------------------------
game/guitargraph.hh | 4 +---
game/screen_sing.cc | 12 +++---------
game/screen_sing.hh | 4 +---
4 files changed, 10 insertions(+), 52 deletions(-)
diff --git a/game/guitargraph.cc b/game/guitargraph.cc
index 61cb1b0..51cd3d2 100644
--- a/game/guitargraph.cc
+++ b/game/guitargraph.cc
@@ -93,7 +93,7 @@ void GuitarGraph::initDrums() {
//m_samples.push_back("drum tom2");
}
-GuitarGraph::GuitarGraph(Audio& audio, Song const& song, bool drums, int number, bool practmode):
+GuitarGraph::GuitarGraph(Audio& audio, Song const& song, bool drums, int number):
InstrumentGraph(audio, song, drums ? input::DRUMS : input::GUITAR),
m_tail(getThemePath("tail.svg")),
m_tail_glow(getThemePath("tail_glow.svg")),
@@ -105,7 +105,6 @@ GuitarGraph::GuitarGraph(Audio& audio, Song const& song, bool drums, int number,
m_neckglowColor(),
m_drums(drums),
m_use3d(config["graphic/3d_notes"].b()),
- m_practmode(practmode),
m_level(),
m_track_index(m_instrumentTracks.end()),
m_dfIt(m_drumfills.end()),
@@ -120,7 +119,6 @@ GuitarGraph::GuitarGraph(Audio& audio, Song const& song, bool drums, int number,
m_soloTotal(),
m_soloScore(),
m_solo(),
- m_practHold(false),
m_hasTomTrack(false),
m_whammy(0)
{
@@ -413,31 +411,14 @@ void GuitarGraph::engine() {
// Countdown to start
handleCountdown(time, time < getNotesBeginTime() ? getNotesBeginTime() : m_jointime+1);
- // FIXME: this is a band aid to release m_practHold
- // this may happen in conjunction with the regular pause feature
- if (m_practHold && !m_audio.isPaused()) m_practHold = false;
-
// Skip missed notes
// we hold the note a litle bit *before* they go out of the tolerance window
// this is important in order for the hit-detection to still accept the notes
// FIXME: need to confirm that this timing is reliable,
// if a note gets marked as 'past' completing the chord does not re-start the song
- double past = time - maxTolerance + (m_practmode ? 0.05 : 0.0);
- while (!m_practHold && m_chordIt != m_chords.end() && m_chordIt->begin < past) {
+ while (m_chordIt != m_chords.end() && m_chordIt->begin + maxTolerance < time) {
if ( (m_drums && m_chordIt->status != m_chordIt->polyphony)
- || (!m_drums && m_chordIt->status == 0) ) {
- endStreak();
- if (m_practmode && !dead()) {
- // in practice mode hold the chord here
- // m_chordIt must not change until finishing the chord
- m_audio.seekPos(m_chordIt->begin);
- m_audio.pause(true);
- m_practHold = true;
- endStreak();
- std::cout << "practice: hold chord at " << m_chordIt->begin << ", status = "<< m_chordIt->status << std::endl;
- break;
- }
- }
+ || (!m_drums && m_chordIt->status == 0) ) endStreak();
// Calculate solo total score
if (m_solo) { m_soloScore += m_chordIt->score; m_soloTotal += m_chordIt->polyphony * points(0);
// Solo just ended?
@@ -451,17 +432,6 @@ void GuitarGraph::engine() {
++m_chordIt;
}
- // just finished a chord in practice mode
- if (m_practHold &&
- ( (m_drums && m_chordIt->status == m_chordIt->polyphony)
- || (!m_drums && m_chordIt->status != 0) ) ) {
- // now we have completed the chord
- // m_chordIt must not change from holding the chord until we get here
- if (m_audio.isPaused()) m_audio.togglePause();
- m_practHold = false;
- std::cout << "practice: finish chord at " << m_chordIt->begin << std::endl;
- }
-
if (difficulty_changed) m_dead = 0; // if difficulty is changed, m_dead would get incorrect
// Adjust the correctness value
if (!m_events.empty() && m_events.back().type == 0) m_correctness.setTarget(0.0, true);
@@ -649,18 +619,16 @@ void GuitarGraph::drumHit(double time, int fret) {
// in kiddy mode we don't care about the correct pad
// all that matters is that there is still a missing note in that chord
if (m_chordIt->status == m_chordIt->polyphony) continue;
- } else if ((!it->dur[fret]) || (m_notes[it->dur[fret]])) continue; // invalid fret/hit or already played
+ } else if (m_notes[it->dur[fret]]) continue; // invalid fret/hit or already played
double error = std::abs(it->begin - time);
if (error < tolerance) {
best = it;
tolerance = error;
signed_error = it->begin - time;
- if (m_practHold) break; // during practice hold the chord will always be m_chordIt
}
}
- if ((best == m_chords.end())
- || (m_practHold && best != m_chordIt)) fail(time, fret); // None found
+ if (best == m_chords.end()) fail(time, fret); // None found
else {
// Skip all chords earlier than the best fit chord
for (; best != m_chordIt; ++m_chordIt) {
diff --git a/game/guitargraph.hh b/game/guitargraph.hh
index f0dc946..313b744 100644
--- a/game/guitargraph.hh
+++ b/game/guitargraph.hh
@@ -46,7 +46,7 @@ static inline bool operator==(Chord const& a, Chord const& b) {
class GuitarGraph: public InstrumentGraph {
public:
/// constructor
- GuitarGraph(Audio& audio, Song const& song, bool drums, int number, bool practmode=false);
+ GuitarGraph(Audio& audio, Song const& song, bool drums, int number);
/** draws GuitarGraph
* @param time at which time to draw
*/
@@ -99,7 +99,6 @@ class GuitarGraph: public InstrumentGraph {
// Flags
bool m_drums; /// are we using drums?
bool m_use3d; /// are we using 3d?
- bool m_practmode; /// switch to enable practice mode
// Track stuff
enum Difficulty {
@@ -154,7 +153,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
- bool m_practHold; /// true if holding a chord during practice
bool m_hasTomTrack; /// true if the track has at least one tom track
double m_whammy; /// whammy value for pitch shift
};
diff --git a/game/screen_sing.cc b/game/screen_sing.cc
index 525f035..8febec1 100644
--- a/game/screen_sing.cc
+++ b/game/screen_sing.cc
@@ -30,7 +30,6 @@ namespace {
}
void ScreenSing::enter() {
- //m_practmode = true; // un-comment this line to play with practice mode. temporary, of course!
ScreenManager* sm = ScreenManager::getSingletonPtr();
sm->loading(_("Loading theme..."), 0.0);
theme.reset(new ThemeSing());
@@ -104,7 +103,7 @@ void ScreenSing::enter() {
if (type == 3) break;
}
if (type == 0) m_dancers.push_back(new DanceGraph(m_audio, *m_song));
- else m_instruments.push_back(new GuitarGraph(m_audio, *m_song, type == 2, idx, m_practmode));
+ else m_instruments.push_back(new GuitarGraph(m_audio, *m_song, type == 2, idx));
++idx;
} catch (input::NoDevError&) {
++type;
@@ -508,13 +507,8 @@ void ScreenSing::draw() {
}
if (m_audio.isPaused()) {
- if (!m_practmode) {
- //m_pause_icon->dimensions.middle().center().fixedWidth(.32);
- //m_pause_icon->draw();
- } else {
- // we get here when the song is on hold during practice
- // TODO: display some (small) info screen here
- }
+ //m_pause_icon->dimensions.middle().center().fixedWidth(.32);
+ //m_pause_icon->draw();
}
// Menus on top of everything
diff --git a/game/screen_sing.hh b/game/screen_sing.hh
index 5df5af6..0b63066 100644
--- a/game/screen_sing.hh
+++ b/game/screen_sing.hh
@@ -49,8 +49,7 @@ class ScreenSing: public Screen {
public:
/// constructor
ScreenSing(std::string const& name, Audio& audio, Database& database, Backgrounds& bgs):
- Screen(name), m_audio(audio), m_database(database), m_backgrounds(bgs), m_latencyAV(), m_only_singers_alive(true), m_practmode(false),
- m_selectedTrack(TrackName::LEAD_VOCAL)
+ Screen(name), m_audio(audio), m_database(database), m_backgrounds(bgs), m_latencyAV(), m_only_singers_alive(true), m_selectedTrack(TrackName::LEAD_VOCAL)
{}
void enter();
void exit();
@@ -94,7 +93,6 @@ class ScreenSing: public Screen {
boost::shared_ptr<ThemeSing> theme;
AnimValue m_quitTimer;
bool m_only_singers_alive;
- bool m_practmode;
std::string m_selectedTrack;
std::string m_selectedTrackLocalized;
ConfigItem m_vocalTrackOpts;
|