|
From: Tapio V. <aa...@us...> - 2012-11-12 22:12:28
|
Author: Tapio Vierros <tap...@gm...>
Date: Tue Nov 13 00:11:23 2012 +0200
Multiple vocal track display in song browser.
---
game/screen_songs.cc | 25 +++++++++++++++----------
1 files changed, 15 insertions(+), 10 deletions(-)
diff --git a/game/screen_songs.cc b/game/screen_songs.cc
index 53c3abd..f01415d 100644
--- a/game/screen_songs.cc
+++ b/game/screen_songs.cc
@@ -315,6 +315,7 @@ void ScreenSongs::drawInstruments(Dimensions const& dim, float alpha) const {
bool is_karaoke = false;
unsigned char typeFilter = m_songs.getTypeFilter();
int guitarCount = 0;
+ int vocalCount = 0;
if( !m_songs.empty() ) {
Song const& song = m_songs.current();
@@ -324,6 +325,7 @@ void ScreenSongs::drawInstruments(Dimensions const& dim, float alpha) const {
have_keyboard = song.hasKeyboard();
have_dance = song.hasDance();
is_karaoke = (song.music.find("vocals") != song.music.end());
+ vocalCount = song.getVocalTrackNames().size();
if (isTrackInside(song.instrumentTracks,TrackName::GUITAR)) guitarCount++;
if (isTrackInside(song.instrumentTracks,TrackName::GUITAR_COOP)) guitarCount++;
if (isTrackInside(song.instrumentTracks,TrackName::GUITAR_RHYTHM)) guitarCount++;
@@ -334,17 +336,20 @@ void ScreenSongs::drawInstruments(Dimensions const& dim, float alpha) const {
float xincr = 0.2f;
{
// vocals
- float a = alpha * (have_vocals ? 1.00 : 0.25);
+ float a = alpha;
float m = !(typeFilter & 8);
- glutil::VertexArray va;
- glmath::vec4 c(m * a, a, m * (is_karaoke ? 0.25f : 1.0f) * a, a);
- x = dim.x1()+0.00*(dim.x2()-dim.x1());
- va.Color(c).TexCoord(getIconTex(1), 0.0f).Vertex(x, dim.y1());
- va.Color(c).TexCoord(getIconTex(1), 1.0f).Vertex(x, dim.y2());
- x = dim.x1()+xincr*(dim.x2()-dim.x1());
- va.Color(c).TexCoord(getIconTex(2), 0.0f).Vertex(x, dim.y1());
- va.Color(c).TexCoord(getIconTex(2), 1.0f).Vertex(x, dim.y2());
- va.Draw();
+ if (vocalCount == 0) { vocalCount = 1; a *= 0.25f; }
+ for (int i = vocalCount-1; i >= 0; i--) {
+ glutil::VertexArray va;
+ glmath::vec4 c(m * a, a, m * (is_karaoke ? 0.25f : 1.0f) * a, a);
+ x = dim.x1()+(i*0.03)*(dim.x2()-dim.x1());
+ va.Color(c).TexCoord(getIconTex(1), 0.0f).Vertex(x, dim.y1());
+ va.Color(c).TexCoord(getIconTex(1), 1.0f).Vertex(x, dim.y2());
+ x = dim.x1()+(xincr+i*0.03)*(dim.x2()-dim.x1());
+ va.Color(c).TexCoord(getIconTex(2), 0.0f).Vertex(x, dim.y1());
+ va.Color(c).TexCoord(getIconTex(2), 1.0f).Vertex(x, dim.y2());
+ va.Draw();
+ }
}
{
// guitars
|