|
From: Tapio V. <aa...@us...> - 2009-11-11 13:54:50
|
Module: performous
Branch: dance
Commit: 031f125c6c881dbccf9f8b01acf5b2b4005f094d
Author: Tapio Vierros <tap...@gm...>
Date: Wed Nov 11 15:52:52 2009 +0200
Some initial screen_sing/dancegraph integration.
---
game/screen_sing.cc | 12 +++++++++++-
game/screen_sing.hh | 3 +++
2 files changed, 14 insertions(+), 1 deletions(-)
diff --git a/game/screen_sing.cc b/game/screen_sing.cc
index f4c85f8..7655716 100644
--- a/game/screen_sing.cc
+++ b/game/screen_sing.cc
@@ -83,6 +83,14 @@ void ScreenSing::enter() {
} catch (std::runtime_error&) { break; }
}
}
+ // Load dance tracks
+ if ( !m_song->danceTracks.empty() ) {
+ while(1) {
+ try {
+ m_dancers.push_back(new DanceGraph(m_audio, *m_song));
+ } catch (std::runtime_error&) { break; }
+ }
+ }
m_audio.playMusic(m_song->music, false, 0.0, m_instruments.empty() ? -1.0 : -8.0); // Startup delay for instruments is longer than for singing only
}
@@ -242,7 +250,9 @@ void ScreenSing::draw() {
theme->bg_top.draw();
}
- if( m_instruments.empty() ) {
+ if( !m_dancers.empty() ) {
+ m_layout_singer->draw(time, LayoutSinger::LEFT);
+ } else if( m_instruments.empty() ) {
m_layout_singer->draw(time, LayoutSinger::BOTTOM);
} else {
instrumentLayout(time);
diff --git a/game/screen_sing.hh b/game/screen_sing.hh
index 98d3fb5..bd31ccd 100644
--- a/game/screen_sing.hh
+++ b/game/screen_sing.hh
@@ -7,6 +7,7 @@
#include "animvalue.hh"
#include "engine.hh"
#include "guitargraph.hh"
+#include "dancegraph.hh"
#include "screen.hh"
#include "backgrounds.hh"
#include "theme.hh"
@@ -79,7 +80,9 @@ class ScreenSing: public Screen {
boost::scoped_ptr<Engine> m_engine;
boost::scoped_ptr<LayoutSinger> m_layout_singer;
typedef boost::ptr_vector<GuitarGraph> Instruments;
+ typedef boost::ptr_vector<DanceGraph> Dancers;
Instruments m_instruments;
+ Dancers m_dancers;
double m_latencyAV; // Latency between audio and video output (do not confuse with latencyAR)
boost::shared_ptr<ThemeSing> theme;
AnimValue m_quitTimer;
|