|
From: Tapio V. <aa...@us...> - 2009-11-10 19:19:59
|
Module: performous
Branch: dance
Commit: dfb436890d9189aa7e790a04009b23b92557afad
Author: Tapio Vierros <tap...@gm...>
Date: Tue Nov 10 21:17:49 2009 +0200
Preliminary code for vertically split singer layout.
(Needed in order to utilize full screen height for dance graph.)
---
game/layout_singer.cc | 28 ++++++++++++++++++++--------
game/layout_singer.hh | 2 +-
game/notegraph.cc | 6 ++++++
game/notegraph.hh | 2 +-
4 files changed, 28 insertions(+), 10 deletions(-)
diff --git a/game/layout_singer.cc b/game/layout_singer.cc
index d648f89..bd94458 100644
--- a/game/layout_singer.cc
+++ b/game/layout_singer.cc
@@ -38,24 +38,23 @@ void LayoutSinger::drawScore(Position position) {
float g = p->m_color.g;
float b = p->m_color.b;
glColor4f(r, g, b,act);
+ m_score_text[i%4]->render((boost::format("%04d") % p->getScore()).str());
switch(position) {
case LayoutSinger::BOTTOM:
m_player_icon->dimensions.left(-0.5 + 0.01 + 0.25 * i).fixedWidth(0.075).screenTop(0.055);
+ m_score_text[i%4]->dimensions().middle(-0.350 + 0.01 + 0.25 * i).fixedHeight(0.075).screenTop(0.055);
break;
case LayoutSinger::MIDDLE:
m_player_icon->dimensions.right(0.35).fixedHeight(0.050).screenTop(0.025 + 0.050 * i);
+ m_score_text[i%4]->dimensions().right(0.45).fixedHeight(0.050).screenTop(0.025 + 0.050 * i);
break;
- }
- m_player_icon->draw();
- m_score_text[i%4]->render((boost::format("%04d") % p->getScore()).str());
- switch(position) {
- case LayoutSinger::BOTTOM:
+ case LayoutSinger::LEFT:
+ case LayoutSinger::RIGHT:
+ m_player_icon->dimensions.left(-0.5 + 0.01 + 0.25 * i).fixedWidth(0.075).screenTop(0.055);
m_score_text[i%4]->dimensions().middle(-0.350 + 0.01 + 0.25 * i).fixedHeight(0.075).screenTop(0.055);
break;
- case LayoutSinger::MIDDLE:
- m_score_text[i%4]->dimensions().right(0.45).fixedHeight(0.050).screenTop(0.025 + 0.050 * i);
- break;
}
+ m_player_icon->draw();
m_score_text[i%4]->draw();
// Give some feedback on how well the last lyrics row went
float fact = p->m_feedbackFader.get();
@@ -78,6 +77,10 @@ void LayoutSinger::drawScore(Position position) {
case LayoutSinger::MIDDLE:
m_line_rank_text[i%4]->dimensions().right(0.45).fixedHeight(0.04*fzoom).screenTop(0.060 + 0.050 * i);
break;
+ case LayoutSinger::LEFT:
+ case LayoutSinger::RIGHT:
+ m_line_rank_text[i%4]->dimensions().middle(-0.350 + 0.01 + 0.25 * i).fixedHeight(0.055*fzoom).screenTop(0.11);
+ break;
}
m_line_rank_text[i%4]->draw();
}
@@ -95,6 +98,10 @@ void LayoutSinger::draw(double time, Position position) {
case LayoutSinger::MIDDLE:
m_noteGraph.draw(time, m_players, NoteGraph::TOP);
break;
+ case LayoutSinger::LEFT:
+ case LayoutSinger::RIGHT:
+ m_noteGraph.draw(time, m_players, NoteGraph::LEFT);
+ break;
}
}
@@ -110,6 +117,11 @@ void LayoutSinger::draw(double time, Position position) {
pos.center(-0.05);
linespacing = 0.04;
break;
+ case LayoutSinger::LEFT:
+ case LayoutSinger::RIGHT:
+ pos.screenBottom(-0.1);
+ linespacing = 0.06;
+ break;
}
bool dirty;
do {
diff --git a/game/layout_singer.hh b/game/layout_singer.hh
index d03a341..de9d20c 100644
--- a/game/layout_singer.hh
+++ b/game/layout_singer.hh
@@ -46,7 +46,7 @@ class LyricRow {
class LayoutSinger {
public:
- enum Position {BOTTOM, MIDDLE};
+ enum Position {BOTTOM, MIDDLE, LEFT, RIGHT};
/// ThemeSing is optional if you want to use drawScore only
LayoutSinger(Song &_song, Players & players, boost::shared_ptr<ThemeSing> _theme = boost::shared_ptr<ThemeSing>());
~LayoutSinger();
diff --git a/game/notegraph.cc b/game/notegraph.cc
index 8faca44..893a948 100644
--- a/game/notegraph.cc
+++ b/game/notegraph.cc
@@ -86,6 +86,12 @@ void NoteGraph::draw(double time, Players const& players, Position position) {
case NoteGraph::TOP:
dimensions.stretch(1.0, 0.25).bottom(0.0);
break;
+ case NoteGraph::LEFT:
+ dimensions.stretch(0.50, 0.50).bottom(0.0);
+ break;
+ case NoteGraph::RIGHT:
+ dimensions.stretch(0.50, 0.50).bottom(0.0);
+ break;
}
m_max = m_nlTop.get() + 7.0;
m_min = m_nlBottom.get() - 7.0;
diff --git a/game/notegraph.hh b/game/notegraph.hh
index 64aaae8..d25d81c 100644
--- a/game/notegraph.hh
+++ b/game/notegraph.hh
@@ -10,7 +10,7 @@ class Players;
/// handles drawing of notes and waves
class NoteGraph {
public:
- enum Position {FULLSCREEN, TOP};
+ enum Position {FULLSCREEN, TOP, LEFT, RIGHT};
/// constructor
NoteGraph(Song const& song);
/// resets NoteGraph and Notes
|