Improved disabling audio in-game

git-svn-id: svn+ssh://svn.code.sf.net/p/supertuxkart/code/main/trunk@6253 178a84e3-b1eb-0310-8ba1-8eac791a3b58
This commit is contained in:
auria
2010-10-11 19:33:27 +00:00
parent b957d7923a
commit 947f9a5eb1

View File

@@ -111,6 +111,12 @@ void SFXManager::soundToggled(const bool on)
SFXBuffer* buffer = (*i).second;
buffer->load();
}
resumeAll();
}
else
{
pauseAll();
}
}
@@ -381,10 +387,14 @@ void SFXManager::pauseAll()
} // pauseAll
//----------------------------------------------------------------------------
/** Resumes all paused SFXs.
*/
/**
* Resumes all paused SFXs. If sound is disabled, does nothing.
*/
void SFXManager::resumeAll()
{
// ignore unpausing if sound is disabled
if (!sfxAllowed()) return;
for (std::vector<SFXBase*>::iterator i=m_all_sfx.begin();
i!=m_all_sfx.end(); i++)
{