|
From: Tapio V. <aa...@us...> - 2010-04-17 12:46:36
|
Module: performous
Branch: master
Commit: 5fa954ab274fd268f4394ed3d66232d9a45a9b20
Author: Tapio Vierros <tap...@gm...>
Date: Sat Apr 17 12:57:31 2010 +0300
Test vertical instrument error indicator instead of horizontal.
Switch around guitargraph.cc:760
---
game/guitargraph.cc | 34 +++++++++++++++++++++++-----------
1 files changed, 23 insertions(+), 11 deletions(-)
diff --git a/game/guitargraph.cc b/game/guitargraph.cc
index 6fc7d64..2e119bc 100644
--- a/game/guitargraph.cc
+++ b/game/guitargraph.cc
@@ -749,28 +749,40 @@ void GuitarGraph::draw(double time) {
}
{ // Accuracy indicator
float maxsize = 1.0f;
- float thickness = 0.1f;
+ float thickness = 0.05f;
+ float x = 0.0;
float y = time2y(past / 3.0f);
+ float w = maxsize;
+ float h = thickness;
float alpha = m_errorMeterFade.get();
float bgcol = m_errorMeterFlash.get();
+ // Vertical bar?
+ bool VERTICALMETER = true;
+ if (VERTICALMETER) {
+ std::swap(w, h);
+ x = -2.5 - thickness;
+ y = time2y(0.0);
+ }
glColor4f(bgcol, bgcol, bgcol, 0.6f * alpha);
{ // Indicator background
glutil::Begin block(GL_TRIANGLE_STRIP);
- glVertex3f(-maxsize, y, thickness);
- glVertex3f( maxsize, y, thickness);
- glVertex3f(-maxsize, y, 0.0f);
- glVertex3f( maxsize, y, 0.0f);
+ glVertex3f(x-w, y, -h);
+ glVertex3f(x+w, y, -h);
+ glVertex3f(x-w, y, h);
+ glVertex3f(x+w, y, h);
}
float error = m_errorMeter.get();
if (error != 0) {
float x1 = 0, x2 = 0;
- if (error > 0) { glColor4f(0.0f, 1.0f, 0.0f, alpha); x2 = -maxsize * error; }
- else { glColor4f(1.0f, 0.0f, 0.0f, alpha); x1 = -maxsize * error; }
+ float h1 = -thickness, h2 = thickness;
+ if (error > 0) { glColor4f(0.0f, 1.0f, 0.0f, alpha); x2 -= maxsize * error; }
+ else { glColor4f(1.0f, 0.0f, 0.0f, alpha); x1 -= maxsize * error; }
+ if (VERTICALMETER) { std::swap(x1, h1); std::swap(x2,h2); }
glutil::Begin block(GL_TRIANGLE_STRIP);
- glVertex3f(x1, y, 0.0f);
- glVertex3f(x2, y, 0.0f);
- glVertex3f(x1, y, thickness);
- glVertex3f(x2, y, thickness);
+ glVertex3f(x1+x, y, h1);
+ glVertex3f(x2+x, y, h1);
+ glVertex3f(x1+x, y, h2);
+ glVertex3f(x2+x, y, h2);
if (m_errorMeter.get() == m_errorMeter.getTarget())
m_errorMeter.setTarget(0.0);
}
|