Made faster music optional (default is not to use faster music at all).
git-svn-id: svn+ssh://svn.code.sf.net/p/supertuxkart/code/trunk/supertuxkart@2969 178a84e3-b1eb-0310-8ba1-8eac791a3b58
This commit is contained in:
parent
60df00a17d
commit
c7da51ec46
@ -43,6 +43,7 @@ MusicInformation::MusicInformation(const std::string& filename)
|
||||
m_fast_filename = "";
|
||||
m_normal_music = NULL;
|
||||
m_fast_music = NULL;
|
||||
m_enable_fast = false;
|
||||
m_faster_time = 1.0f;
|
||||
m_max_pitch = 0.1f;
|
||||
m_gain = 1.0f;
|
||||
@ -77,6 +78,7 @@ MusicInformation::MusicInformation(const std::string& filename)
|
||||
LISP->get ("composer", m_composer );
|
||||
LISP->get ("loop", m_numLoops );
|
||||
LISP->get ("music", m_normal_filename);
|
||||
LISP->get ("enable-fast", m_enable_fast );
|
||||
LISP->get ("fast-music", m_fast_filename );
|
||||
// m_faster_time is used for twice: either as time to fade in faster music
|
||||
// (if available), or the time to increase the pitch (if no faster music
|
||||
@ -261,6 +263,7 @@ void MusicInformation::volumeMusic(float gain)
|
||||
//-----------------------------------------------------------------------------
|
||||
void MusicInformation::switchToFastMusic()
|
||||
{
|
||||
if(!m_enable_fast) return;
|
||||
m_time_since_faster = 0.0f;
|
||||
if(m_fast_music)
|
||||
{
|
||||
|
@ -34,6 +34,10 @@ private:
|
||||
std::string m_fast_filename;
|
||||
std::vector<std::string> m_all_tracks;
|
||||
int m_numLoops;
|
||||
/** If faster music is enabled at all (either separate file or using
|
||||
* the pitch shift approach). */
|
||||
bool m_enable_fast;
|
||||
|
||||
float m_gain;
|
||||
float m_adjustedGain;
|
||||
float m_faster_time; // Either time for fading faster
|
||||
|
Loading…
Reference in New Issue
Block a user