More than one music file can now be specified for each track, a
random one of those specified is played. git-svn-id: svn+ssh://svn.code.sf.net/p/supertuxkart/code/trunk/supertuxkart@1188 178a84e3-b1eb-0310-8ba1-8eac791a3b58
This commit is contained in:
parent
e893e3af31
commit
c59838bba3
@ -3,7 +3,7 @@
|
||||
(tuxkart-track
|
||||
(name "Race Track")
|
||||
(description "Created by Ingo Ruhnke")
|
||||
(music "mods/tk5a.mod")
|
||||
(music "mods/tk5a.mod" "mods/tk2.mod")
|
||||
(screenshot "images/sshot-race.rgb")
|
||||
(topview "images/topview-race.rgb")
|
||||
)
|
||||
|
@ -748,7 +748,7 @@ void Track::loadTrack(std::string filename_)
|
||||
|
||||
LISP->get("name", m_name);
|
||||
LISP->get("description", m_description);
|
||||
LISP->get("music", m_music_filename);
|
||||
LISP->getVector("music", m_music_filenames);
|
||||
LISP->get("herring", m_herring_style);
|
||||
LISP->get("screenshot", m_screenshot);
|
||||
LISP->get("topview", m_top_view);
|
||||
@ -768,6 +768,11 @@ void Track::loadTrack(std::string filename_)
|
||||
delete ROOT;
|
||||
}
|
||||
|
||||
//-----------------------------------------------------------------------------
|
||||
const std::string& Track::getMusic() const {
|
||||
return m_music_filenames[rand()% m_music_filenames.size()];
|
||||
} // getMusic
|
||||
|
||||
//-----------------------------------------------------------------------------
|
||||
void
|
||||
Track::loadDriveline()
|
||||
|
@ -38,7 +38,7 @@ private:
|
||||
std::string m_ident;
|
||||
std::string m_screenshot;
|
||||
std::string m_top_view;
|
||||
std::string m_music_filename;
|
||||
std::vector<std::string> m_music_filenames;
|
||||
std::string m_herring_style;
|
||||
std::string m_description;
|
||||
std::string m_filename;
|
||||
@ -151,7 +151,7 @@ public:
|
||||
float getTrackLength () const {return m_total_distance;}
|
||||
const char* getIdent () const {return m_ident.c_str(); }
|
||||
const char* getName () const {return m_name.c_str(); }
|
||||
const std::string& getMusic () const {return m_music_filename;}
|
||||
const std::string& getMusic () const;
|
||||
const std::string& getFilename () const {return m_filename; }
|
||||
const sgVec3& getSunPos () const {return m_sun_position; }
|
||||
const sgVec4& getAmbientCol () const {return m_ambient_col; }
|
||||
|
Loading…
Reference in New Issue
Block a user