|
From: Tapio V. <aa...@us...> - 2009-11-15 15:46:54
|
Module: performous
Branch: dance
Commit: 6a3c91ccfda227775a230703e02fe93e8c43df23
Author: Tapio Vierros <tap...@gm...>
Date: Sun Nov 15 17:34:29 2009 +0200
Fixed temporary cursor arrows pressing effect.
---
game/dancegraph.cc | 6 ++----
1 files changed, 2 insertions(+), 4 deletions(-)
diff --git a/game/dancegraph.cc b/game/dancegraph.cc
index da27dc7..66438b1 100644
--- a/game/dancegraph.cc
+++ b/game/dancegraph.cc
@@ -97,15 +97,12 @@ void DanceGraph::dance(double time, input::Event const& ev) {
glutil::Color const& DanceGraph::color(int arrow_i) const {
// TODO: Hack.. Needs animation through events.
- glutil::Color arrowColors[4] = {
+ static glutil::Color arrowColors[4] = {
glutil::Color(0.0f, 0.9f, 0.0f),
glutil::Color(0.9f, 0.0f, 0.0f),
glutil::Color(0.9f, 0.9f, 0.0f),
glutil::Color(0.0f, 0.0f, 0.9f),
};
- for(size_t i = 0; i < 4; i++) {
- if(m_holds[i] != 0) arrowColors[i] = glutil::Color(0.9f, 0.9f, 0.9f);
- }
if (arrow_i < 0 || arrow_i > 3) throw std::logic_error("Invalid arrow number in DanceGraph::getColor");
return arrowColors[arrow_i];
}
@@ -178,6 +175,7 @@ void DanceGraph::draw(double time) {
for (int arrow_i = 0; arrow_i < 4; ++arrow_i) {
float x = -1.5f + arrow_i;
glColor4fv(color(arrow_i));
+ if (m_holds[arrow_i]) glColor3f(1.0f, 1.0f, 1.0f);
drawArrow(arrow_i, x, time2y(0.0), 0.6);
}
glColor3f(1.0f, 1.0f, 1.0f);
|