|
From: Tapio V. <aa...@us...> - 2010-04-20 19:17:48
|
Module: performous
Branch: master
Commit: 684754eb3e90cc1a985c1c9beb6c0b2fd94aebdc
Author: Tapio Vierros <tap...@gm...>
Date: Tue Apr 20 21:47:31 2010 +0300
Revert "Test vertical instrument error indicator instead of horizontal."
Reason: Horizontal is better.
This reverts commit 5fa954ab274fd268f4394ed3d66232d9a45a9b20.
---
game/guitargraph.cc | 34 +++++++++++-----------------------
1 files changed, 11 insertions(+), 23 deletions(-)
diff --git a/game/guitargraph.cc b/game/guitargraph.cc
index 2e119bc..6fc7d64 100644
--- a/game/guitargraph.cc
+++ b/game/guitargraph.cc
@@ -749,40 +749,28 @@ void GuitarGraph::draw(double time) {
}
{ // Accuracy indicator
float maxsize = 1.0f;
- float thickness = 0.05f;
- float x = 0.0;
+ float thickness = 0.1f;
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(x-w, y, -h);
- glVertex3f(x+w, y, -h);
- glVertex3f(x-w, y, h);
- glVertex3f(x+w, y, h);
+ glVertex3f(-maxsize, y, thickness);
+ glVertex3f( maxsize, y, thickness);
+ glVertex3f(-maxsize, y, 0.0f);
+ glVertex3f( maxsize, y, 0.0f);
}
float error = m_errorMeter.get();
if (error != 0) {
float x1 = 0, x2 = 0;
- 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); }
+ 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; }
glutil::Begin block(GL_TRIANGLE_STRIP);
- glVertex3f(x1+x, y, h1);
- glVertex3f(x2+x, y, h1);
- glVertex3f(x1+x, y, h2);
- glVertex3f(x2+x, y, h2);
+ glVertex3f(x1, y, 0.0f);
+ glVertex3f(x2, y, 0.0f);
+ glVertex3f(x1, y, thickness);
+ glVertex3f(x2, y, thickness);
if (m_errorMeter.get() == m_errorMeter.getTarget())
m_errorMeter.setTarget(0.0);
}
|