|
From: Tapio V. <aa...@us...> - 2010-06-19 19:15:40
|
Module: performous
Branch: master
Commit: c436b8fd7766ffcf28bfd1cc423991fd10777753
Author: Tapio Vierros <tap...@gm...>
Date: Sat Jun 19 22:14:56 2010 +0300
Instrument notes are now gray during joining.
---
game/dancegraph.cc | 6 +++---
game/guitargraph.cc | 24 ++++++++++++++----------
game/instrumentgraph.hh | 1 +
3 files changed, 18 insertions(+), 13 deletions(-)
diff --git a/game/dancegraph.cc b/game/dancegraph.cc
index 10b76bf..cf9c556 100644
--- a/game/dancegraph.cc
+++ b/game/dancegraph.cc
@@ -182,7 +182,7 @@ void DanceGraph::engine() {
if (time < it->first + it->second) { time = it->first; break; } // Inside stop
time -= it->second;
}
- if (time < m_jointime) m_dead = 0; // Disable dead counting while joining
+ if (joining(time)) m_dead = 0; // Disable dead counting while joining
bool difficulty_changed = false;
// Handle all events
for (input::Event ev; m_input.tryPoll(ev);) {
@@ -192,7 +192,7 @@ void DanceGraph::engine() {
break;
}
// Difficulty / mode selection
- if (time < m_jointime && ev.type == input::Event::PRESS) {
+ if (joining(time) && ev.type == input::Event::PRESS) {
if (ev.pressed[STEP_UP]) difficultyDelta(1);
else if (ev.pressed[STEP_DOWN]) difficultyDelta(-1);
else if (ev.pressed[STEP_LEFT]) gameMode(-1);
@@ -466,7 +466,7 @@ void DanceGraph::drawNote(DanceNote& note, double time) {
/// Draw popups and other info texts
void DanceGraph::drawInfo(double time, double offsetX, Dimensions dimensions) {
// Draw info
- if (time < m_jointime) {
+ if (joining(time)) {
m_text.dimensions.screenBottom(-0.075).middle(-0.09 + offsetX);
m_text.draw("^ " + getDifficultyString() + " v");
m_text.dimensions.screenBottom(-0.050).middle(-0.09 + offsetX);
diff --git a/game/guitargraph.cc b/game/guitargraph.cc
index 5a1e122..0be7a41 100644
--- a/game/guitargraph.cc
+++ b/game/guitargraph.cc
@@ -194,7 +194,7 @@ void GuitarGraph::engine() {
}
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
+ if (joining(time)) m_dead = 0; // Disable dead counting while joining
double whammy = 0;
bool difficulty_changed = false;
// Handle all events
@@ -225,7 +225,7 @@ void GuitarGraph::engine() {
if (ev.type == input::Event::PRESS) m_pressed_anim[!m_drums + ev.button].setValue(1.0);
else if (ev.type == input::Event::PICK) m_pressed_anim[0].setValue(1.0);
// Difficulty and track selection
- if (time < m_jointime) {
+ if (joining(time)) {
if (ev.type == input::Event::PICK || ev.type == input::Event::PRESS) {
if (!m_drums && ev.pressed[4]) nextTrack();
else if (ev.pressed[0 + m_drums]) difficulty(DIFFICULTY_SUPAEASY);
@@ -778,13 +778,17 @@ void GuitarGraph::draw(double time) {
glow = m_events[event - 1].glow.get();
whammy = m_events[event - 1].whammy.get();
}
- // Get a color for the fret and adjust it if GodMode is on
- glutil::Color c = colorize(color(fret), it->begin);
- if (glow > 0.1f) { ng_r+=c.r; ng_g+=c.g; ng_b+=c.b; ng_ccnt++; } // neck glow
- // Further adjust the color if the note is hit
- c.r += glow * 0.2f;
- c.g += glow * 0.2f;
- c.b += glow * 0.2f;
+ // Set the default color (disabled state)
+ glutil::Color c(0.5f, 0.5f, 0.5f);
+ if (!joining(time)) {
+ // Get a color for the fret and adjust it if GodMode is on
+ c = colorize(color(fret), it->begin);
+ if (glow > 0.1f) { ng_r+=c.r; ng_g+=c.g; ng_b+=c.b; ng_ccnt++; } // neck glow
+ // Further adjust the color if the note is hit
+ c.r += glow * 0.2f;
+ c.g += glow * 0.2f;
+ c.b += glow * 0.2f;
+ }
if (glow > 0.5f && tEnd < 0.1f && it->hitAnim[fret].get() == 0.0)
it->hitAnim[fret].setTarget(1.0);
// Call the actual note drawing function
@@ -983,7 +987,7 @@ void GuitarGraph::drawDrumfill(float tBeg, float tEnd) {
/// Draw popups and other info texts
void GuitarGraph::drawInfo(double time, double offsetX, Dimensions dimensions) {
// Draw info
- if (time < m_jointime) {
+ if (joining(time)) {
m_text.dimensions.screenBottom(-0.041).middle(-0.09 + offsetX);
m_text.draw(diffv[m_level].name);
m_text.dimensions.screenBottom(-0.015).middle(-0.09 + offsetX);
diff --git a/game/instrumentgraph.hh b/game/instrumentgraph.hh
index f1cbf86..6923d53 100644
--- a/game/instrumentgraph.hh
+++ b/game/instrumentgraph.hh
@@ -117,6 +117,7 @@ class InstrumentGraph {
// Shared functions for derived classes
void drawPopups(double offsetX);
void handleCountdown(double time, double beginTime);
+ bool joining(double time) const { return time < m_jointime; }
// Media
SvgTxtTheme m_text;
|