|
From: Lasse Kärkkäi. <tr...@us...> - 2011-02-24 23:07:48
|
Author: Lasse Karkkainen <tro...@tr...>
Date: Fri Feb 25 00:07:28 2011 +0100
Another attempt at 3d-fied popups and score calculators.
---
game/guitargraph.cc | 2 ++
game/instrumentgraph.hh | 9 ++++++---
2 files changed, 8 insertions(+), 3 deletions(-)
diff --git a/game/guitargraph.cc b/game/guitargraph.cc
index 5b31127..4d3b155 100644
--- a/game/guitargraph.cc
+++ b/game/guitargraph.cc
@@ -1156,6 +1156,8 @@ void GuitarGraph::drawDrumfill(float tBeg, float tEnd) {
void GuitarGraph::drawInfo(double time, double offsetX, Dimensions dimensions) {
// Draw info
if (!menuOpen()) {
+ glutil::PushMatrix mat;
+ glTranslatef(0.0f, 0.0f, -0.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)
diff --git a/game/instrumentgraph.hh b/game/instrumentgraph.hh
index 7b6fd77..85d3585 100644
--- a/game/instrumentgraph.hh
+++ b/game/instrumentgraph.hh
@@ -29,13 +29,16 @@ class Popup {
bool draw(double offsetX) {
double anim = m_anim.get();
if (anim > 0.0 && m_popupText) {
- float s = 0.2 * (1.0 + anim);
float a = 1.0 - anim;
m_color.a = a;
glutil::Color color(m_color);
m_popupText->render(m_msg);
- m_popupText->dimensions().center(0.1).middle(offsetX).stretch(s,s);
- m_popupText->draw();
+ {
+ glutil::PushMatrix mat;
+ glTranslatef(0.0f, 0.0f, 0.5f * anim);
+ m_popupText->dimensions().center(0.1 - 0.03 * anim).middle(offsetX).stretch(0.2f, 0.2f);
+ m_popupText->draw();
+ }
if (m_info != "" && m_infoText) {
m_infoText->dimensions.screenBottom(-0.02).middle(-0.12 + offsetX);
m_infoText->draw(m_info, a);
|