Improved my (paul) last patch to allow immediate dis/en-able music from

in race sound option menu.
Removed spaces from ogg file names in those *.track files that required 
it.


git-svn-id: svn+ssh://svn.code.sf.net/p/supertuxkart/code/trunk/supertuxkart@1473 178a84e3-b1eb-0310-8ba1-8eac791a3b58
This commit is contained in:
scifly 2008-02-12 13:50:08 +00:00
parent 981f5bb424
commit 646e98684a
5 changed files with 8 additions and 5 deletions

View File

@ -3,7 +3,7 @@
(tuxkart-track
(name "BSODs Battlements")
(description "Created by Oliver & Steve Baker")
(music "oggs/Lava\ Lagoon_2.ogg")
(music "oggs/Lava_Lagoon_2.ogg")
(screenshot "sshot-bsodcastle.rgb")
(topview "topview-bsodcastle.rgb")
)

View File

@ -4,7 +4,7 @@
(name "Star Track")
(sky-color 0.0 0.0 0.0 0.0)
(description "Created by Ingo Ruhnke")
(music "oggs/Ethereal\ Spectrum\ \(ver\ loop\).ogg")
(music "oggs/Ethereal_Spectrum_\(ver_loop\).ogg")
(screenshot "sshot-startrack.rgb")
(topview "topview-startrack.rgb")
)

View File

@ -103,7 +103,7 @@ void ConfigSound::select()
{
user_config->setMusic(UserConfig::UC_ENABLE);
widget_manager->setWgtText(WTOK_MUSIC, _("Turn off music"));
sound_manager->playMusic(stk_config->m_title_music);
sound_manager->playMusic(sound_manager->getCurrentMusicFile());
}
break;
case WTOK_SFX:

View File

@ -151,6 +151,7 @@ void SoundManager::playSfx(unsigned int id)
void SoundManager::playMusic(const std::string& filename)
{
m_description.clear();
m_current_music_file = filename;
if(!user_config->doMusic() || !m_initialized) return;
if (m_current_music != NULL)
@ -235,8 +236,8 @@ void SoundManager::resumeMusic()
void SoundManager::update()
{
if (m_current_music != NULL)
{
m_current_music->update();
{
m_current_music->update();
}
} // update

View File

@ -50,6 +50,7 @@ public:
void pauseMusic();
void resumeMusic();
const std::vector<std::string>& getDescription() {return m_description;}
std::string getCurrentMusicFile() {return m_current_music_file;}
private:
@ -58,6 +59,7 @@ private:
SFXsType m_sfxs;
Music* m_current_music;
std::vector<std::string> m_description;
std::string m_current_music_file;
bool m_initialized; //If the sound could not be initialized, for example,
//if the player doesn't has a sound card, we want