|
From: rainbyte <rai...@us...> - 2012-07-17 10:44:18
|
Author: Tapio Vierros <tap...@gm...>
Date: Sun Dec 18 18:02:39 2011 +0200
Made LayoutSinger enum values more informative.
---
game/layout_singer.cc | 24 ++++++++++++------------
game/layout_singer.hh | 8 ++++----
game/screen_players.cc | 2 +-
game/screen_sing.cc | 4 ++--
4 files changed, 19 insertions(+), 19 deletions(-)
diff --git a/game/layout_singer.cc b/game/layout_singer.cc
index 09eac21..ae4a6e9 100644
--- a/game/layout_singer.cc
+++ b/game/layout_singer.cc
@@ -21,14 +21,14 @@ LayoutSinger::LayoutSinger(VocalTrack& vocal, Database& database, boost::shared_
m_player_icon.reset(new Surface(getThemePath("sing_pbox.svg")));
}
-LayoutSinger::~LayoutSinger() {};
+LayoutSinger::~LayoutSinger() {}
void LayoutSinger::reset() {
m_lyricit = m_vocal.notes.begin();
m_lyrics.clear();
}
-void LayoutSinger::drawScore(Position position) {
+void LayoutSinger::drawScore(PositionMode position) {
unsigned int i = 0;
for (std::list<Player>::const_iterator p = m_database.cur.begin(); p != m_database.cur.end(); ++p, ++i) {
float act = p->activity();
@@ -38,11 +38,11 @@ void LayoutSinger::drawScore(Position position) {
float b = p->m_color.b;
m_score_text[i%4]->render((boost::format("%04d") % p->getScore()).str());
switch(position) {
- case LayoutSinger::BOTTOM: // Fullscreen
+ case LayoutSinger::FULL: // Fullscreen
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: // Band mode
+ case LayoutSinger::BAND: // Band mode
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;
@@ -69,10 +69,10 @@ void LayoutSinger::drawScore(Position position) {
else if (p->m_prevLineScore > 0.4) prevLineRank = "OK";
m_line_rank_text[i%4]->render(prevLineRank);
switch(position) {
- case LayoutSinger::BOTTOM: // Fullscreen
+ case LayoutSinger::FULL: // Fullscreen
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::MIDDLE: // Band mode
+ case LayoutSinger::BAND: // Band mode
m_line_rank_text[i%4]->dimensions().right(0.30).fixedHeight(0.05*fzoom).screenTop(0.025 + 0.050 * i);
break;
case LayoutSinger::LEFT:
@@ -88,14 +88,14 @@ void LayoutSinger::drawScore(Position position) {
}
}
-void LayoutSinger::draw(double time, Position position) {
+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::BOTTOM: // Fullscreen
+ case LayoutSinger::FULL: // Fullscreen
m_noteGraph.draw(time, m_database, NoteGraph::FULLSCREEN);
break;
- case LayoutSinger::MIDDLE: // Band mode
+ case LayoutSinger::BAND: // Band mode
m_noteGraph.draw(time, m_database, NoteGraph::TOP);
break;
case LayoutSinger::LEFT:
@@ -110,11 +110,11 @@ void LayoutSinger::draw(double time, Position position) {
double linespacing = 0.0;
Dimensions pos;
switch(position) {
- case LayoutSinger::BOTTOM: // Fullscreen
+ case LayoutSinger::FULL: // Fullscreen
pos.screenBottom(-0.1);
linespacing = 0.06;
break;
- case LayoutSinger::MIDDLE: // Band mode
+ case LayoutSinger::BAND: // Band mode
pos.center(-0.05);
linespacing = 0.04;
break;
@@ -143,7 +143,7 @@ void LayoutSinger::draw(double time, Position position) {
for (size_t i = 0; i < m_lyrics.size(); ++i, pos.move(0.0, linespacing)) {
pos.move(0.0, m_lyrics[i].extraspacing.get() * linespacing);
if (i == 0) m_lyrics[0].draw(m_theme->lyrics_now, time, pos);
- else if (i == 1 && position == LayoutSinger::BOTTOM) m_lyrics[1].draw(m_theme->lyrics_next, time, pos);
+ else if (i == 1 && position == LayoutSinger::FULL) m_lyrics[1].draw(m_theme->lyrics_next, time, pos);
}
}
}
diff --git a/game/layout_singer.hh b/game/layout_singer.hh
index 1529aea..a948f5b 100644
--- a/game/layout_singer.hh
+++ b/game/layout_singer.hh
@@ -49,15 +49,15 @@ class LyricRow {
class LayoutSinger {
public:
- enum Position {BOTTOM, MIDDLE, LEFT, RIGHT};
+ enum PositionMode {FULL, BAND, 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();
void reset();
- void draw(double time, Position position = LayoutSinger::BOTTOM);
- void drawScore(Position position);
+ void draw(double time, PositionMode position = LayoutSinger::FULL);
+ void drawScore(PositionMode position);
double lyrics_begin() const;
- void hideLyrics(bool hide = true) { m_hideLyrics = hide; };
+ void hideLyrics(bool hide = true) { m_hideLyrics = hide; }
private:
VocalTrack& m_vocal;
NoteGraph m_noteGraph;
diff --git a/game/screen_players.cc b/game/screen_players.cc
index ae302f8..dd1d60e 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::MIDDLE);
+ m_layout_singer->drawScore(LayoutSinger::BAND);
}
diff --git a/game/screen_sing.cc b/game/screen_sing.cc
index ff0f90c..bab75ba 100644
--- a/game/screen_sing.cc
+++ b/game/screen_sing.cc
@@ -460,12 +460,12 @@ void ScreenSing::draw() {
m_only_singers_alive = false;
// Singing only
} else if( m_instruments.empty() ) {
- m_layout_singer->draw(time, LayoutSinger::BOTTOM);
+ m_layout_singer->draw(time, LayoutSinger::FULL);
m_only_singers_alive = true;
// Band
} else {
m_only_singers_alive = !instrumentLayout(time);
- m_layout_singer->draw(time, m_only_singers_alive ? LayoutSinger::BOTTOM : LayoutSinger::MIDDLE);
+ m_layout_singer->draw(time, m_only_singers_alive ? LayoutSinger::FULL : LayoutSinger::BAND);
}
Song::Status status = m_song->status(time);
|