|
From: Lasse Kärkkäi. <tr...@us...> - 2011-02-24 23:07:42
|
Author: Lasse Karkkainen <tro...@tr...>
Date: Thu Feb 24 23:18:42 2011 +0100
Revert "A lousy attempt to make guitar score calculator 3d and better positioned."
This reverts commit 8bf1a0e1b3494f789cbf03669c838bdabedd7d85.
---
game/guitargraph.cc | 26 ++++++++++++++------------
game/guitargraph.hh | 2 +-
2 files changed, 15 insertions(+), 13 deletions(-)
diff --git a/game/guitargraph.cc b/game/guitargraph.cc
index 9d99945..5b31127 100644
--- a/game/guitargraph.cc
+++ b/game/guitargraph.cc
@@ -799,7 +799,6 @@ void GuitarGraph::draw(double time) {
glTranslatef(frac * offsetX, 0.0f, 0.0f);
glutil::PushMatrixMode pmb(GL_MODELVIEW);
glTranslatef((1.0 - frac) * offsetX, dimensions.y2(), 0.0f);
- drawInfo(time); // Go draw some texts and other interface stuff
// Do some jumping for drums
if (m_drums) {
float jumpanim = m_drumJump.get();
@@ -1027,6 +1026,7 @@ void GuitarGraph::draw(double time) {
m_neckglow.draw();
}
+ drawInfo(time, offsetX, dimensions); // Go draw some texts and other interface stuff
}
/// Draws a single note
@@ -1153,19 +1153,21 @@ void GuitarGraph::drawDrumfill(float tBeg, float tEnd) {
}
/// Draw popups and other info texts
-void GuitarGraph::drawInfo(double time) {
+void GuitarGraph::drawInfo(double time, double offsetX, Dimensions dimensions) {
// Draw info
if (!menuOpen()) {
- float ycor = -0.05;
- float xcor = 0.50;
- float h = 0.075 * 2.0;
- glutil::PushMatrix pm;
- glTranslatef(0.0f, 0.0f, -2.5f);
+ float xcor = 0.35 * dimensions.w();
+ float h = 0.075 * 2.0 * dimensions.w();
+ // Hack to show the scores better when there is more space (1 instrument)
+ if (m_width.get() > 0.99) {
+ xcor += 0.15;
+ h *= 1.2;
+ }
// Draw scores
{
glutil::Color c(Color(0.1f, 0.3f, 1.0f, 0.90f));
m_scoreText->render((boost::format("%04d") % getScore()).str());
- m_scoreText->dimensions().middle(-xcor).fixedHeight(h).bottom(ycor);
+ m_scoreText->dimensions().middle(-xcor + offsetX).fixedHeight(h).screenBottom(-0.24);
m_scoreText->draw();
}
// Draw streak counter
@@ -1173,24 +1175,24 @@ void GuitarGraph::drawInfo(double time) {
glutil::Color c(Color(0.6f, 0.6f, 0.7f, 0.95f));
m_streakText->render(boost::lexical_cast<std::string>(unsigned(m_streak)) + "/"
+ boost::lexical_cast<std::string>(unsigned(m_longestStreak)));
- m_streakText->dimensions().middle(-xcor).fixedHeight(h*0.75).bottom(ycor);
+ m_streakText->dimensions().middle(-xcor + offsetX).fixedHeight(h*0.75).screenBottom(-0.20);
m_streakText->draw();
}
}
// Is Starpower ready?
if (canActivateStarpower()) {
float a = std::abs(std::fmod(time, 1.0) - 0.5f) * 2.0f;
- m_text.dimensions.screenBottom(-0.02).middle(-0.12);
+ m_text.dimensions.screenBottom(-0.02).middle(-0.12 + offsetX);
if (m_drums && m_dfIt != m_drumfills.end() && time >= m_dfIt->begin && time <= m_dfIt->end)
m_text.draw(_("Drum Fill!"), a);
else m_text.draw(_("God Mode Ready!"), a);
} else if (m_solo) {
// Solo
float a = std::abs(std::fmod(time, 1.0) - 0.5f) * 2.0f;
- m_text.dimensions.screenBottom(-0.02).middle(-0.03);
+ m_text.dimensions.screenBottom(-0.02).middle(-0.03 + offsetX);
m_text.draw(_("Solo!"), a);
}
- drawPopups(0.0f);
+ drawPopups(offsetX);
}
/// Draw a bar for drum bass pedal/note
diff --git a/game/guitargraph.hh b/game/guitargraph.hh
index 8cf8f27..313b744 100644
--- a/game/guitargraph.hh
+++ b/game/guitargraph.hh
@@ -124,7 +124,7 @@ class GuitarGraph: public InstrumentGraph {
void drawBar(double time, float h);
void drawNote(int fret, Color, float tBeg, float tEnd, float whammy = 0, bool tappable = false, bool hit = false, double hitAnim = 0.0, double releaseTime = 0.0);
void drawDrumfill(float tBeg, float tEnd);
- void drawInfo(double time);
+ void drawInfo(double time, double offsetX, Dimensions dimensions);
float getFretX(int fret) { return (-2.0f + fret- (m_drums ? 0.5 : 0)) * (m_leftymode.b() ? -1 : 1); }
// Chords & notes
|