|
From: Tapio V. <aa...@us...> - 2011-12-18 17:40:24
|
Author: Tapio Vierros <tap...@gm...>
Date: Sun Dec 18 18:36:02 2011 +0200
Change of plans: LayoutSinger will only handle one VocalTrack.
---
game/layout_singer.cc | 32 ++++++++++++++++++--------------
game/layout_singer.hh | 2 +-
game/screen_players.cc | 2 +-
game/screen_sing.cc | 2 +-
4 files changed, 21 insertions(+), 17 deletions(-)
diff --git a/game/layout_singer.cc b/game/layout_singer.cc
index d637634..14e1100 100644
--- a/game/layout_singer.cc
+++ b/game/layout_singer.cc
@@ -38,15 +38,18 @@ void LayoutSinger::drawScore(PositionMode position) {
float b = p->m_color.b;
m_score_text[i%4]->render((boost::format("%04d") % p->getScore()).str());
switch(position) {
- case LayoutSinger::DUET:
case LayoutSinger::FULL:
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::BAND:
+ case LayoutSinger::TOP:
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;
+ case LayoutSinger::BOTTOM:
+ m_player_icon->dimensions.right(0.35).fixedHeight(0.050).center(0.025 + 0.050 * i);
+ m_score_text[i%4]->dimensions().right(0.45).fixedHeight(0.050).center(0.025 + 0.050 * i);
+ break;
case LayoutSinger::LEFT:
case LayoutSinger::RIGHT:
m_player_icon->dimensions.left(-0.5 + 0.01 + 0.25 * i).fixedWidth(0.075).screenTop(0.055);
@@ -70,13 +73,15 @@ void LayoutSinger::drawScore(PositionMode position) {
else if (p->m_prevLineScore > 0.4) prevLineRank = "OK";
m_line_rank_text[i%4]->render(prevLineRank);
switch(position) {
- case LayoutSinger::DUET:
case LayoutSinger::FULL:
m_line_rank_text[i%4]->dimensions().middle(-0.350 + 0.01 + 0.25 * i).fixedHeight(0.055*fzoom).screenTop(0.11);
break;
- case LayoutSinger::BAND:
+ case LayoutSinger::TOP:
m_line_rank_text[i%4]->dimensions().right(0.30).fixedHeight(0.05*fzoom).screenTop(0.025 + 0.050 * i);
break;
+ case LayoutSinger::BOTTOM:
+ m_line_rank_text[i%4]->dimensions().right(0.30).fixedHeight(0.05*fzoom).center(0.025 + 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);
@@ -94,17 +99,15 @@ void LayoutSinger::draw(double time, PositionMode position) {
// Draw notes and pitch waves (only when not in karaoke mode)
if (!config["game/karaoke_mode"].b()) {
switch(position) {
- case LayoutSinger::DUET:
- // TODO: Individual NoteGraphs
- m_noteGraph.draw(time, m_database, NoteGraph::TOP);
- m_noteGraph.draw(time, m_database, NoteGraph::BOTTOM);
- break;
case LayoutSinger::FULL:
m_noteGraph.draw(time, m_database, NoteGraph::FULLSCREEN);
break;
- case LayoutSinger::BAND:
+ case LayoutSinger::TOP:
m_noteGraph.draw(time, m_database, NoteGraph::TOP);
break;
+ case LayoutSinger::BOTTOM:
+ m_noteGraph.draw(time, m_database, NoteGraph::BOTTOM);
+ break;
case LayoutSinger::LEFT:
case LayoutSinger::RIGHT:
m_noteGraph.draw(time, m_database, NoteGraph::LEFT);
@@ -121,13 +124,14 @@ void LayoutSinger::draw(double time, PositionMode position) {
pos.screenBottom(-0.1);
linespacing = 0.06;
break;
- case LayoutSinger::DUET:
- // TODO: Implement
- //break;
- case LayoutSinger::BAND:
+ case LayoutSinger::TOP:
pos.center(-0.05);
linespacing = 0.04;
break;
+ case LayoutSinger::BOTTOM:
+ pos.screenBottom(-0.1);
+ linespacing = 0.04;
+ break;
case LayoutSinger::LEFT:
case LayoutSinger::RIGHT:
pos.screenBottom(-0.1);
diff --git a/game/layout_singer.hh b/game/layout_singer.hh
index e9becc9..235889a 100644
--- a/game/layout_singer.hh
+++ b/game/layout_singer.hh
@@ -49,7 +49,7 @@ class LyricRow {
class LayoutSinger {
public:
- enum PositionMode {FULL, DUET, BAND, LEFT, RIGHT};
+ enum PositionMode {FULL, TOP, BOTTOM, LEFT, RIGHT};
/// ThemeSing is optional if you want to use drawScore only
LayoutSinger(VocalTrack& vocal, Database& database, boost::shared_ptr<ThemeSing> theme = boost::shared_ptr<ThemeSing>());
~LayoutSinger();
diff --git a/game/screen_players.cc b/game/screen_players.cc
index dd1d60e..9f49b6d 100644
--- a/game/screen_players.cc
+++ b/game/screen_players.cc
@@ -175,6 +175,6 @@ void ScreenPlayers::draw() {
if (!video.empty() && config["graphic/video"].b()) m_video.reset(new Video(video, videoGap));
m_playing = music;
}
- m_layout_singer->drawScore(LayoutSinger::BAND);
+ m_layout_singer->drawScore(LayoutSinger::TOP);
}
diff --git a/game/screen_sing.cc b/game/screen_sing.cc
index bab75ba..c6e249d 100644
--- a/game/screen_sing.cc
+++ b/game/screen_sing.cc
@@ -465,7 +465,7 @@ void ScreenSing::draw() {
// Band
} else {
m_only_singers_alive = !instrumentLayout(time);
- m_layout_singer->draw(time, m_only_singers_alive ? LayoutSinger::FULL : LayoutSinger::BAND);
+ m_layout_singer->draw(time, m_only_singers_alive ? LayoutSinger::FULL : LayoutSinger::TOP);
}
Song::Status status = m_song->status(time);
|