|
From: Tapio V. <aa...@us...> - 2011-10-25 19:11:48
|
Author: Tapio Vierros <tap...@gm...>
Date: Tue Oct 25 22:10:16 2011 +0300
Support for NoteGraph rendering to the screen bottom (preparation for duet).
---
game/notegraph.cc | 6 +++++-
game/notegraph.hh | 2 +-
2 files changed, 6 insertions(+), 2 deletions(-)
diff --git a/game/notegraph.cc b/game/notegraph.cc
index 39f0fc8..c8ce4c6 100644
--- a/game/notegraph.cc
+++ b/game/notegraph.cc
@@ -95,6 +95,9 @@ void NoteGraph::draw(double time, Database const& database, Position position) {
case NoteGraph::TOP:
dimensions.stretch(1.0, 0.32).bottom(0.0);
break;
+ case NoteGraph::BOTTOM:
+ dimensions.stretch(1.0, 0.32).top(0.0);
+ break;
case NoteGraph::LEFT:
dimensions.stretch(0.50, 0.50).center().left(-0.5);
break;
@@ -128,7 +131,8 @@ void NoteGraph::draw(double time, Database const& database, Position position) {
float centery = m_baseY + (it->note + 0.4) * m_noteUnit; // Star is 0.4 notes higher than current note
float centerx = x + w - (player_star_offset + 1.2) * hh; // Star is 1.2 units from end
float rot = fmod(time * 5.0, 2.0 * M_PI); // They rotate!
- float zoom = (std::abs((rot-180) / 360.0f) * 0.8f + 0.6f) * (position == NoteGraph::TOP ? 2.3 : 2.0) * hh;
+ bool smallerNoteGraph = ((position == NoteGraph::TOP) || (position == NoteGraph::BOTTOM));
+ float zoom = (std::abs((rot-180) / 360.0f) * 0.8f + 0.6f) * (smallerNoteGraph ? 2.3 : 2.0) * hh;
using namespace glmath;
Transform trans(translate(vec3(centerx, centery, 0.0f)) * rotate(rot, vec3(0.0f, 0.0f, 1.0f)));
{
diff --git a/game/notegraph.hh b/game/notegraph.hh
index a552caf..f92db1c 100644
--- a/game/notegraph.hh
+++ b/game/notegraph.hh
@@ -10,7 +10,7 @@ class Database;
/// handles drawing of notes and waves
class NoteGraph {
public:
- enum Position {FULLSCREEN, TOP, LEFT, RIGHT};
+ enum Position {FULLSCREEN, TOP, BOTTOM, LEFT, RIGHT};
/// constructor
NoteGraph(VocalTrack const& vocal);
/// resets NoteGraph and Notes
|